GRI-1764: panel devices and IP rules screens #87

Merged
vivy merged 2 commits from feature/GRI-1764-panel-devices into dev 2026-11-09 20:12:33 +00:00
Member

What

Devices and IP rules screens in frontend-web/, closes #23.

  • Devices: pending list with approve/block; approved list with inline rename, last-seen and assigned playlist.
  • IP rules: blocklist and auto-approve lists, each with add/remove, and the "blocklist evaluated first" rule stated on screen.
  • A tiny History API router (no library yet, per plan/frontend/stack.md) and a nav header, now that there's more than one screen behind login.
  • All four async states covered per list: loading, empty, error (with retry), success.

Stacked on #85

This branch is cut from feature/GRI-1764-panel-login (not dev), so its diff includes that PR's commit until #85 merges — the dashboard shell and session API it adds are what the devices/IP-rules screens render inside. Once #85 merges, I'll rebase this onto dev and the diff will shrink to just this PR's commit.

Why mocked

Same as #85: the server's device/IP-rule routes aren't built yet. Mocked behind src/api/devicesApi.ts and src/api/ipRulesApi.ts, each with a real http*Api.ts implementation already written against plan/server/rest-api.md, switched on with one flag once those routes land.

Verification

cd frontend-web && npm run check   # prettier, oxlint --deny-warnings, tsc -b --noEmit, vitest run
cd frontend-web && npm run build
./scripts/local-gates.sh --frontend-only

All green.

Test plan

  • Loading, then pending + approved devices render
  • Approve moves a device from pending to approved
  • Inline rename on an approved device
  • Empty state when there are no devices
  • Error state with retry (forced read failure)
  • IP rules: add/remove a blocklist entry
  • Empty-label add is blocked (native required)
  • IP rules error state with retry
## What Devices and IP rules screens in `frontend-web/`, closes #23. - Devices: pending list with approve/block; approved list with inline rename, last-seen and assigned playlist. - IP rules: blocklist and auto-approve lists, each with add/remove, and the "blocklist evaluated first" rule stated on screen. - A tiny History API router (no library yet, per `plan/frontend/stack.md`) and a nav header, now that there's more than one screen behind login. - All four async states covered per list: loading, empty, error (with retry), success. ## Stacked on #85 This branch is cut from `feature/GRI-1764-panel-login` (not `dev`), so its diff includes that PR's commit until #85 merges — the dashboard shell and session API it adds are what the devices/IP-rules screens render inside. Once #85 merges, I'll rebase this onto `dev` and the diff will shrink to just this PR's commit. ## Why mocked Same as #85: the server's device/IP-rule routes aren't built yet. Mocked behind `src/api/devicesApi.ts` and `src/api/ipRulesApi.ts`, each with a real `http*Api.ts` implementation already written against `plan/server/rest-api.md`, switched on with one flag once those routes land. ## Verification ``` cd frontend-web && npm run check # prettier, oxlint --deny-warnings, tsc -b --noEmit, vitest run cd frontend-web && npm run build ./scripts/local-gates.sh --frontend-only ``` All green. ## Test plan - [x] Loading, then pending + approved devices render - [x] Approve moves a device from pending to approved - [x] Inline rename on an approved device - [x] Empty state when there are no devices - [x] Error state with retry (forced read failure) - [x] IP rules: add/remove a blocklist entry - [x] Empty-label add is blocked (native `required`) - [x] IP rules error state with retry
GRI-1764: panel first-user setup and login screens
Some checks failed
CI / the pre-push hook (pull_request) Successful in 11s
CI / cargo fmt (pull_request) Successful in 4s
CI / cargo deny (pull_request) Successful in 52s
CI / cargo deny advisories (pull_request) Failing after 53s
CI / cargo clippy (pull_request) Successful in 9m45s
CI / repository boundary (pull_request) Successful in 15s
CI / cargo test (pull_request) Successful in 9m36s
CI / frontend-web (pull_request) Successful in 9m47s
CI / CI (pull_request) Successful in 3s
CI / Notify gate failed (pull_request) Has been skipped
16a6093b15
Mocks the setup/session API behind one switch (src/api/sessionApi.ts)
until the server routes land (GRI-1838, GRI-1853); swap USE_MOCK to
false once they're exercised against the real server.
GRI-1764: panel devices and IP rules screens
Some checks failed
CI / the pre-push hook (pull_request) Successful in 4s
CI / cargo fmt (pull_request) Successful in 5s
CI / cargo deny (pull_request) Successful in 39s
CI / cargo deny advisories (pull_request) Failing after 38s
CI / repository boundary (pull_request) Successful in 10s
CI / cargo clippy (pull_request) Successful in 9m38s
CI / cargo test (pull_request) Successful in 9m41s
CI / frontend-web (pull_request) Successful in 9m56s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 11s
31a84b5706
Devices: pending list with approve/block, approved list with inline
rename, last-seen and assigned playlist. IP rules: blocklist and
auto-approve, each addable/removable, with the evaluation-order note
on screen.

Adds a tiny History API router (no library yet, per
plan/frontend/stack.md) now that there is more than one screen behind
login. Mocked behind devicesApi.ts/ipRulesApi.ts the same way as the
session API, until the server routes land.
vivy merged commit 436be41894 into dev 2026-11-09 20:12:33 +00:00
vivy deleted branch feature/GRI-1764-panel-devices 2026-11-09 20:12:35 +00:00
nexus-warden left a comment

Review after the merge: this PR was merged into dev on 2026-11-09 at 20:12Z before any review existed. I reviewed it on the merged head.

Approved, with one finding that is still live on dev.

IpRulesScreen.tsx: the two Remove buttons call void removeBlocklistEntry(id).then(...) and void removeAutoApproveEntry(id).then(...) with no catch. If the server refuses the removal, or cannot be reached, nothing tells the operator. The row stays, no alert appears, and the rejection goes unhandled. On a blocklist, the operator then has to notice by themselves that the range is still blocked. The fix is small: route the removal through the same error slot that AddRuleForm uses. This is still true at origin/dev ab0cae5, lines 83 and 116.

Minor, and not blocking: a failed rename in ApprovedDeviceRow leaves the edited name in the input even though the server kept the old one.

Review after the merge: this PR was merged into `dev` on 2026-11-09 at 20:12Z before any review existed. I reviewed it on the merged head. **Approved, with one finding that is still live on `dev`.** `IpRulesScreen.tsx`: the two **Remove** buttons call `void removeBlocklistEntry(id).then(...)` and `void removeAutoApproveEntry(id).then(...)` with no `catch`. If the server refuses the removal, or cannot be reached, nothing tells the operator. The row stays, no alert appears, and the rejection goes unhandled. On a blocklist, the operator then has to notice by themselves that the range is still blocked. The fix is small: route the removal through the same error slot that `AddRuleForm` uses. This is still true at `origin/dev` `ab0cae5`, lines 83 and 116. Minor, and not blocking: a failed rename in `ApprovedDeviceRow` leaves the edited name in the input even though the server kept the old one.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!87
No description provided.