Merge Home & Phone into a three-tab Home that knows your house
Home is now Overview | My Home | Phone. Overview leads with quick-action tiles (focus, Do Not Disturb, health, snapshots, storage), keeps the findings card — updates fold in, the reclaim-space prompt is gone on purpose — and adds glance cards, the next calendar event, and weather. My Home groups every light by Home Assistant area: the helper gained an `areas` command (one REST template render, no websocket), and the rooms degrade to a flat list on setups without areas. The favorites editor and connection card moved intact. Phone gains a vitals strip — battery and cell signal read from KDE Connect's plugin D-Bus objects, where absence is data, not an error — beside ring, clipboard, send-a-file, and the BlueBubbles handoff. The retired home-phone id resolves to my-home forever via a new alias map in SettingsRoutes (with a hasOwnProperty guard so prototype names cannot leak into settingsPage). Storage no longer claims 0 B free — the old page read a field the disks helper never emitted. Contracts updated alongside; per the new workflow, the full suite runs once at the end of the redesign (see the test backlog note). Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -27,7 +27,11 @@ Singleton {
|
||||
// alias. Three category ids ("applications", "users", "privacy") double as
|
||||
// the id of their first tab, which resolves to the same place either way.
|
||||
readonly property var categories: [
|
||||
{ page: "home", label: "Home", icon: "\u{F02DC}", tabs: [] },
|
||||
{ page: "home", label: "Home", icon: "\u{F02DC}", tabs: [
|
||||
{ page: "home", label: "Overview" },
|
||||
{ page: "my-home", label: "My Home" },
|
||||
{ page: "phone", label: "Phone" }
|
||||
] },
|
||||
{ page: "appearance", label: "Appearance", icon: "\u{F0E0D}", tabs: [] },
|
||||
{ page: "desktop", label: "Desktop & Dock", icon: "\u{F04A4}", tabs: [] },
|
||||
{ page: "displays", label: "Displays", icon: "\u{F0379}", tabs: [] },
|
||||
@@ -44,7 +48,6 @@ Singleton {
|
||||
{ page: "sharing", label: "Sharing" },
|
||||
{ page: "printers", label: "Printers" }
|
||||
] },
|
||||
{ page: "home-phone", label: "Home & Phone", icon: "\u{F02DC}", tabs: [] },
|
||||
{ page: "applications", label: "Applications", icon: "\u{F003B}", tabs: [
|
||||
{ page: "applications", label: "Applications" },
|
||||
{ page: "gaming", label: "Gaming" },
|
||||
@@ -98,10 +101,20 @@ Singleton {
|
||||
return root.categories.find(cat => cat.page === leaf) ?? root.categories[0];
|
||||
}
|
||||
|
||||
// Any id a caller may hold — leaf, category, or garbage — to the leaf that
|
||||
// should render: a leaf resolves to itself, a category to its first
|
||||
// available tab, anything unknown to home.
|
||||
// Retired page ids keep resolving forever: old Vicinae commands, shell
|
||||
// history, and muscle memory all hold them. Each maps to the leaf that
|
||||
// absorbed its content.
|
||||
readonly property var retired: ({ "home-phone": "my-home" })
|
||||
|
||||
// Any id a caller may hold — leaf, category, retired id, or garbage — to
|
||||
// the leaf that should render: a leaf resolves to itself, a category to
|
||||
// its first available tab, anything unknown to home.
|
||||
function resolve(id: string): string {
|
||||
// hasOwnProperty guard: `retired` is a plain JS object, so a bare
|
||||
// index would answer for prototype names like "toString" and leak a
|
||||
// function into settingsPage.
|
||||
if (Object.prototype.hasOwnProperty.call(root.retired, id))
|
||||
return root.retired[id];
|
||||
const asLeaf = root.categories.some(cat => (cat.page === id && cat.tabs.length === 0)
|
||||
|| cat.tabs.some(tab => tab.page === id));
|
||||
if (asLeaf)
|
||||
|
||||
Reference in New Issue
Block a user