Skip to content

Simplify session rendering and serialize preference saves - #633

Open
parsakhaz wants to merge 1 commit into
mainfrom
codex/audit-session
Open

parsakhaz wants to merge 1 commit into
mainfrom
codex/audit-session

Conversation

@parsakhaz

Copy link
Copy Markdown
Member

Session navigation still ran the retired conversation/output view subsystem: unused loading/retry state, a never-created script terminal, and DOM event relays. It also subscribed to every panel-store update and recorded navigation history that nothing read. Overlapping preference saves could restore an old snapshot over a newer edit.

This PR removes that obsolete renderer machinery and its unused hydration/history tests, keeps the consumed git/archive actions, and selects panel/layout state for the displayed session. Backend histories, prompt-based commit messages, terminal output persistence, and exports keep their existing paths.

Preference writes now save full snapshots in edit order. Older failures leave newer edits visible, latest failures restore the last confirmed snapshot, and load ownership prevents late reads from replacing edits or clearing another read's loading state. No dependencies are added or updated.

Closes #616
Closes #617
Closes #619

Validation:

  • All 337 frontend unit tests passed, including six preference ordering/loading regressions.
  • Root typecheck passed.
  • Oxlint, all package ESLint checks, advisory checks, boundary conformance, and Knip passed.
  • New maintained navigation browser regression passed: pane switching restores the selected panel and makes no obsolete output/conversation-count requests. Local verification uses Vite directly; cold compilation on the shared host needed a longer timeout in a scratch config, while committed CI limits are unchanged.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T07:29:52.228141Z 1f8a9d3 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

React Doctor found 1 new issue in 1 file · 1 warning · score 86 / 100 (Great) · 8 fixed · vs main

1 warning

src/hooks/useSessionView.ts

  • ⚠️ L367 .map().filter(Boolean) loops twice js-flatmap-filter

Reviewed by React Doctor for commit 1f8a9d3. See inline comments for fixes.

const promptsResponse = await API.sessions.getPrompts(activeSession.id);
if (promptsResponse.success && promptsResponse.data?.length > 0) {
return promptsResponse.data.map((p: PromptMarker) => p.prompt_text).filter(Boolean).join('\n\n');
return promptsResponse.data.map((p: { prompt_text: string }) => p.prompt_text).filter(Boolean).join('\n\n');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/js-flatmap-filter (warning)

This loops over your list twice because .map().filter(Boolean) makes two passes, so use .flatMap() to change & drop items in one pass

Fix → Use .flatMap(item => condition ? [value] : []) to change and drop items in one pass, instead of building a throwaway array in between

Docs

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

Labels

None yet

Projects

None yet

1 participant