feat: Implement modern layout with sliding panels#57
Conversation
…l management, state handling, and layout recalculation
…ation, tool management, and state handling
…lt and enhanced layout
…n layout components and documentation
There was a problem hiding this comment.
This file add tools to the panel. It needs further review/modification after we start working on tools. Please ignore this file for now.
2. Update code to use getToolsForPanel function
…ed configuration validation
…g unnecessary css properties
| <Typography className={c.subtitle2}> | ||
| {`Choose the rendering engine for this mission's 2D map. This cannot be changed after the mission is created.`} | ||
| </Typography> | ||
| <FormControl className={c.planetDropdown} variant="filled"> |
There was a problem hiding this comment.
This is leftover from MMGIS. It only had planet dropdown as dropdown field so the class is named planetDropdown. We're using the same class name for all other dropdown fields. Will refactor it to something appropriate.
| }, | ||
| { | ||
| "name": "Modern Interface Config", | ||
| "components": [ |
There was a problem hiding this comment.
this doesn't cover all the configurations available, what is the plan for supporting all the config and is it documented somewhere?
There was a problem hiding this comment.
I've exposed most of the configurations needed for Panel Manager in another PR but it'll still need some work. We need to decide how much work we are going to put in the current Mission Config app vs our own tool builder.
One blocker is everything is static so I can't conditionally render fields based other fields. Say, only show deck.gl specific config fields if the rendering engine is deck.gl.
| :root { | ||
| --uswds-primary: #005ea2; /* primary blue */ | ||
| --uswds-primary-dark: #1a4480; | ||
| --uswds-primary-light: #73b3e7; | ||
| --uswds-base-darker: #171c1e; | ||
| --uswds-base-dark: #3d4551; | ||
| --uswds-base-light: #f0f0f0; | ||
| --uswds-white: #ffffff; | ||
| --uswds-shadow: rgba(0, 0, 0, 0.15); | ||
|
|
||
| --modern-bg: #f8f9fa; | ||
| --modern-panel-bg: rgba(255, 255, 255, 0.95); | ||
| --modern-border: 1px solid rgba(0, 0, 0, 0.1); | ||
| --modern-radius: 8px; | ||
| --modern-glass-blur: blur(12px); | ||
| --z-index-panel-drag: 10; | ||
| --z-index-compact-center: 10; | ||
| --z-index-panel-icons: 2; | ||
| } |
There was a problem hiding this comment.
putting these under :root will make them leak into the host application if mmgis is embedded, scope it under some mmgis specific unique name or scope with a prefix like --mmgis-modern-…
| renderStackedLayout: function (panel, body) { | ||
| const toolsArray = PanelManager_.getToolsForPanel(panel.id) | ||
| toolsArray.forEach(toolMetadata => { | ||
| body.append(this.createToolCard(toolMetadata.id, toolMetadata.name)) |
There was a problem hiding this comment.
can you add a "TODO" to all of these lines that need to be changed later if they are not already changed in #80
There was a problem hiding this comment.
I've already made all the changes needed to render tools on #80
shouldn't be any TODOs
| if (panel.tools && panel.tools.size > 0) { | ||
| const toolsArray = PanelManager_.getToolsForPanel(panel.id) | ||
| toolsArray.forEach(toolMetadata => { | ||
| const iconBtn = $(`<button class="ui-panel-icon-btn" title="${toolMetadata.name}" data-tool="${toolMetadata.id}"><span class="mdi mdi-view-dashboard"></span></button>`) |
There was a problem hiding this comment.
don't we have toolMetadata.icon? if so, use that
There was a problem hiding this comment.
I've done that in my next PR
| "panels": [ | ||
| // Array of panel configurations | ||
| ], | ||
| "": { |
There was a problem hiding this comment.
I've panel id which'll act as a key
| * @param {string} preset - Preset name ('default', 'minimal', 'full') | ||
| * @returns {Object} - Dashboard config object | ||
| */ | ||
| export function getDefaultDashboardConfig(preset = 'default') { |
There was a problem hiding this comment.
this doesn't seem to be called anywhere?
There was a problem hiding this comment.
created this as a preset configs which can be used as template in future or can be used to add missing config. it isn't used right now.
| this._registerPanels() | ||
|
|
||
| // Load and assign tools to panels based on configuration | ||
| const tools = this.configData?.tools || [] |
There was a problem hiding this comment.
can this.configData ever be undefined? we've been using it like it exists above this line
There was a problem hiding this comment.
No, this.configData should always be there. Using optional chaining only for additional safety check
| const mode = config?.msv?.mode || 'classic' | ||
|
|
||
| if (mode === 'modern') { | ||
| modern.init(config, missions) |
There was a problem hiding this comment.
this can throw an error based on modern.js:R109-R113 - but this doesn't catch or anything - user sees a frozen loading page but no errors (only on the console log). show the error to user
|
also why .js files? |
|
Also add some tests for the newly added files like the validator, the lifecyc le, toolcontroller, etc |
…age when the loading fails
|
@slesaad I made changes based on the feedback. Could you please have a look at it? Thanks 😁 |
Purpose
Implement modern layout with flexible panels in MMGIS
Proposed Changes
Issues
#48
Testing