Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): limit prompt recall to one history page per keypress #48260

OpenUtkarshUsername(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48260/headopened View on GitHub

UtkarshUsername(GitHub profile, opens in a new tab)commented

Problem

Pressing Arrow Up in an empty composer can load every earlier page when a long agent-driven thread has no human prompts to recall. One press fetched four pages in a 17-turn Replay thread and left the composer empty.

Change

Load at most one earlier page per press. Recall a prompt immediately if that page contains one. The next press continues from the cursor the timeline saved. The existing draft and focus checks still apply after the request completes.

Scope

Small web composer regression fix. Desktop uses the same composer. #47465

Verification

  • In the same isolated Replay thread, main made four history requests after one Arrow Up. The fixed app made one request per press across four distinct cursors.
  • The focused regression test failed on main when Arrow Up started a second page load. It passes with the fix. The existing browser scenario also passed Arrow Up and Arrow Down recall across a page boundary.
  • vp run check:changed passed on InstaBox.
MainFixed
Main after one Arrow UpFixed after one Arrow Up

Short recording

GPT-6.2 Sol through Codex in T3 Code.

    1. tanstack-source added labelsbug

    2. Approvability

      Verdict: Approved at 3b4b804

      Macroscope's review found this PR approvable — Prompt recall now fetches at most one history page per keypress, with documentation explaining when another ArrowUp press is needed. Existing draft and focus safeguards remain, and the change has limited interaction-level impact.

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

      No actionable comments were generated in the recent review.

      Walkthrough

      Prompt-history pagination now uses a loadEarlier callback. Each backward navigation attempt loads at most one earlier page, and a later ArrowUp press can load another page. Tests and user instructions reflect this behavior.

      Changes: Prompt-history navigation

      Layer / File(s)Summary
      Callback contract and navigation
      apps/web/src/components/chat/composerPromptHistory.ts, apps/web/src/components/ChatView.tsx, apps/web/src/components/chat/composerCommandKey.ts
      The prompt-history result now exposes loadEarlier. Backward navigation invokes it once, then checks whether the request and editor state still allow prompt recall.
      Pagination validation and instructions
      apps/web/src/components/chat/composerCommandKey.test.ts, docs/user/composer.md
      Tests cover loading one page per ArrowUp press and recalling an older prompt after a later page loads. The instructions say to press ArrowUp again when the current page has no prompt to recall.

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

      Change: Bug fix

      Suggested reviewers: yash-singh1, iamshadmantaqi

      Merge Risk: Minimal · up to 3b4b8

      Arrow Up in an empty composer now loads at most one earlier history page per press and recalls a prompt as soon as one is found. A further press continues from where the timeline stopped. The change is small, covered by a focused test, and carries no identified merge risk.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the main change: prompt recall in the composer now loads at most one history page per keypress. It follows the conventional commit form and matches the objectives and the summarized co…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Description checkPassedThe description states the problem (Arrow Up in an empty composer loads every earlier page in a long agent-driven thread with no human prompts), the change (at most one earlier page per press, recall …
      Full details: Title check

      Explanation

      The title names the main change: prompt recall in the composer now loads at most one history page per keypress. It follows the conventional commit form and matches the objectives and the summarized code changes.

      Full details: Description check

      Explanation

      The description states the problem (Arrow Up in an empty composer loads every earlier page in a long agent-driven thread with no human prompts), the change (at most one earlier page per press, recall immediately if found, next press continues from saved cursor), the scope (small web composer regression fix, linked related PR #47465, desktop shares the composer), and verification (before/after request counts, focused regression test failing on main and passing with fix, existing browser scenario, check:changed passed, before/after screenshots and a recording). It follows the template sections. Minor gaps: the Scope section does not link a bug issue. Its own link points to a related PR rather than an issue showing the bug. It also does not state what was not checked, and the title line is not shown in the description body. The author did name the model used, as the template asks.

      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between a75e74eb48d6bb7b758401bc85a8d24d9c690bfa and 3b4b8041a8349304b7d10625aff49c76f127b0d2.

      Files selected for processing: 5

      • apps/web/src/components/ChatView.tsx
      • apps/web/src/components/chat/composerCommandKey.test.ts
      • apps/web/src/components/chat/composerCommandKey.ts
      • apps/web/src/components/chat/composerPromptHistory.ts
      • docs/user/composer.md

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

Sign in to join this conversation.