Skip to content

fix(desktop): enable message editing in Inbox#2198

Open
brow wants to merge 4 commits into
mainfrom
inbox-message-edit-action
Open

fix(desktop): enable message editing in Inbox#2198
brow wants to merge 4 commits into
mainfrom
inbox-message-edit-action

Conversation

@brow

@brow brow commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What changed?

Inbox detail now gives the current user's messages the same ownership-gated Edit action as channel view. Editing reuses the existing composer and mutation flow, preserves attachment metadata, and refreshes structural overlays so the edited content appears immediately.

Foreign authors' messages remain non-editable, including grouped Inbox conversations whose selected event is not the representative item.

Before After
Own Inbox message exposes Edit message. Saving the edit updates the Inbox detail immediately.
Before: Edit message action in Inbox detail After: edited Inbox message content

Why?

Inbox rows did not pass an edit handler into the shared message action bar, so a user's own messages could be edited from channel view but not from Inbox detail.

How is it tested?

Desktop checks, unit tests, and the full local CI gate passed. The focused Inbox Playwright regression passed 3 consecutive runs and covers current-user edit/save, foreign and archived-channel denial, and attachment preservation when a just-sent reply is edited before its relay echo arrives.

Added tests:

🤖 This PR was authored with an agent.

Co-authored-by: Tom Brow <tomb@block.xyz>
Signed-off-by: Tom Brow <tomb@block.xyz>
brow pushed a commit that referenced this pull request Jul 21, 2026
@brow

brow commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@brow

brow commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@builderbot review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@brow brow left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Reviewed ownership gating, Inbox edit/composer mutation wiring, and focused E2E coverage at 1c97068; no blocking issues found.

@brow brow changed the title fix(desktop): enable Inbox message editing fix(desktop): enable message editing in Inbox Jul 21, 2026
@brow
brow marked this pull request as ready for review July 21, 2026 01:56
@brow
brow requested a review from a team as a code owner July 21, 2026 01:56
Comment thread desktop/src/features/home/ui/InboxDetailPane.tsx Outdated
Co-authored-by: npub1ft62tztwwm2x9xamk25smmuaj4sfckdkldksruf2x2jwqalffkrq0g7arr <4af4a5896e76d4629bbbb2a90def9d95609c59b6fb6d01f12a32a4e077e94d86@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1ft62tztwwm2x9xamk25smmuaj4sfckdkldksruf2x2jwqalffkrq0g7arr <4af4a5896e76d4629bbbb2a90def9d95609c59b6fb6d01f12a32a4e077e94d86@sprout-oss.stage.blox.sqprod.co>

@brow brow left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 HomeView.tsx builds a just-sent Inbox reply echo with tags: emojiTags only (currently line 894), omitting the imetaTags and mentionTags already sent to the relay. The new Edit action can target this echo before refresh replaces it, so editing a just-sent attachment reply hydrates zero attachments and Save emits an explicit empty imeta set, silently deleting its media. Please preserve the full outbound tags on the echo, such as tags: [...imetaTags, ...emojiTags, ...mentionTags], and add a send-attachment-then-immediate-edit regression test.

@brow brow left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Late independent review at 8437854 (full PR plus the round-2 archived-channel delta). Scope: shared ownership check and agent-owner path, the known-and-unarchived channel gate (fails closed while the channel list is unresolved, since undefined === null is false), reply/edit target separation, composer hydration and edit-save wiring, structural-event hydrate/refresh (idempotent when the same edit/deletion event also arrives via the channel-window cache), and the E2E regression coverage including the archived-channel case.

No new issues from me. I verified end to end the one outstanding finding already filed in review 4740770432: the just-sent Inbox reply echo keeps only its emoji tags, so an immediate Edit of that echo hydrates zero attachments and Save emits an explicit empty imeta set, which is the wipe-attachments signal; that fix is in flight. All required checks are green at this head.

Submitting as COMMENT rather than approval because this authenticated GitHub account is also the PR author.

npub1ft62tztwwm2x9xamk25smmuaj4sfckdkldksruf2x2jwqalffkrq0g7arr and others added 2 commits July 20, 2026 20:21
Co-authored-by: Tom Brow <tomb@block.xyz>
Signed-off-by: Tom Brow <tomb@block.xyz>
* origin/main:
  chore(release): release Buzz Mobile version 0.4.9 (#2200)
  Simplify first-community onboarding choices (UI only) (#2194)
  fix(mobile): sanitize Android image uploads (#2188)

Co-authored-by: Tom Brow <tomb@block.xyz>
Signed-off-by: Tom Brow <tomb@block.xyz>
@brow
brow force-pushed the inbox-message-edit-action branch from c1288b4 to 0bb3722 Compare July 21, 2026 03:30
@brow

brow commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Addressed in de273b8. The immediate Inbox echo now retains imeta, emoji, and reference-only mention tags. The new E2E withholds the relay echo, sends an attachment reply, edits the local echo, verifies the edit payload preserves the imeta tag, then releases the relay echo and confirms the attachment still renders.

@brow brow left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Round-3 delta review at 0bb3722 (delta from my prior review at 8437854: fix de273b8 plus the main merge). Clean, no new issues.

Verified: (1) the echo fix carries exactly the three tag groups splitOutgoingTags produced for the outbound send, so imetaMediaFromTags hydrates the attachment on an immediate edit and Save no longer emits the empty wipe set; (2) the mock's new mentionTags arg mirrors the real send_channel_message Tauri surface (tauri.ts already passes it); (3) the defer/release echo seam is reset on mock install so deferred echoes cannot leak across tests, and only the send path is gated; (4) the new E2E asserts payload-level fidelity on both send_channel_message and edit_message while the relay echo is genuinely withheld, then releases exactly one echo and re-asserts text plus attachment rendering — the mediaTags assertion is the discriminating pre-fix failure; (5) the e2eBridge.ts merge overlap resolves correctly — diffed against both parents, the merge adds exactly the two main-side command mocks on one side and exactly the PR's changes on the other, with no lost edits or reverts.

All required checks are green at this head, including both Desktop E2E Integration shards. COMMENT rather than approval because this authenticated account is also the PR author.

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