Open the editor from the migration dot and badge - #1653
Conversation
|
@esphbot review |
There was a problem hiding this comment.
Pull request overview
This PR makes the “config migration available” indicators (device card dot, table dot, and drawer badge) actionable so they open the device editor in a “reveal” mode that surfaces the migration notice reliably (not landing in a YAML-only pane on mobile). It also rethemes the editor’s migration notice to match the same purple accent used on the dashboard.
Changes:
- Convert migration indicators into buttons that emit a dedicated
open-config-migrationevent and prevent parent click/row activation. - Add
revealsupport toeditDevice()and bindopen-config-migrationtoeditDevice(device, { reveal: true })across card grid, table, and drawer. - Introduce
--notice-accentin shared notice banner styles and set it for the config migration notice; add a new English tooltip/ARIA string for the action label.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/components/device-card-migration-dot.test.ts | Updates tests to assert the card migration dot is actionable, emits open-config-migration, and is passive in select mode. |
| test/components/dashboard/table-columns.test.ts | Adds assertions that the table migration dot deep-links to the editor and stops row click; checks passive rendering in select mode. |
| test/components/dashboard/device-drawer-content-migration.test.ts | Updates tests to expect the drawer migration badge to be a button that emits open-config-migration with device detail. |
| src/translations/en.json | Adds an action-oriented label key for the migration indicator tooltip/ARIA label. |
| src/components/device/notice-banner.styles.ts | Adds --notice-accent hook so notices can be retinted without changing default warning styling. |
| src/components/device/config-migration-notice.ts | Sets --notice-accent to the migration purple for the migration notice banner. |
| src/components/device-card/styles.ts | Adds button reset/focus styling for the migration dot now that it’s clickable. |
| src/components/device-card/render-bits.ts | Introduces renderMigrationDot() to render an actionable button (or passive indicator in select mode) and fire open-config-migration. |
| src/components/device-card.ts | Switches card rendering to use renderMigrationDot(this) instead of inline span markup. |
| src/components/dashboard/table-columns.ts | Renders an actionable migration dot button in the name cell (non-select mode) that dispatches open-config-migration with device detail. |
| src/components/dashboard/table-cell-styles.ts | Adds button reset/focus styling for the clickable migration dot in table cells. |
| src/components/dashboard/render-content.ts | Wires open-config-migration to open the editor with { reveal: true } from cards, table, and drawer. |
| src/components/dashboard/device-drawer-content.ts | Converts the migration badge to a button that fires open-config-migration. |
| src/components/dashboard/actions.ts | Extends editDevice() to accept { reveal?: boolean } and append ?reveal=1 when requested. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ? html`<button | ||
| type="button" | ||
| class="status-badge status-badge--migration" | ||
| title=${this._localize("dashboard.status_migration_available_action")} | ||
| @click=${() => fireEvent(this, "open-config-migration", d)} | ||
| > |
|
@esphbot review |
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
@esphbot review |
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
@esphbot review |
|
Re-reviewed at current head. Both prior suggestions now resolved.
One nit left: duplicate |
PR Review — Open the editor from the migration dot and badgeMerge-ready. Both open items from my previous pass are resolved in this revision; the only thing left is one a11y nit that is a judgement call, not a defect. What's solid, re-verified against the tree:
Key point:
Not verified: the branch isn't fetchable from this checkout, so the new tests were not executed — findings come from reading the diff against 🟢 Suggestions
1. Drawer badge repeats the same string in `title` and `aria-label`
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
What does this implement/fix?
Clicking the purple migration dot on a device card or table row, or the "Config migration available" badge in the drawer, now opens the editor; the migrate nudge is right there, so the next click is Update config. The indicators fire a dedicated
open-config-migrationevent bound toeditDevice(device, { reveal: true }); the reveal intent matters because on mobile, or a saved YAML only layout, a plain editor open lands in the YAML pane where the nudge never renders. The card dot goes passive in select mode, same rule as the encryption button, and the table dot falls back to the passive indicator there too.The editor's migration notice is also retinted to the migration purple so the identity is consistent from dashboard to nudge; the shared notice banner gains a
--notice-accenthook that defaults to the old warning color, so the mac suffix and security notices are unchanged.Verified in the browser on desktop and mobile viewports: all three surfaces land on the visual pane with the notice visible, Update config applies, and the notice clears.
Followup to #1652.
Related issue or feature (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesChecklist
pnpm run lintpasses.pnpm run testpasses.