Skip to content

🤖 feat: add prompt history sidebar#3429

Open
LeonidasZhak wants to merge 1 commit into
coder:mainfrom
LeonidasZhak:codex/prompt-history-sidebar-v2
Open

🤖 feat: add prompt history sidebar#3429
LeonidasZhak wants to merge 1 commit into
coder:mainfrom
LeonidasZhak:codex/prompt-history-sidebar-v2

Conversation

@LeonidasZhak
Copy link
Copy Markdown

Summary

Adds a right-sidebar History tab for the current transcript. The tab lists real user prompts from oldest to newest and provides quick actions to jump back to the original transcript row, copy the prompt, or insert it into the composer.

Background

Part of #3416. Supersedes closed PR #3421, which GitHub would not reopen after its head branch was force-pushed/recreated. This replacement uses the restored single-feature commit and includes the Codex attachment-preservation fix from #3421.

Implementation

  • Adds a pure prompt-history selector that filters synthetic continuation/budget wrap-up messages while keeping attachment-only user prompts and their file parts.
  • Registers a new history right-sidebar tab and label.
  • Uses a typed custom event so the sidebar can ask ChatPane to reveal a transcript message without reaching across layout boundaries with DOM queries.
  • Reuses the existing UPDATE_CHAT_INPUT event to insert selected history text and attachments into the composer.

Validation

  • /Users/zhak/.npm/_npx/bb6645c1041000be/node_modules/.bin/bun test src/browser/features/RightSidebar/PromptHistoryTab.test.ts
  • /Users/zhak/.npm/_npx/bb6645c1041000be/node_modules/.bin/bun -e 'import { getPromptHistoryEntries } from "./src/browser/features/RightSidebar/promptHistoryEntries.ts"; const fileParts=[{url:"data:text/plain;base64,SGVsbG8=",mediaType:"text/plain",filename:"note.txt"}]; const entries=getPromptHistoryEntries([{type:"user",id:"file-only",historyId:"file-only",content:"",historySequence:1,fileParts}]); if (entries[0]?.fileParts?.[0]?.filename !== "note.txt") throw new Error("fileParts not preserved"); console.log("fileParts preserved");'
  • ./scripts/generate-version.sh && /Users/zhak/.npm/_npx/bb6645c1041000be/node_modules/.bin/bun run node_modules/@typescript/native-preview/bin/tsgo.js --noEmit -p tsconfig.main.json
  • git diff --check

Risks

The UI is intentionally small and additive: users need to add/open the History tab from the right sidebar. The remaining #3416 ideas around persistent snippets and custom keybindings are not implemented here.


Generated with mux • Model: GPT-5 • Thinking: unknown • Cost: $unknown

@LeonidasZhak
Copy link
Copy Markdown
Author

@codex review

Please review this replacement prompt history sidebar PR for #3416. It supersedes closed #3421 and includes the attachment-preservation fix from the prior Codex feedback.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3eaf690a9d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/features/RightSidebar/PromptHistoryTab.tsx Outdated
@LeonidasZhak LeonidasZhak force-pushed the codex/prompt-history-sidebar-v2 branch from 3eaf690 to 2dbe55d Compare May 30, 2026 02:51
@LeonidasZhak
Copy link
Copy Markdown
Author

@codex review

Addressed the stale draft attachment/review feedback: prompt history insertion now sends explicit empty file/review arrays for text-only entries, and the replace handler treats file/review payload presence as a full draft replacement even when those arrays are empty. Added a focused payload test and re-ran tsgo --noEmit.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2dbe55d34e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/features/RightSidebar/PromptHistoryTab.tsx
Adds a right sidebar History tab that lists transcript user prompts oldest-to-newest, lets users jump back to the original message, copy the prompt, or insert it into the composer.

Links coder#3416.

---

_Generated with `mux` • Model: `GPT-5` • Thinking: `unknown` • Cost: ``_

<!-- mux-attribution: model=GPT-5 thinking=unknown costs=unknown -->
@LeonidasZhak LeonidasZhak force-pushed the codex/prompt-history-sidebar-v2 branch from 2dbe55d to 095997c Compare May 30, 2026 02:58
@LeonidasZhak
Copy link
Copy Markdown
Author

@codex review

Addressed the empty review override follow-up: text-only history inserts still clear existing attached reviews, but the empty draft-review override now releases when new reviews are attached later so the Code Review workflow remains visible and sendable. Re-ran the prompt-history tests and tsgo --noEmit.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant