Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): navigate back and forward with mod+[ and mod+] #13212

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/13212/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

There was no keyboard way to go back to the page you just left, such as returning to the previous thread after following a link or leaving Settings.

This adds two rebindable commands, navigation.back and navigation.forward, bound to mod+[ and mod+] by default. They step through the app's route history the same way a browser's back and forward buttons do. The defaults include !terminalFocus, so terminals still receive the keys. The server's startup backfill adds the new defaults for existing users unless the shortcut is already taken. Both commands appear in Settings → Keybindings as "Navigation: Back" and "Navigation: Forward".

Surfaces:

  • Web and desktop: handled once in AppSidebarLayout, so every route gets it.
  • Mobile: not affected. It has its own hardware-keyboard back command.

Tested with a new resolver test covering both keys and the terminal-focus exclusion, plus the existing keybinding tests for contracts, server, and settings.

Opus 5.5 via Claude Code in T3 Code

🤖 Generated with Claude Code


Devin Review

Summary by CodeRabbit

  • New Features
    • Added Mod+[ and Mod+] shortcuts to navigate backward and forward through browsing history.
    • The shortcuts are inactive while the terminal is focused and account for the current page and other focus states.
  • Documentation
    • Documented the navigation history shortcuts in the keyboard shortcut guide.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.5 KiB13.5 KiB+1 B (+0.0%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.1 KiB+5 B (+0.1%)7.3 KiB✅
      CodexLive turn WebSocket wire6.4 KiB6.4 KiB−4 B (−0.1%)7.8 KiB✅
      CodexLive turn WebSocket decoded56.2 KiB56.2 KiB0 B (0.0%)66.4 KiB✅
      CodexLive turn messages990 (0.0%)21✅
      ClaudeTotal thread wire13.5 KiB13.5 KiB−4 B (−0.0%)15.1 KiB✅
      ClaudeThread snapshot wire7.1 KiB7.1 KiB+7 B (+0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.4 KiB6.4 KiB−11 B (−0.2%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded57.0 KiB57.0 KiB0 B (0.0%)66.4 KiB✅
      ClaudeLive turn messages990 (0.0%)21✅

      Baseline: 23c7ab9 · PR result: edc68b9 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 114.0 KiB
      • Claude decoded thread snapshot: 114.6 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — The PR adds globally handled history navigation and changes shared default keybindings, including startup backfill for existing configurations. This product-default change and app-wide behavior warrant human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

      Review profile: CHILL

      Plan: Team

      Run ID: 20f67cdc-4d8c-4bc6-87e1-69c92a85ae92

      📥 Commits

      Reviewing files that changed from the base of the PR and between 5c75eb293d5fdf82a8256efa71a3d5dc7c108975 and edc68b9f7e60e468c653104a621b5174db8b6bd2.

      📒 Files selected for processing (1)
      • apps/web/src/components/AppSidebarLayout.tsx

      Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


      📝 Walkthrough

      Walkthrough

      The change adds default keyboard shortcuts for browser back and forward navigation. The sidebar listener supplies terminal, preview, editable-focus, model-picker, and thread-route context to shortcut resolution. It re-registers when the keybindings or route reference changes.

      Changes

      Navigation shortcuts

      Layer / File(s)Summary
      Navigation commands and defaults
      packages/contracts/src/keybindings.ts, packages/shared/src/keybindings.ts, apps/web/src/keybindings.test.ts, docs/user/keybindings.md
      Adds static commands and default shortcuts for back and forward navigation. Tests cover platform mappings and terminal focus. Documentation lists the shortcuts.
      Shortcut resolution context
      apps/web/src/components/AppSidebarLayout.tsx
      Provides route-specific focus and visibility state to shortcut resolution. The keydown listener is re-registered when the keybindings or thread route reference changes.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Feature

      Suggested reviewers: maria-rcks

      Merge Risk: ⚪ Minimal · up to edc68

      The navigation shortcuts are mergeable after normal checks; no actionable issue is established by the available evidence.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely describes the main change: adding back and forward navigation shortcuts using mod+[ and mod+].
      Description check✅ PassedThe description explains what changed, why it changed, affected surfaces, platform scope, defaults, testing, and generated keybinding behavior. It does not use the template headings or include the che…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches 💡 1
      📝 Generate docstrings 💡
      • Commit to this branch
      • Create a new PR
      🧪 Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    5. juliusmarminge merged this829af7b

    6. juliusmarminge closed this

Sign in to join this conversation.