Lazy create runtime maps for multi-map flex layouts#1600
Lazy create runtime maps for multi-map flex layouts#1600
Conversation
Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
|
@copilot Please try again if the rate limit has subsided |
…improve error messages Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
Completed the remaining work in e2c8a2d. Here's a summary of all changes made: Core implementation (48dbe77):
Code review cleanup (e2c8a2d):
All 561 tests pass, code review clean, CodeQL shows 0 alerts. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Integrate latest changes from master and revalidate your work |
…create-runtime-maps branch Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
Integrated all latest master changes in 83131e3. The branch now includes:
All 653 tests pass (up from 561), TypeScript compiles clean, and CodeQL shows 0 alerts. |
|
@copilot Manually resolved conflicts. Pls revalidate your current work. |
Revalidated after manual conflict resolution. All 653 tests pass across 92 test files, TypeScript compilation is clean with no errors. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Implements lazy creation of runtime maps for multi-map flex layouts (
ApplicationDefinition), so that only the first/active map is created at startup. Additional maps are created on demand the first time the user switches to them.Changes Made
Data Model
mapDefandmetadatafields to theMapInfotype indefs.tsto carry deferred map infopendingMapsdictionary toIConfigurationReducerStateincommon.tsto track maps that have not yet been createdInit Flow (
init-mapguide.ts,init-command.ts)createRuntimeMapsAsyncnow only eagerly creates the first MapGuide map in a multi-map flex layout (when not reusing a session and not in stateless mode); remaining maps are deferredsetupMapsupdated to addMapInfoentries (withmap: undefined) for deferred maps so they still appear inavailableMapssetupMapsandinitFromAppDefCoreAsyncsignatures updated to propagate pending map definitionsparseSwipePairs()to parse map swipe pair declarations from the application definition'sMapSetRedux State (
reducers/config.ts,constants/actions.ts)INIT_APPhandler populatespendingMapsfromMapInfoentries that havemapDefset, and storesmapSwipePairsMAP_REFRESHhandler clears a map frompendingMapsonce its runtime map has been loadedMAP_SET_SWIPE_MODEandMAP_UPDATE_SWIPE_POSITIONaction types and handlers for map swipe supportRuntime Lazy Loading (
actions/map.ts,containers/map-menu.tsx)activateMapthunk checks if the target map is inpendingMaps; if so, it creates the runtime map on demand using the current session before dispatchingMAP_SET_ACTIVE_MAPMapMenuContainernow usesactivateMapinstead ofsetActiveMapso all map switches go through the lazy-load pathMap Swipe Feature (integrated from master)
IMapSwipePairinterface tocommon.tsdescribing primary/secondary map pairs for side-by-side swipe comparisonsetMapSwipeMode()andupdateMapSwipePosition()action creatorsMapSwipecommand toDefaultCommandswith registration indefault-commands.tsand widget mapping incommand-spec.tsswipeActiveandswipePositionstate fields toIConfigurationReducerStateMapViewerSwipecomponent (map-viewer-swipe.tsx) for the swipe UIadd-manage-layers.tsx,layer-set-group-base.ts, and map provider classesTesting
reducers/config.spec.tsforpendingMapspopulation and clearing behaviour, and forMAP_SET_SWIPE_MODE/MAP_UPDATE_SWIPE_POSITIONhandlersactions/map.spec.tsfor theactivateMapthunk (non-pending case and pending-with-no-session case)actions/init-command.spec.tsforparseSwipePairs()test/api/layer-set-group-swipe.spec.ts) and swipe-aware layer manager UI (test/containers/add-manage-layers.spec.tsx)Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.