fix(web): limit prompt recall to one history page per keypress #48260
main fromrefs/pull/48260/head·opened View on GitHubProblem#
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:changedpassed on InstaBox.
| Main | Fixed |
|---|---|
![]() | ![]() |
GPT-6.2 Sol through Codex in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
tanstack-source added labelsbug
Approvability#
Verdict: Approved at
3b4b804Macroscope'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).No actionable comments were generated in the recent review.
Walkthrough
-
Prompt-history pagination now uses a
loadEarliercallback. 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.tsThe 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.mdTests 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 to3b4b8-
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:
4-
Check name Status Explanation Title check 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 co… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Description check 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 … 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-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: a75e74e
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2b22b071-b493-4c82-8121-9a5237e99c8d
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.tsxapps/web/src/components/chat/composerCommandKey.test.tsapps/web/src/components/chat/composerCommandKey.tsapps/web/src/components/chat/composerPromptHistory.tsdocs/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.


macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes