feat(desktop): "Also send to #channel" broadcast opt-in for thread replies#1890
Open
yti93 wants to merge 1 commit into
Open
feat(desktop): "Also send to #channel" broadcast opt-in for thread replies#1890yti93 wants to merge 1 commit into
yti93 wants to merge 1 commit into
Conversation
Slack-style NIP-CW broadcast: a checkbox under the thread composer lets the author surface a direct reply to the thread head on the channel timeline as well as in its thread. - events.rs build_message takes broadcast and appends ["broadcast","1"] to replies only; send_channel_message threads it through the IPC boundary (inert for non-replies and the managed-agent path) - thread panel offers the toggle only for depth-1 replies to a root thread head (canBroadcastThreadReply); the opt-in is one-shot and clears on thread switch, consumed by a successful send - optimistic message + server-echo tag reconstruction carry the tag so the reply appears on the timeline immediately - e2e mock bridge mirrors the relay's stored-event shape
Author
Desktop screenshots (mock bridge)The toggle — replying directly to a root thread head offers the one-shot opt-in under the composer: Checked before send: After send — the reply lands in the thread and on the #general timeline (bottom), the thread summary shows "1 reply", and the checkbox has reset for the next reply: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Adds Slack's "Also send to #channel" to the desktop thread composer, using the NIP-CW broadcast reply semantics the protocol already defines (
["broadcast", "1"]). The relay ingest, SDK, CLI, and both clients' rendering already support broadcast replies — this PR adds the missing authoring surface on desktop.What
A checkbox under the thread composer lets the author surface their next reply on the channel timeline as well as in its thread:
canBroadcastThreadReply). It hides when targeting a nested reply, when the thread head is itself a reply, or while editing.collapsedThreadHeadId).How
events.rs:build_message(..., broadcast)appends["broadcast", "1"]to replies only — the flag is inert without athread_ref, so non-reply sends can never carry the tag. The managed-agent and huddle-transcription paths passfalse.send_channel_messageacceptsbroadcast: Option<bool>over IPC; the TS bridge (sendChannelMessage) threads it through for replies only.buildMainTimelineEntriesalready surfaces broadcast replies).ThreadSendContext, now a shared type replacing four inline copies) carriesbroadcastthrough the mention-flow confirmation dialog, so a deferred send after a non-member mention prompt still broadcasts.Testing
build_messageemits the tag on replies when requested, never on top-level messages (message_reply_broadcast_tag,message_top_level_ignores_broadcast).buildReplyTagstag shape/ordering with broadcast;canBroadcastThreadReplyeligibility matrix (threading.test.mjs, threadPanel.test.mjs).thread-broadcast.spec.ts): broadcast reply lands on the channel timeline while a plain reply doesn't; opt-in resets after send; toggle hides when targeting a nested reply.pnpm check,tsc --noEmit, biome, clippy,cargo test(Tauri, 1400 pass), desktop unit suite (2893 pass) all green. File-size guard overrides bumped per the documented convention (three files already on the queued-to-split list).