Skip to content

feat(sessions): Navigate previous messages with plain arrow keys#3443

Merged
charlesvien merged 13 commits into
mainfrom
feat/composer-arrow-message-nav
Jul 15, 2026
Merged

feat(sessions): Navigate previous messages with plain arrow keys#3443
charlesvien merged 13 commits into
mainfrom
feat/composer-arrow-message-nav

Conversation

@charlesvien

@charlesvien charlesvien commented Jul 14, 2026

Copy link
Copy Markdown
Member

Problem

Finding and reusing your own previous prompts in a long agent conversation is tedious and forces a hand off the keyboard. #3407 added option+up/down and cmd+J for jumping through messages, but plain arrow up is the established pattern from terminals, Claude, Codex and other chat inputs for recalling what you sent.

Requested in team-desktop.

Changes

Plain up/down in the session composer now cycles through the prompts you actually sent in that conversation, terminal style: each press loads a sent prompt into the input. The conversation view does not move; option+up/down and cmd+J remain the way to jump the thread. Arrows keep moving the caret as usual; only a press with the caret already at the start or end of the input triggers recall (same behavior as pi). Down walks back toward newer prompts, and one more down past the newest restores whatever you were typing (mention chips included). Sending a prompt resets the cycle. Works with both the current conversation view and the experimental chat thread.

How did you test this?

  • Unit tests for the recall stepping logic (composerPromptRecall.test.ts)
  • pnpm --filter @posthog/ui test (1576 tests), pnpm typecheck and the react-doctor CI gate replicated locally, all pass
  • Not yet dogfooded in the running app, hence the draft

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@trunk-io

trunk-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 80330d2.

@charlesvien charlesvien marked this pull request as ready for review July 14, 2026 19:07
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "navigate previous messages with arrow ke..." | Re-trigger Greptile

Comment thread packages/ui/src/features/message-editor/tiptap/useTiptapEditor.ts Outdated
Comment thread packages/ui/src/features/sessions/components/ConversationView.tsx Outdated
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 14, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 14, 2026
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 14, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 14, 2026
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 14, 2026
github-actions[bot]
github-actions Bot previously approved these changes Jul 14, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both resolved bot comments were substantively addressed in this diff: the Tippy popup scoping bug is fixed via session-tagged data attributes, and the stale-closure timing issue is avoided by reading from synchronously-updated refs at keypress time. No showstoppers found.

@github-actions github-actions Bot dismissed their stale review July 14, 2026 23:30

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

github-actions[bot]
github-actions Bot previously approved these changes Jul 14, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-structured UI feature with clean separation (pure logic module + tests), proper timing fixes via synchronously-updated refs, and session-scoped popup detection addressing the cross-editor popup bug. The two bot P2 findings are genuinely resolved in the current code. No backend, data model, API contract, or security changes.

@github-actions github-actions Bot dismissed their stale review July 14, 2026 23:40

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

@charlesvien charlesvien enabled auto-merge (squash) July 14, 2026 23:40
@charlesvien charlesvien disabled auto-merge July 14, 2026 23:41
github-actions[bot]
github-actions Bot previously approved these changes Jul 14, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean UI-only feature with proper timing fixes via synchronously-updated refs, session-scoped Tippy popup detection resolving the cross-editor bug, a pure logic module with tests, and no backend, data model, API contract, or security changes. Both resolved bot findings are genuinely addressed in the current diff.

@github-actions github-actions Bot dismissed their stale review July 15, 2026 00:22

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

github-actions[bot]
github-actions Bot previously approved these changes Jul 15, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean UI-only feature with pure logic module, comprehensive tests, proper stale-closure fix via synchronously-updated refs, and session-scoped Tippy popup detection addressing the cross-editor bug. Both resolved bot findings are genuinely addressed in the current diff. No backend, data model, API contract, or security changes.

@charlesvien charlesvien enabled auto-merge (squash) July 15, 2026 00:28
@charlesvien charlesvien force-pushed the feat/composer-arrow-message-nav branch from a73b8e2 to 03d50ea Compare July 15, 2026 00:46
@github-actions github-actions Bot dismissed their stale review July 15, 2026 00:47

New commits pushed (delta classified non_linear_history) — stamphog approval dismissed; re-review running automatically.

github-actions[bot]
github-actions Bot previously approved these changes Jul 15, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean UI-only feature with proper timing fixes via synchronously-updated refs, session-scoped popup detection resolving the cross-editor bug, a pure logic module with good test coverage, and no backend, data model, API contract, or security changes. Both resolved bot P2 findings are genuinely addressed in the current diff.

@github-actions github-actions Bot dismissed their stale review July 15, 2026 00:55

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean UI-only feature: boundary-aware prompt recall via refs avoids the stale-closure timing issue flagged by bots, the session-scoped Tippy popup query resolves the cross-editor popup bug, the pure logic module has comprehensive tests, and no backend, data model, API contract, or security surface is touched.

@charlesvien charlesvien merged commit 55e2362 into main Jul 15, 2026
27 checks passed
@charlesvien charlesvien deleted the feat/composer-arrow-message-nav branch July 15, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant