Skip to content

Add conversation preview dialog before deletion - #3

Merged
FinnaXxx merged 3 commits into
mainfrom
claude/gifted-shannon-c1cyl0
Sep 23, 2026
Merged

FinnaXxx merged 3 commits into
mainfrom
claude/gifted-shannon-c1cyl0

Conversation

@FinnaXxx

Copy link
Copy Markdown
Owner

Summary

Adds a read-only preview of conversation messages and generated images before deletion, allowing users to verify they're deleting the correct session. The preview reads from rollout segment files (supporting both plain and zstd-compressed formats), extracts user and assistant messages while filtering out scaffolding and tool calls, and displays embedded images and generated images with size budgets to prevent memory issues.

Key features:

  • Parses conversation rollout segments (response items and UI events) to reconstruct message history
  • Strips Codex scaffolding (environment context, reasoning, tool output) while preserving user intent
  • Displays embedded images from pasted screenshots and generated images from the thread directory
  • Enforces limits: 400 messages max, 48MB image budget per preview, 64MB line size limit
  • Handles missing/unreadable segments gracefully with error reporting
  • Supports both gzip and zstd compression formats

Verification

  • pnpm check passes
  • Tests cover behavior: 101 lines of comprehensive test coverage in tests/session-transcript.test.ts including message parsing, fallback to UI events, image handling, generated image discovery, and conversation truncation
  • User-facing documentation: UI strings added in both English and Chinese for preview button, dialog title, and status messages

Cleanup safety

  • This change does not expand what the app can delete — it only adds a read-only preview before deletion
  • No new cleanup targets or deletion logic introduced

Privacy

  • No credentials, session contents, thread IDs, usernames or private paths in code or tests
  • Preview is read-only and never persists or modifies data

https://claude.ai/code/session_01T3VnHzsih7Qq4QPYwvLtBk

Each session row gets a preview button that opens the conversation's
user and assistant messages, read from its rollout segments (oldest
first), so a conversation can be recognised before it is deleted.
Codex scaffolding is stripped the same way as the list preview, tool
calls are counted rather than shown, and long conversations are capped.
The main process only opens paths from the latest scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3VnHzsih7Qq4QPYwvLtBk
Codex embeds each pasted image in the rollout as an input_image data
URL framed by <image …> / </image> text whose path points at a temporary
clipboard file. The preview now drops that frame text and renders the
embedded image, with click-to-zoom. Image data is capped per preview so
a screenshot-heavy conversation is never loaded whole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3VnHzsih7Qq4QPYwvLtBk
Images Codex generated for a thread live in generated_images/<thread>/
rather than in the rollout. The preview now lists them below the
messages, oldest first, sharing the same image budget as pasted
images; symlinks are never followed and files over budget are counted
instead of read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3VnHzsih7Qq4QPYwvLtBk
@FinnaXxx
FinnaXxx merged commit eea74cc into main Sep 23, 2026
4 checks passed
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.

2 participants