Fix app-shell review findings (#82 follow-up) #94

Closed
opened 2026-07-02 18:29:22 +02:00 by timothy · 1 comment
Owner

Follow-up from a high-effort code review of the app shell (#82, commit 5fb3bb2e). All findings are in web/src/App.tsx; verified by an independent adversarial pass. Ranked most-severe first.

Functional

  • 1. Connect URLs are root-relative → unusable in external players (App.tsx:352)
    Connect emits /iptv/channels.m3u with no scheme+host. Pasted into VLC/Jellyfin on another device it can't resolve. Use `${window.location.origin}/iptv/channels.m3u` (and the XMLTV URL likewise).
  • 2. "Only enabled channels" toggle is a silent no-op (App.tsx:352, :321)
    It appends ?enabled=1, but IptvController.GetChannelPlaylist only reads mode + access_token (GetGuide only access_token). enabled is ignored, so the toggle does nothing and the copied URL misleads. Either wire a param the controller honors or remove the toggle.
  • 3. Cmd/Ctrl/Shift+click on nav links broken (App.tsx:603)
    navigate() calls event.preventDefault() unconditionally, suppressing native new-tab/new-window. Guard: if (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0) return; before preventing default.
  • 4. Unknown paths silently render Dashboard (App.tsx:227, :191, :337)
    routeFromLocation() falls back to Dashboard for any non-exact match, so reloading/bookmarking /app/channels/42 (or a typo) shows Dashboard under the wrong URL with no active nav highlight. Add a real not-found state or path correction.

Accessibility

  • 5. Connect menu is role="dialog" but has no Escape / focus management (App.tsx:344)
    Keyboard users can't dismiss it (only a mouse overlay closes it) and focus never enters it. Add an Escape/keydown handler + focus into the menu.

Cleanup

  • 6. Hardcoded "128 channels" (App.tsx:347)
    The live count is already available via useChannelsQuery (used by LiveChannelsCard).

Refuted (not a bug): a redundant no-op useMemo at App.tsx:600.

Related: #82 (source), epic #59.

Follow-up from a high-effort code review of the app shell (#82, commit `5fb3bb2e`). All findings are in `web/src/App.tsx`; verified by an independent adversarial pass. Ranked most-severe first. ## Functional - [ ] **1. Connect URLs are root-relative → unusable in external players** (`App.tsx:352`) Connect emits `/iptv/channels.m3u` with no scheme+host. Pasted into VLC/Jellyfin on another device it can't resolve. Use `` `${window.location.origin}/iptv/channels.m3u` `` (and the XMLTV URL likewise). - [ ] **2. "Only enabled channels" toggle is a silent no-op** (`App.tsx:352`, `:321`) It appends `?enabled=1`, but `IptvController.GetChannelPlaylist` only reads `mode` + `access_token` (`GetGuide` only `access_token`). `enabled` is ignored, so the toggle does nothing and the copied URL misleads. Either wire a param the controller honors or remove the toggle. - [ ] **3. Cmd/Ctrl/Shift+click on nav links broken** (`App.tsx:603`) `navigate()` calls `event.preventDefault()` unconditionally, suppressing native new-tab/new-window. Guard: `if (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0) return;` before preventing default. - [ ] **4. Unknown paths silently render Dashboard** (`App.tsx:227`, `:191`, `:337`) `routeFromLocation()` falls back to Dashboard for any non-exact match, so reloading/bookmarking `/app/channels/42` (or a typo) shows Dashboard under the wrong URL with no active nav highlight. Add a real not-found state or path correction. ## Accessibility - [ ] **5. Connect menu is `role="dialog"` but has no Escape / focus management** (`App.tsx:344`) Keyboard users can't dismiss it (only a mouse overlay closes it) and focus never enters it. Add an Escape/keydown handler + focus into the menu. ## Cleanup - [ ] **6. Hardcoded "128 channels"** (`App.tsx:347`) The live count is already available via `useChannelsQuery` (used by `LiveChannelsCard`). _Refuted (not a bug): a redundant no-op `useMemo` at `App.tsx:600`._ Related: #82 (source), epic #59.
timothy added the frontend label 2026-07-02 18:29:22 +02:00
Author
Owner

Done

What was done: Fixed the app-shell review findings: Connect now emits absolute M3U/XMLTV URLs, removed the ignored enabled-only toggle, preserves native modified nav link clicks, renders an explicit not-found state for unknown app routes, focuses the Connect dialog and closes it with Escape, and uses the live channel count in the Connect header.

Root cause: The app shell used optimistic placeholder UI behavior: Connect built root-relative URLs and appended an unsupported query parameter, route matching defaulted all unknown paths to Dashboard, nav click handling always prevented default browser behavior, and the Connect dialog had no keyboard/focus handling.

Files changed: web/src/App.tsx, web/src/App.test.tsx

Verification: npm test -- --run (23 tests passed); npm run typecheck; npm run lint; npm run build.

Deferred: n/a

Follow-up issues: n/a

Docs updated: no docs/skills impact

## Done **What was done**: Fixed the app-shell review findings: Connect now emits absolute M3U/XMLTV URLs, removed the ignored enabled-only toggle, preserves native modified nav link clicks, renders an explicit not-found state for unknown app routes, focuses the Connect dialog and closes it with Escape, and uses the live channel count in the Connect header. **Root cause**: The app shell used optimistic placeholder UI behavior: Connect built root-relative URLs and appended an unsupported query parameter, route matching defaulted all unknown paths to Dashboard, nav click handling always prevented default browser behavior, and the Connect dialog had no keyboard/focus handling. **Files changed**: `web/src/App.tsx`, `web/src/App.test.tsx` **Verification**: `npm test -- --run` (23 tests passed); `npm run typecheck`; `npm run lint`; `npm run build`. **Deferred**: n/a **Follow-up issues**: n/a **Docs updated**: no docs/skills impact
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv#94