Rethink the nav for device page + small ui improvements#376
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the device page navigation UX by adding an in-page “back” affordance and explicit navigator collapse/expand controls, while removing the editor fullscreen toggle and applying a few layout/spacing improvements.
Changes:
- Add a per-page section back-stack and a header back button for navigating within the device editor.
- Add navigator collapse (in navigator header) + expand (edge “tab”) controls, with preference persistence on desktop.
- Update device page/editor/navigator styling and adjust translations to match the new UI copy.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/device.ts | Implements section back-stack, mobile/desktop navigator collapse/expand behavior, and hooks new events. |
| src/components/device/device-navigator.ts | Adds a collapse button that emits a nav-collapse event to the page. |
| src/pages/device-styles.ts | Updates device page layout sizing and adds styles for the new back button + navigator edge tab. |
| src/components/device/device-editor.ts | Removes fullscreen editor toggle and renames the header slot to support the new back button. |
| src/components/device/device-editor.styles.ts | Removes fullscreen-related styles and adds slotted header-start spacing. |
| src/components/device/device-section-config.styles.ts | Cleans up table block comment and adjusts spacing for manage-list sections. |
| src/translations/en.json | Replaces old editor expand/collapse copy with new back/navigator strings. |
| src/translations/fr.json | Same translation updates for French. |
| src/translations/nl.json | Same translation updates for Dutch. |
Comment on lines
753
to
+758
| "add_automation_error": "Failed to add automation", | ||
| "add_config_error": "Failed to add config section", | ||
| "editor_layout_label": "Editor layout", | ||
| "editor_expand": "Expand editor", | ||
| "editor_collapse": "Collapse editor", | ||
| "back": "Back", | ||
| "hide_navigator": "Hide navigator", | ||
| "show_navigator": "Show navigator", |
| padding: var(--wa-space-l); | ||
| min-height: calc(100vh - var(--esphome-header-height) - var(--esphome-footer-height)); | ||
| padding: var(--wa-space-l) var(--wa-space-l) 0; | ||
| min-height: calc(100vh - var(--esphome-header-height)); |
Comment on lines
+103
to
+105
| /* Mobile page has no padding so the calc width collapses to a | ||
| negative value — fall back to a fixed width that sticks the | ||
| tab off the viewport's left edge over the editor. */ |
Comment on lines
+130
to
+134
| @state() | ||
| private _isMobile = window.matchMedia("(max-width: 900px)").matches; | ||
|
|
||
| private _mql = window.matchMedia("(max-width: 900px)"); | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix?
Related issue or feature (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesChecklist
npm run lintpasses.npm run testpasses.