From b2ce13de4aeefde5960ea2adbc09523edbb64117 Mon Sep 17 00:00:00 2001 From: Anne Douwe Bouma Date: Fri, 30 Oct 2026 18:23:35 +0100 Subject: [PATCH] feat(home): show Wi-Fi and internet status on the home screen A chip next to the Settings gear reports the link type from the connection manager and probes a neutral host for internet reachability, because LG's isInternetConnectionAvailable can stay true without an uplink. A failed probe is confirmed once after ten seconds; probing pauses while another app or the saver is in front. Clicking the chip opens TV Settings, with an unverified network target and the existing launch as the fallback. The chip can be turned off in Look -> Clock & icons; the config schema moves to 29. Closes #101 --- CONTEXT.md | 3 + docs/agents/architecture.md | 4 +- docs/agents/layout.md | 2 +- src/index.html | 1 + src/styles/main.css | 23 ++ src/ts/config/config.ts | 11 +- src/ts/focus/focus.ts | 5 +- src/ts/home/network-status.ts | 333 ++++++++++++++++++ src/ts/lib/i18n-de.ts | 8 + src/ts/lib/i18n-en.ts | 9 + src/ts/lib/i18n-fr.ts | 8 + src/ts/lib/i18n-nl.ts | 8 + src/ts/lib/types.ts | 2 + src/ts/luna/luna.ts | 4 +- src/ts/main.ts | 36 +- src/ts/settings/panes/look.ts | 9 + .../settings-focus-index.test.ts.snap | 1 + test/config.test.ts | 22 ++ test/home/network-status.test.ts | 298 ++++++++++++++++ test/settings-panel.test.ts | 25 ++ 20 files changed, 800 insertions(+), 12 deletions(-) create mode 100644 src/ts/home/network-status.ts create mode 100644 test/home/network-status.test.ts diff --git a/CONTEXT.md b/CONTEXT.md index 0e4a54d..b7c0ae1 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -31,6 +31,9 @@ backgrounds and music, all on top of the webOS Luna service bus. `off`. - **Weather panel**: the home-screen card or inline weather line (`weather.ts`). The inline line also appears in the screensaver clock block. +- **Network status**: the Wi-Fi/Ethernet and internet chip in the top bar, left of + the Settings gear (`network-status.ts`). Link type comes from the connection + manager; internet reachability comes from a two-host probe. - **Settings panel**: the category list and pane UI (`settings.ts`). - **Screensaver**: two different things. The system screensaver is LG's gallery saver (`screensaverMinutes`). The in-app screensaver is Ember's own diff --git a/docs/agents/architecture.md b/docs/agents/architecture.md index d7f28fa..5506c66 100644 --- a/docs/agents/architecture.md +++ b/docs/agents/architecture.md @@ -78,8 +78,8 @@ an object with methods plus the config accessor `applyConfig()`. The composition root calls those methods. Modules never call each other except through injected callbacks. Examples include `BackgroundController`, `MusicPlayer`, `AppGrid`, `FocusManager`, `SettingsPanelHandle`, `CustomScreensaver`, -`WeatherPanelHandle`, `InputRowHandle`, `ChannelStripHandle`, `HomePaint` and -`AllApps`. +`WeatherPanelHandle`, `NetworkStatusHandle`, `InputRowHandle`, +`ChannelStripHandle`, `HomePaint` and `AllApps`. Cross-cutting callbacks are passed in, such as `onToast`, `focusControl` and `onBeforeLaunch`. If a module needs to do something the host owns, add a diff --git a/docs/agents/layout.md b/docs/agents/layout.md index 6468b53..bdcae15 100644 --- a/docs/agents/layout.md +++ b/docs/agents/layout.md @@ -29,7 +29,7 @@ grouped by domain: | `music/` | `@music` | The ambient music player and its built-in track manifest. | | `settings/` | `@settings` | The Settings panel (the composition root in `settings.ts`), the panel's key navigation and wheel scrolling (`navigation.ts`), backup/restore, field bindings, the text-field gate (`text-gate.ts`) and the pane seam (`pane.ts`). UI components live in `settings/components/`, category panes in `settings/panes/`. | | `focus/` | `@focus` | Focus manager and the row model it moves over. | -| `home/` | `@home` | Home-screen rows and panels: TV inputs, channels, weather, and the home paint pass. | +| `home/` | `@home` | Home-screen rows and panels: TV inputs, channels, weather, the network status chip, and the home paint pass. | | `config/` | `@config` | The config tree: load, save, normalize, and profiles. | | `luna/` | `@luna` | The webOS Luna service transport (`luna-transport.ts`), the service calls (`luna.ts`), the privileged root script (`root.ts`) and platform/device helpers. | | `lib/` | `@lib` | Shared vocabulary and utilities: `types.ts`, `compat.ts`, `version.ts`, `usb.ts`, `remote.ts`, and other cross-cutting helpers. | diff --git a/src/index.html b/src/index.html index 1244ccc..d951079 100644 --- a/src/index.html +++ b/src/index.html @@ -23,6 +23,7 @@
+