Repository navigation
fix(web): keep settled pagination focused while loading - #35522
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The settled-thread pagination button retains keyboard focus during loading while explicitly blocking repeated activation. This is a narrowly scoped interaction fix with no changes to pagination defaults or data handling. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
) (cherry picked from commit 8fc1dad)
…6 (Running browser tests in apps/web) Failing check: Running browser tests in apps/web Browser tests in apps/web are passing again. Two test files had failed, each for a different reason, and both came from changes upstream made to the code around fork code. **`src/routes/-chat.index.browser.test.tsx`** (fork-owned, 3 failing tests): upstream pingdotgg#35442 added a `useSettings` import to `components/ui/sidebar.tsx`. Through that import, the route under test now loads `themePalette` → `~/state/server` and `~/state/environments`. The fork test replaces both modules with mocks that only export what the route itself used, so loading the page failed with "does not provide an export named …" (`themeServerEnvironmentThemesAtom`, and after that `usePrimaryEnvironment`). Adding the real exports back to those mocks would only have exposed the next missing one, so I changed the test to replace `../components/ui/sidebar` with a plain `<main>` instead. `SidebarInset` is the only thing the route uses from that module, and this puts the test back to the dependencies it had before the merge. **`src/components/Sidebar.browser.test.tsx`** (upstream test, 1 failing): upstream's new settled-pagination test (pingdotgg#35522) gives the sidebar a stand-in server config that has no `environment` field. The fork's `CheckoutStatus` hook in `apps/web/src/fork/project-lifecycle/CheckoutStatus.tsx` read `config.environment.capabilities` and crashed on it. I left upstream's test alone and changed the fork hook to read `environment?.capabilities`, with a one-line comment saying why. Real configs always include `environment`, so the app behaves the same as before. Only fork-owned files changed, and no seams or `docs/fork/seams.tsv` rows were affected. I reran both files with `pnpm exec vp test run --project browser`: 11 of 11 tests pass. Lint and the format check are clean on the two edited files.
Problem
A desktop user reported that clicking "Show 25 more" in the unfiltered Settled sidebar jumps the list back to the open thread. The loading state disables the focused pagination button, dropping focus and allowing focus recovery to choose another sidebar row.
Change
Keep the loading button focusable with
aria-disabledand ignore activation while a page is loading. This preserves focus without allowing repeated pagination requests. Web and desktop share this sidebar; native mobile is unchanged.Scope
This is a small fix for a reported pagination bug and needs no separate issue. Searches found no matching open PR. Related #34475 changes pagination length after project filter changes, rather than loading focus.
Verification
vp run check:changedpasses formatting, lint, both Knip checks, affected typechecks, 7 test files, and the React compiler check.GPT 6.1 Sol through the Codex harness.