Skip to content

feat(web): edit and remove queued messages - #11959

Open
DominicVonk wants to merge 2 commits into
pingdotgg:mainfrom
DominicVonk:t3code/edit-queued-messages
Open

DominicVonk wants to merge 2 commits into
pingdotgg:mainfrom
DominicVonk:t3code/edit-queued-messages

Conversation

@DominicVonk

@DominicVonk DominicVonk commented Sep 15, 2026

Copy link
Copy Markdown

What Changed

Queued messages now have separate Edit and Remove actions in web and desktop. Edit returns the message, attachments, and context to the composer and focuses it; existing draft text is preserved. Remove discards the queued message without restoring it and releases its image preview URLs.

Why

The queue previously exposed only Send now and a cancel action that returned content to the composer. Editing is now explicit, and Remove actually removes the message.

UI Changes

Watch the 25-second recording: queue → edit → requeue → remove (MP4)

The recording shows a real active test turn: queue a message, click the pencil to restore and focus it, change its text, requeue it, then remove it while preserving a separate composer draft.

Before After
Before: send and cancel After: send, edit, and remove

The stills use the same held-message fixture against the base and changed UI. Mobile has its own existing queue-editing flow; no server, provider, or contract changes are needed.

Validation

  • 308 tests pass across the queue store, composer draft store, and two timeline suites, including two added queue regression tests for stale dispatch after removal and preserving the attachment payload for editing.
  • Web typecheck passes. Targeted lint and formatting pass, with warnings in existing code.
  • Verified duplicate-image restoration keeps the send refs synchronized with the accepted draft before React effects run.
  • Verified Edit focuses the composer, revised text requeues correctly, and Remove leaves the current draft untouched in the real browser against isolated state.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Implemented with GPT-6 in Codex.

Summary by CodeRabbit

  • New Features
    • Queued messages can be edited directly from the message timeline.
    • Editing restores the complete message, including attachments, to the composer and focuses it for immediate changes.
  • Bug Fixes
    • Removing queued messages now clears associated image previews.
    • Queue actions preserve other pending messages and prevent removed messages from being reused.
  • Tests
    • Added coverage for queued-message editing, removal, attachments, and multi-message queue behavior.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 15, 2026
Comment thread apps/web/src/components/ChatView.tsx
@macroscopeapp

macroscopeapp Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds user-facing edit/remove behavior for queued messages and changes existing cancel semantics while interacting with shared composer attachment state. An unresolved High-severity finding identifies a possible mismatch where an image can be uploaded despite being absent from the composer UI, so the change needs human review.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: cc421ec8-9b63-47d6-a050-6cf18c074708

📥 Commits

Reviewing files that changed from the base of the PR and between 7cbaff4 and 2621440.

📒 Files selected for processing (1)
  • apps/web/src/components/ChatView.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Queued messages can now be edited from the timeline. Editing removes the message from the queue, restores its prompt and attachments to the composer, and focuses the composer. Removal also revokes image preview URLs.

Changes

Queued message editing

Layer / File(s) Summary
Timeline edit action
apps/web/src/components/chat/MessagesTimeline.tsx
MessagesTimeline accepts and shares an edit callback. Queued message rows render an edit button. The remove action labels now describe removal.
Composer restoration and validation
apps/web/src/components/ChatView.tsx, apps/web/src/queuedMessageStore.test.ts
ChatView restores edited message data and attachments to the composer, focuses the composer, and passes the callback to MessagesTimeline. Tests cover stale snapshots, attachment preservation, remaining queued messages, and repeated removal.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant QueuedMessageTimelineRow
  participant ChatView
  participant queuedMessageActionRef
  participant Composer
  User->>QueuedMessageTimelineRow: Select edit action
  QueuedMessageTimelineRow->>ChatView: Invoke onEditQueuedMessage(id)
  ChatView->>queuedMessageActionRef: Remove queued message
  queuedMessageActionRef-->>ChatView: Return prompt and attachments
  ChatView->>Composer: Restore prompt and attachments
  ChatView->>Composer: Focus composer
Loading

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to 26214

The queued-message edit and removal flows preserve accepted attachments and clean up previews without an established merge-blocking regression.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: adding edit and remove actions for queued messages.
Description check ✅ Passed The description covers what changed, why it changed, UI evidence, validation results, and all checklist items. It also explains the interaction changes and confirms the scope remains focused.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@DominicVonk

Copy link
Copy Markdown
Author

Reviewed CodeRabbit's docstring coverage warning. No extra callback documentation was added: AGENTS.md asks us to avoid narrating behavior already clear from code and to keep local explanations beside the relevant logic. The attachment restore now has a focused comment explaining why send refs must be read synchronously from the accepted draft state.

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant