Repository navigation
fix(platform): recover failed knowledge, history and folder reads - #3814
Conversation
d123d6f to
78709a1
Compare
yannickmonney
left a comment
There was a problem hiding this comment.
One actionable keyboard recovery issue found; inline reproduction attached. The scoped read/recovery checks passed. Existing draft-loss issue #3901 remains separate and is not introduced by this diff. No merge approval.
78709a1 to
9775630
Compare
A paginated source whose next page failed kept being drained: the search drain in useListPage re-issued the failed page on every render while the table showed a skeleton no request was filling, over a footer promising "scroll for more". - useListPage marks a paginated source that failed with rows on screen (`infiniteScroll.loadFailed`), stops draining and scrolling it, and opens its window to every loaded row, kept open on recovery. - DataTable shows no skeleton for such a list: a search that matched none of the loaded rows says it searched only those, and the count footer says the rest could not be loaded (EN/DE/FR). - CatalogLoadError takes `isRetrying`: the retry reads busy and inert but stays focusable, since a native disable drops a focused control's focus. - EntityViewSection takes `focusRef`, making the section a named focus target for a host whose retry replaces the control that held focus.
A knowledge list whose read failed said "No knowledge entries yet", and an entry whose version history failed to load showed no history at all, the same as an entry never edited (#3777). - The knowledge list hands useListPage the paginated read's error and retry: a failed first page is the table's error state with Try again. Rows a failed refresh or page left on screen stay, under a notice with the same retry; the retry moves focus onto the list region first, and the search and selected rows survive it. - The paginated hook no longer re-requests a failed next page from every render of a search drain or scroll (it looped, four requests per run); its retry resumes from that page, and it reports a retry in flight and how many failures settled, so each new failure is announced again. - Version history is always shown: loading, "No earlier versions yet", a failed read with Try again (the current content stays), and a failed refresh over the versions already loaded. Focus moves to the section. - The Documents list, the other paginated list that passes its error, gets the same notice, so a page that fails there is not a dead end. - EN/DE/FR copy, docs and manual boxes KNOW-B17, KNOW-B18 and KNOW-A7.
A project whose folder read failed hid every file inside a folder, though the file read had succeeded; with only nested files the tree was an empty bordered list, with no error and no retry (#3736). A failed file read left the folders alone, also without a word. - The project's document and folder hooks report how their read stands (never answered, stale, retrying, failures so far) beside their rows. - The Files tab names a failed read above the tree with one Try again that repeats only the read that failed, and moves focus onto the tree area first. Files whose folder did not load stay listed under "Files inside folders"; a failed refresh keeps the tree it showed. - The tree waits for both reads before its first paint, so nested files no longer appear only once their folders catch up, and the empty state shows only when both reads answered with nothing. - EN/DE/FR copy, docs, manual boxes PROJ-B10 and PROJ-A8, and the automation map row for the new component suites.
|
Rechecked revision Three focused Chromium cases passed as defect reproduction and controls: background-refailure focus loss; deliberate manual Retry returning focus to the stable history section; and an intentional move to Edit during the pending background request, which stays focused. Preserve that last behavior when repairing the stale focused button; do not unconditionally steal focus on every failure. Remove the remount or restore focus only when the removed control owned it. The broad prior test count remains attributed to the earlier head; this revision check does not claim a full repository or native PostgreSQL rerun. Replay/source receipts: |
Review of #3814: a host re-keyed the whole CatalogLoadError for each new failure, so the alert was announced again, but its Try again was re-created too. A reader who had focused it (without pressing it) lost the focus when a background refresh failed again; Chromium moved it to the dialog frame. - `failureKey` re-creates only the message inside the same live region: the failure is announced again, and Try again keeps its node and focus. - `onFocusLost` takes the focus the alert held when a refresh that worked takes it away, a frame after it leaves. Focus the reader moved elsewhere stays where it is, and a host re-rendering with a new callback is not mistaken for the alert leaving.
Review of #3814: the version history, the knowledge and documents lists and a project's Files tab keyed their failure notice per failure, re-creating a focused Try again when a background refresh failed again. - Each notice passes `failureKey` instead of a key, so the failure is still announced again while Try again keeps its node and focus. - Each passes `onFocusLost`: a refresh that heals the read while Try again holds focus hands it to the history section, the list region or the Files group. A manual retry still moves focus there first. - Regression tests reproduce the review's case for each notice (a focused, unpressed Try again through a failed background refresh), the healing handoff, and focus the reader moved elsewhere during the read. Manual boxes KNOW-A7 and PROJ-A8 cover the same keyboard path.
9775630 to
4afccb1
Compare
Review of #3814, swept past the keyed alerts: with nothing loaded, a list's failure is DataTable's error state, and a refresh the reader did not start (the tab regaining focus, another session's change) swaps it for the loading state. A Try again the reader had focused went with it, and the focus dropped to the page (Chromium, the knowledge list at 4afccb1). - `useFocusHandoff` is CatalogLoadError's handoff, now shared: a callback ref whose element, leaving with the focus inside, hands the focus to `onFocusLost` a frame later. Focus the reader moved elsewhere stays. - ErrorDisplayCompact takes `onFocusLost`; DataTable passes its new `onErrorFocusLost` to its error state.
Review of #3814, swept past the keyed alerts: a knowledge list that never loaded shows the table's error state, and a refresh the reader did not start swapped it for the loading state, taking a focused Try again and dropping the focus to the page — while the refresh ran, after it failed again, and after it healed (Chromium at 4afccb1: another session's hub upload, and the window regaining focus). The documents list shares the state. - Both lists pass their region as the table's `onErrorFocusLost`, the target a manual retry already moves focus to. Focus the reader moved elsewhere stays. - Regression tests: a focused, unpressed Try again in the error state through a background refresh that fails again and then heals, and focus moved elsewhere. Manual box KNOW-A7 adds the window-refocus path.
Failed reads in Knowledge and in a project's Files tab looked like missing data. A failed knowledge list said No knowledge entries yet. A failed version history disappeared, which looked the same as an entry that was never edited. A failed folder read hid every file inside a folder, even though the file read had succeeded. Each read now separates loading, a real empty answer, unavailable and recovery. Data already loaded stays on screen, and every failed read offers a keyboard-reachable Try again in EN/DE/FR.
Closes #3777
Closes #3736
What changed
Knowledge entries list (#3777)
errorandretrytouseListPage, which it previously dropped. A failed first page shows the shared DataTable error state with Try again, never the empty state.CatalogLoadError) says the list may be incomplete or out of date and offers the same retry. The search and any selected rows survive the retry.useListPagere-requested it on every render in an endless loop: 14 → 30 requests within 2 s in the jsdom probe with no backoff, and four requests roughly every 7 s in the app. Meanwhile the table showed a skeleton that no request was filling.useListPageandDataTablestop such a list where it stands: no skeleton, and the no-results and footer copy say that only the loaded rows were searched and that the rest could not be loaded.Version history (#3777)
Project files (#3736)
Documents list: it is the only other paginated list that passes its error to
useListPage, so the new stop would otherwise have left it without a retry. It gets the same notice.Accessibility: each retry first moves focus onto a stable, named target: the Knowledge entries or Documents region, the Version history section, or the Files group. Focus never falls to the page body when the control that held it is replaced. A repeated failure re-creates only the message inside the same live region (
failureKey), so it is announced again while Try again keeps its node and any focus on it. When a refresh that heals the read takes the alert away while it holds focus, the focus goes to that same target (onFocusLost). Focus the reader moved elsewhere stays where it is. A busy retry stays focusable and inert (aria-busy,aria-disabled); a nativedisabledwould drop its focus.Shared pieces reused and extended: DataTable's error state,
CatalogLoadError(new optionalisRetrying,failureKeyandonFocusLost),EmptyState,EntityViewSection(new optionalfocusRef), the sharedcommon.actions.tryAgainandcommon.errors.tryAgainkeys, anduseListPage. No toast is raised for any read failure.Docs and manual tests
knowledge/knowledge-entries.mdandprojects/manage-files.md.KNOW-B17,KNOW-B18,KNOW-A7,PROJ-B10andPROJ-A8, plus an automation-map row.How I verified it
fac88dfc2) first, at component level. Real hooks, adapter rows,backendFetchand the four-attempt retry policy ran against a closed synthetic transport that failed only the read under test. Details are in the task deliverables.knowledge-entries-table.read-failure.test.tsx: 34 entries, a true empty state, cold and background failures, a failed page 2 during a search (one run of four requests, then exactly one more on retry), search and selection kept, EN/DE/FR.knowledge-entry-view-dialog.read-failure.test.tsx: a two-version chain, never edited, loading, cold and background failures, focus on recovery, a retry answer kept to its own entry, EN/DE/FR.project-files-tab.read-failure.test.tsx: a mixed tree with a deep link, a folder failure, all files nested, a true empty project, a file failure, a failed refresh, switching project while a retry is in flight, and recovery without re-reading documents, EN/DE/FR.readStateOf, the paginated hook (no re-request until the retry),useListPage,DataTable,CatalogLoadError,EntityViewSectionand the Documents notice.4afccb13b:@tale/uiunit suites: 120/120.@tale/uii18n suites pass.lint:manualandcheck-guidepass on the two touched suites.oxlint --type-aware --type-checkis clean on every changed file.Real-browser checks
Headless Chromium drove the CI-built bundle, served locally, against a local backend with synthetic data only. Faults were injected per request as 503s on exactly the read under test. Background refreshes came from a second session's writes through the app's own endpoints. No screen reader was run; semantics were read from the accessibility tree.
4afccb13b:Review round (r4134167039)
03f3a7b16and4afccb13baddress the review. A background refresh that failed again re-created a focused Try again through the per-failurekey. The four keyed notices now passfailureKeyandonFocusLostinstead.Exact-head Chromium check on
4afccb13b, with Try again focused by Tab and not pressed:Seven mutation checks each turned exactly one test red.
The sweep found one more path: when nothing had loaded, DataTable's error state lost a focused Try again when a background refresh ran. That fix is in #3937.
Not in this PR
4afccb13b: in the two-session check D1 the dialog closed, and in the D3 control the draft was kept. It is filed separately.readStateOfoverlaps fix(platform): search with the board filters and recover failed reads #3906's board read state; the two should be unified.TaskReadAlertkeeps its own copy of the focus handoff.Description updated after the merge. The first version said that each failure mounted a fresh alert and that the platform readme totals were recounted; neither is what merged. The review round and the browser results were added.