Skip to content

fix(messages): route edits to the owning composer - #6575

Open
tellaho wants to merge 10 commits into
mainfrom
tho/message-edit-ux
Open

fix(messages): route edits to the owning composer#6575
tellaho wants to merge 10 commits into
mainfrom
tho/message-edit-ux

Conversation

@tellaho

@tellaho tellaho commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Category: fix
User Impact: Editing a channel message now opens in the main composer, while editing a thread reply stays in the thread composer, with focus ready for typing.

Problem: When a thread was open, Buzz treated its root message as thread-owned and opened edits in the thread composer. Menu-driven edits also lacked regression coverage for immediate focus.

Solution: Carry the message's semantic root/reply classification into the edit target, route only actual replies to the thread composer, and use the menu primitive's selection event for a reliable handoff. End-to-end tests cover placement and focus for both paths.

File changes

desktop/src/features/channels/ui/ChannelPane.tsx
Routes edit targets by semantic thread ownership rather than membership in the open thread panel.

desktop/src/features/channels/ui/ChannelPane.types.ts
Uses the shared composer edit-target type so routing metadata stays attached to the target.

desktop/src/features/messages/lib/draftMentionRefs.ts
Classifies each edit target as a root or true thread reply from its event tags.

desktop/src/features/messages/lib/draftMentionRefs.test.mjs
Covers semantic ownership for root and reply edit targets.

desktop/src/features/messages/ui/MessageActionBar.tsx
Handles Edit through the dropdown menu's selection event so focus restoration and edit startup share the intended lifecycle.

desktop/src/features/messages/ui/MessageComposer.types.ts
Adds semantic thread ownership to the edit-target contract.

desktop/tests/e2e/messaging.spec.ts
Verifies root edits use and focus the main composer, while reply edits use and focus the thread composer.

Reproduction Steps

  1. Send a channel message and open its thread.
  2. From the thread panel, edit the root message; confirm its content loads in the main composer and the editor is focused.
  3. Send a reply in that thread.
  4. Edit the reply; confirm its content loads in the thread composer and the editor is focused.

Screenshots

Editing a channel-root message uses the main composer

Channel-root message editing in the main composer, dark theme with purple accent

Editing an actual thread reply uses the thread composer

Thread reply editing in the thread composer, dark theme with purple accent

@tellaho tellaho changed the title fix message edit composer routing fix(messages): route edits to the owning composer Aug 22, 2026
@tellaho

tellaho commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

AI-authored update (Rizz): Persisted thread replies could render from the independently loaded thread data but could not resolve as edit targets, so choosing Edit appeared to do nothing.

Fixed in c50988f24adfb0175d036562b61b5288d6ff0b49 by resolving edit targets from the channel timeline first, with the independent thread messages as a fallback, and replacing the live-send-only check with pre-seeded reply coverage.

Validation at that commit: the pre-seeded regression fails against the prior implementation and passes with the fix; fresh built E2E covers root → main composer and persisted reply → thread composer with immediate focus (2/2); desktop typecheck and all 5,398 desktop unit tests pass; pre-push branch-skew, file-size, desktop-check, typecheck, and desktop-test gates pass.

tellaho and others added 3 commits August 22, 2026 11:54
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho force-pushed the tho/message-edit-ux branch from c50988f to c93b0ad Compare August 22, 2026 18:58
@tellaho

tellaho commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

AI-assisted update (Rizz): addressed Mongo’s F1–F5 blockers.

  • Root and broadcast-reply edits now dismiss an unavailable single-panel/focus thread surface before opening and focusing the main composer; ordinary replies stay in the thread composer.
  • Thread close is explicitly blocked during an active edit with guidance, preserving unsaved text.
  • isThreadReply is now required, and coverage includes live/optimistic replies, pre-seeded independently fetched replies, broadcast replies, narrow view, focus mode, and close-with-unsaved-edit.
  • Rewrote all branch commits with Taylor Ho as author/signatory, Rizz as committer/co-author, and Conventional Commit subjects.

Validated at c93b0adad84455c29e15e62d48a885e402381efd: desktop typecheck; desktop unit suite (5,398/5,398); fresh E2E build plus 7/7 targeted smoke tests; force-push gates (file-size-check, desktop-check, desktop-typecheck, desktop-test); clean worktree and per-commit fuller/trailer audit.

tellaho and others added 4 commits August 22, 2026 12:41
Refuse cross-message edit transitions while preserving unsaved text, and let Escape cancel focus-drawer edits before drawer dismissal.

Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho force-pushed the tho/message-edit-ux branch from 8f8f59f to f3dfb9e Compare August 22, 2026 23:26
tellaho and others added 3 commits August 22, 2026 17:24
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho marked this pull request as ready for review August 23, 2026 16:39
@tellaho
tellaho requested a review from a team as a code owner August 23, 2026 16:39
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