Repository navigation
feat(console): durable addresses for records and filters, keyboard-operable rows - #128
DMontgomery40 wants to merge 8 commits into
Conversation
Sent, Received, Expected and Recipients records now open from an address that keeps the list filter with the record (?fax=, ?item=, ?expected=, ?recipient= plus status/show/q), so a copied link, a reload or Back restores the same record over the same filtered list. A record this person may not see opens nothing: Received shows a safe not-found line and the detail dialogs keep their server-checked errors. Rows in the four lists were click-only; each now opens from a real link with a visible focus outline (copy link, new tab and keyboard included), and moving to another page puts the focus on its heading. Query-only moves keep the scroll position, so Back lands where the list was left. The fax Send queues, Dashboard and Received follow into Sent through the record address. The command line already named the same records (faxes sent get, faxes received get, faxes expected show, recipients show), so no CLI change was needed; the console/CLI parity and settings coverage checks pass unchanged. These lists have no paging controls, so there is no page number to keep in the address yet. Issue #54 (spec #48, after #49 and #51).
The focus move to a new page's heading tried once, right after the page mounted, and gave up when no heading was there yet. Overview shows a spinner until its data lands, so moving there left focus on the panel; Number moves, Logs, Blocked senders and NPI record had no page heading (h1) at all, so focus never moved on those either. The shell now waits a bounded time for the page heading to appear and focuses it then. It stops waiting when the person moves focus into the page themselves, or when they leave the page. The four pages without an h1 now render their existing title as the page heading, with the same look. The every-page navigation test now checks, for each page it opens, that focus lands on that page's heading inside main (the Terminal hands it to its shell once that opens), so a page without a heading fails the test. Its timeout grows to 120 s for the extra waits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Overview shows a spinner before its heading. Opening it from another page must still end with the keyboard focus on its heading. On the code before the previous commit this test fails (focus stays on the body), alongside the every-page check that lists Number moves, Blocked senders, NPI record and Logs as pages without a heading to focus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two gaps in opening the received document a copied link names (#/faxes/received?item=...): - Someone without the owners list saw nothing at all: the page waited for a list it never loads. They now see the same short not-found line as for any document they may not see, and nothing opens. - A document beyond the loaded list is read on its own. That answer was dropped whenever the page re-rendered before it arrived (the console shell hands the page a fresh callback on each of its renders), and it was never asked for again, so the link opened nothing. The answer now counts for as long as the address still names that document. Both tests fail on the previous commit's Received.tsx. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README said the command line opens a sent and a received fax with `faxbot faxes sent get` and `faxbot faxes received get`. Those names belong to the removed `jobs` and `inbound` groups; the commands are `faxes sent show` and `faxes received show`. The record and roadmap lines now give the right names (also in the received-history entry), add the list filters the console's addresses match (`faxes sent list --status/--hours/--held`, `faxes expected list --show/--search`), and say what a record you may not see shows: Received says it could not be found, the other lists show only why it could not be loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ound trip Opening a fax in Sent now travels in the address (?fax=), so the shell's jobToOpen state was never set and the Sent page's openJobId/onOpened wiring did nothing. Both are removed from the shell and PageContext; JobsList keeps its openJobId prop for callers outside the shell. A shell-level test signs in at a filtered Sent list, opens a fax from its row link, checks the address carries the filter and the fax, then goes Back (details close over the same filtered list) and Forward (the same fax opens again). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "Open it" buttons in a sent fax's details (the fax that carries its remaining pages, the fax it continues, an uncertain fax's linked fax) opened the other fax in place, so the address still named the first fax: a copied link or a reload showed the wrong fax, and Back skipped the first one. They now open the other fax through its address, like a row link, so Back returns to the fax they were opened from. The test fails on the previous JobsList.tsx (the address is never told). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t (merge train: #128 lands first)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 357ee6ffbd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const found = (work ?? []).find((candidate) => candidate.id === itemId); | ||
| if (found) { | ||
| setRecordMissing(false); | ||
| setSelected((current) => (current?.id === found.id ? current : found)); | ||
| return; |
There was a problem hiding this comment.
Invalidate pending lookups when opening a listed document
If a copied address starts loading document A outside the loaded work list, and Back/Forward changes the address to document B already in that list before A's request completes, this branch selects B without changing recordAsked.current. A's pending response therefore still passes the guard in the getWork callback and replaces B's details with A's, leaving the displayed document and download target inconsistent with the address. Invalidate the pending lookup on every item-address change, including this cached-list branch.
Useful? React with 👍 / 👎.
Durable addresses for records and filters, and keyboard-operable rows
Every sent fax, received document, expected fax and recipient now opens from its own address, and the list's filter rides in the same address:
#/faxes/sent?status=failed&fax=…,#/faxes/received?show=waiting&item=…,#/faxes/expected?show=overdue&q=PO&expected=…and#/recipients/list?recipient=…. A copied link, a reload or Back reopens the same record over the same filtered list. Changing a filter closes the open record. Typing in Expected's reference search updates the address without adding history entries. Opening a record or changing a filter keeps the scroll position, and moving to another page scrolls to the top.Rows in Sent, Received, Expected and Recipients used to open only on a mouse click. Each one now opens from a real link (
RecordLink) that has the record's address as its href and a visible focus outline. That makes copy link, new tab and keyboard use work. The rows themselves no longer have click handlers. Moving to another page puts the keyboard focus on that page's heading.What this PR adds on top of the first commit
Verifying the first commit (
Give every fax, document, expected fax and recipient its own address) turned up the defects below. Each fix is its own commit:Focus on the page heading failed on five pages. The first commit tried once to focus the heading, right after the page mounted:
h1at all.The shell now waits a bounded time for the heading and focuses it when it appears. The wait stops early if the person moves focus into the page themselves or leaves the page. Those four pages now render their existing title as the
h1, with the same look. The Terminal page focuses its heading first and then hands focus to its shell once that opens, so typing goes there. This is deliberate and the test allows it.Received did not handle some copied links. Someone without the owners list who opened a copied
?item=link saw nothing at all; they now get the same short not-found line as for any document they may not see. A document beyond the loaded list is read on its own. That answer was dropped whenever the page re-rendered before it arrived (the shell hands the page a fresh callback on each render), and nothing opened. The answer is now kept while the address still names that document."Open it" inside Sent's details bypassed the address. These buttons open the continuing fax, the fax being continued, and an uncertain fax's linked fax. They opened the other fax in place, so the address still named the first fax. They now go through the address like a row link.
README named commands that do not exist. It listed
faxbot faxes sent getandfaxbot faxes received get, which belong to the removedjobs/inboundgroups. It now namesfaxes sent showandfaxes received show, plus the list filters that match the address:faxes sent list --status/--hours/--heldandfaxes expected list --show/--search. The README also says what a record you may not see shows: Received says it could not be found, and Sent, Expected and Recipients show only why the details could not be loaded. The received-history roadmap entry had the same wrongreceived getname and is fixed too.Unused state removed. Opening a fax now goes through the address, so the shell's
jobToOpenstate and the Sent page'sopenJobId/onOpenedwiring did nothing. They are removed.JobsListkeeps theopenJobIdprop for callers outside the shell.The command line already opened and filtered the same records. No CLI command or help text changed, so
docs/reference/cli.mdis unchanged.Rebased onto main after #122
#122 merged into main while this was being verified, so this branch is rebased onto main. The only conflict was the first cell of a Sent row in
api/admin_ui/src/components/JobsList.tsx: #122 added the recipient's name above the number. I resolved it by putting the record link around both the name and the number:What remains
Checks on this head
All checks below ran on the rebased head. The console tests ran against the final code, with no source changes afterwards.
npx vitest run --maxWorkers=2 --minWorkers=1 <42 files>covers every test that importsApp,navigation,JobsList,Received,DeliveryRoutes,Destinations,ExpectedFaxes,RecordLink,focusHeading,BlockedSenders,Logs,NpiRecordorNumberMoves, plussendFax,sentRouteandattentionLinks, which fix: readiness item 2, the remaining console defects D23–D27 (combines #118, #120, #121) #122 touched. Result: 42 files, 702 tests passed.npx tsc --noEmit(api/admin_ui): exit 0.make test-local PYTEST_ARGS='tests/test_console_cli_parity.py tests/test_settings_coverage.py': 27 passed, 4 skipped.secret-scan.sh origin/main: no suspicious added lines..github/workflows/ci.ymlon main have none.Proof that the new tests fail on the old code. Each time I restored the earlier files with
git checkout <commit> -- <files>(orgit stashfor the last one), ran only the named tests, and then put the fixed files back:App.tsx,focusHeading.tsand the four page components restored to the first commit, the every-page navigation test reports#/delivery/moves,#/delivery/blocked,#/admin/npiand#/admin/logsas unfocused. The new Overview test fails because focus stays on<body>.Received.tsxrestored, both new Received tests fail: the missing owners list case and the re-render during loading.JobsList.tsxrestored, the related-fax test fails, because the address is never told.The first run of the covering set, before my fixes and under heavy machine load, had five tests time out in
inboxDelivery.test.tsxandnavigation.test.tsx. I reran those two files alone on the same code and all 67 tests passed. Load was the cause, not the code. Because the every-page test now waits for focus on each page, its timeout went from 60 s to 120 s.Not checked
Part of #54
🤖 Generated with Claude Code