Repository navigation
Improve onboarding and shell accessibility - #1097
Conversation
📝 WalkthroughWalkthroughThe client adds shared focus styles, skip-link and navigation focus handling, semantic heading and tab updates, active-state accessibility attributes, Oxlint rules, and Axe-based Playwright tests for public and authenticated routes. ChangesAccessibility improvements
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant Router
participant Main
User->>App: Activate Skip to content
App->>Main: Focus `#main`
App->>Main: Scroll into view
Router->>App: Emit navigationend
App->>Main: Focus after pathname change
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
3ea578e to
9df7262
Compare
|
🔎 Preview deployed: https://kody-pr-1097.kody-a99.workers.dev Worker: Mocks:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/worker/client/app.tsx`:
- Line 53: Update the focus-reset tracking around lastFocusManagedPathname to
include the URL search string, using a pathname-plus-search identifier such as
lastFocusManagedDocumentPath. Compare this full document location when deciding
whether to reset focus, so redirects and query-filtered same-path navigations
are handled while preserving focus when the visible main content is unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 16bdaa0c-5b41-4638-82ae-f1b60d07594f
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (15)
.oxlintrc.jsone2e/a11y.spec.tspackage.jsonpackages/worker/client/app.tsxpackages/worker/client/client-router.tsxpackages/worker/client/editable-text.tsxpackages/worker/client/routes/account-management-components.tsxpackages/worker/client/routes/account-remote-connectors.tsxpackages/worker/client/routes/oauth-authorize.tsxpackages/worker/client/routes/oauth-callback.tsxpackages/worker/client/routes/onboarding-mcp-client-tabs.tsxpackages/worker/client/routes/reset-password.tsxpackages/worker/client/routes/verify.tsxpackages/worker/client/styles/style-primitives.tstools/oxlint/oxlint-rules.json
| let lastSessionRefreshAt = 0 | ||
| let sessionMaybeStale = false | ||
| let currentPathname = readRouterPathname(handle) | ||
| let lastFocusManagedPathname = currentPathname |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 5 \
-e 'navigate\(' \
-e 'readRouterSearch' \
-e 'URLSearchParams' \
-e 'searchParams' \
packages/worker/client --glob '*.ts' --glob '*.tsx'Repository: kentcdodds/kody
Length of output: 50372
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Files needed =="
fd -a '^(app|router-scroll-state|client-router|routes/(account-memories|account-jobs|admin-users|account-remote-connectors|account-package-invocation-tokens)).*\.(tsx?|ts)$' packages/worker/client | sed 's#^\./##' | sort
echo
echo "== app.tsx focus handling =="
sed -n '1,150p' packages/worker/client/app.tsx
echo
echo "== router-scroll-state.contract =="
sed -n '1,80p' packages/worker/client/router-scroll-state.ts
echo
echo "== navigator event details =="
rg -n -C 8 'function buildRouterNavigationEvent|interface RouterNavigationEventDetail|targetUrl|location.search|nextPathname' packages/worker/client/client-router.tsx packages/worker/client/app.tsx packages/worker/client/router-scroll-state.ts
echo
echo "== query-only navigation helper =="
sed -n '150,210p' packages/worker/client/routes/account-memories.tsx
sed -n '370,430p' packages/worker/client/routes/account-package-invocation-filters.tsx 2>/dev/null || sed -n '390,445p' packages/worker/client/routes/account-package-invocation-tokens.tsx
sed -n '255,285p' packages/worker/client/routes/admin-users.tsx
sed -n '410,430p' packages/worker/client/client-router.tsx
echo
echo "== structural search for navigate(to) in routes =="
rg -n -C 4 'navigate\(\s*\`?\$\{[^`]+\$\{[^`]+search|navigate\(nextPath|navigate\(\s*build' packages/worker/client/routes --glob '*.ts' --glob '*.tsx' | head -n 240Repository: kentcdodds/kody
Length of output: 22955
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== client-router navigation creation/fire/call implementation =="
sed -n '60,105p' packages/worker/client/client-router.tsx
sed -n '175,205p' packages/worker/client/client-router.tsx
sed -n '350,370p' packages/worker/client/client-router.tsx
sed -n '560,615p' packages/worker/client/client-router.tsx
sed -n '820,870p' packages/worker/client/client-router.tsx
echo
echo "== search/filter helpers and route render fragments =="
sed -n '1,120p' packages/worker/client/routes/account-memories.tsx
sed -n '515,555p' packages/worker/client/routes/account-memories.tsx
sed -n '1,115p' packages/worker/client/routes/account-package-invocation-tokens.tsx
sed -n '465,505p' packages/worker/client/routes/account-package-invocation-tokens.tsx
sed -n '1,110p' packages/worker/client/routes/admin-users.tsx
sed -n '710,750p' packages/worker/client/routes/admin-users.tsx
echo
echo "== focus/main anchor references =="
rg -n '"`#main`"|id=["'\'']main|getElementById\(["'\'']main|navigate\(["'\'']`#main`' packages/worker/client --glob '*.tsx' --glob '*.ts'Repository: kentcdodds/kody
Length of output: 20822
Track navigation content, not just pathnames, for focus resets.
nextPathname does not cover redirects, query-filtered same-path navigations, or path changes that keep the same main content. Use an equivalent of lastFocusManagedDocumentPath (pathname + search) or skip focus reset only when the route’s visible <main> content did not change.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/worker/client/app.tsx` at line 53, Update the focus-reset tracking
around lastFocusManagedPathname to include the URL search string, using a
pathname-plus-search identifier such as lastFocusManagedDocumentPath. Compare
this full document location when deciding whether to reset focus, so redirects
and query-filtered same-path navigations are handled while preserving focus when
the visible main content is unchanged.
Part of #1069
Summary
remix/ui/tabs, full arrow/Home/End keyboard behavior, and theme-token stylingVerification
npm run validate— passed on the rebased branch (format, lint, typecheck, 1,705 unit tests, 22 Playwright tests, MCP E2E, backup build, primitives, migrations, docs)npm run test:e2e:a11y— 3 tests passed; 12 route/theme scans reject critical and serious violations<main id="main">https://heykody.dev/healthreports merge SHAc4b0261a47d5460140d7aa10ab4d1e2b9eaee3b5Known sibling-owned exclusion
The
/loginscan excludes onlya[aria-pressed]: the signup-gateway-owned login toggle still has invalidaria-pressedon an anchor on currentmain. The rest of/loginremains scanned. This track did not editlogin.tsxorwaitlist-banner.tsxas directed.System recap — extends an existing primitive (medium risk)
Mode: recap · Base:
main@775c58e· Head:9df7262Classification: extends — this PR changes browser-app keyboard, focus, and accessibility behavior; no new system primitive is introduced.
Primitives touched
app-uiSystem map
Browser-app routes and the persistent shell now share accessible navigation behavior and are guarded by lint and browser checks.
Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).
Conductor report
c4b0261a; post-merge validation and production deployment are greenlogin.tsxandwaitlist-banner.tsxremain untouched. Their signup-gateway-owned<h2>, invalid login-linkaria-pressed, and waitlist input outline suppression are explicitly deferredremix/ui/tabsinstead of hand-rolled ARIA; retain exact sibling ownership; enforce semantic jsx-a11y rules while disabling three Remix-mix false positives (autocomplete-valid,label-has-associated-control,role-supports-aria-props); keep route focus keyed to pathname so query-only filters do not steal focus (CodeRabbit's pathname+search suggestion was intentionally not applied)Summary by CodeRabbit
New Features
Tests