Skip to content

Allow Huddle between 2 humans in DM#1347

Merged
klopez4212 merged 1 commit into
mainfrom
kennylopez-huddles-dm
Jun 29, 2026
Merged

Allow Huddle between 2 humans in DM#1347
klopez4212 merged 1 commit into
mainfrom
kennylopez-huddles-dm

Conversation

@klopez4212

@klopez4212 klopez4212 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Enable huddle starts from DMs, with temporary huddle channel names built from participant first names.
  • Render huddle starts as inline attachment cards, keep huddle replies inside the huddle thread, and allow huddle-start events to resolve as thread roots.
  • Make transcript posting opt-in behind the captions control and add View thread from the active huddle bar.

Screenshots

DM huddle card

Huddle card close-up

Tests

  • pnpm --dir desktop check
  • pnpm --dir desktop exec node --import ./test-loader.mjs --experimental-strip-types --test src/features/huddle/lib/huddleChannelName.test.mjs src/features/channels/lib/huddleAvailability.test.mjs src/features/messages/lib/threadPanel.test.mjs src/features/messages/lib/messageQueryKeys.test.mjs src/features/messages/lib/formatTimelineMessages.test.mjs
  • pnpm --dir desktop exec tsc --noEmit
  • cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --check
  • cargo check --manifest-path desktop/src-tauri/Cargo.toml
  • just desktop-screenshot --name huddle-dm-card --messages /tmp/sprout-huddle-pr/huddle-message.json --viewport 1280x720 --wait 2000 --outdir /tmp/sprout-huddle-pr/screenshots
  • just desktop-screenshot --name huddle-card-closeup --messages /tmp/sprout-huddle-pr/huddle-message.json --viewport 1280x720 --wait 2000 --clip 300,320,500,130 --outdir /tmp/sprout-huddle-pr/screenshots
  • Pre-push hooks: check-push-org, desktop-test, mobile-test, rust-tests, desktop-tauri-test

klopez4212 added a commit that referenced this pull request Jun 29, 2026
@klopez4212 klopez4212 changed the title Improve DM huddle threads [codex] Improve DM huddle threads Jun 29, 2026
@klopez4212 klopez4212 changed the title [codex] Improve DM huddle threads Improve DM huddle threads Jun 29, 2026
@klopez4212 klopez4212 marked this pull request as ready for review June 29, 2026 10:43
@klopez4212 klopez4212 requested a review from wesbillman June 29, 2026 10:43
@klopez4212 klopez4212 changed the title Improve DM huddle threads Allow Huddle between 2 humans in DM Jun 29, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 72ad312dfb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/huddle/components/HuddleAttachment.tsx
@klopez4212 klopez4212 force-pushed the kennylopez-huddles-dm branch from 72ad312 to 85522ea Compare June 29, 2026 11:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85522eaef4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/shared/constants/kinds.ts
Comment thread desktop/src/features/huddle/components/HuddleAttachment.tsx
@klopez4212 klopez4212 force-pushed the kennylopez-huddles-dm branch from 85522ea to b5a8c18 Compare June 29, 2026 12:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5a8c187b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/shared/constants/kinds.ts

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Adversarial review: I found one CHANGE blocker.

CHANGE: DM huddle starts must notify / mark unread

For inactive DMs, the kind:48100 huddle-start card is the invite. Right now it can arrive silently: no sidebar unread badge and no desktop DM notification unless the recipient already has that DM open.

Why:

  • KIND_HUDDLE_STARTED is in CHANNEL_EVENT_KINDS and renders as visible timeline content (desktop/src/shared/constants/kinds.ts).
  • But unread and DM desktop notifications are driven by CHANNEL_MESSAGE_EVENT_KINDS, which still excludes huddle starts.
  • useLiveChannelUpdates only bumps unread for UNREAD_TRIGGER_KINDS = CHANNEL_MESSAGE_EVENT_KINDS, and handleDmEvent only notifies when isDmNotifiableKind(event.kind) passes.
  • isDmNotifiableKind is also exactly CHANNEL_MESSAGE_EVENT_KINDS.

That violates the PR’s DM use case: in a 1:1 DM, the other human can miss the huddle invitation entirely. It also conflicts with the huddle lifecycle-as-events model: this lifecycle event is an invitation, not background metadata.

Suggested fix: treat KIND_HUDDLE_STARTED as a DM activity trigger/notification — either include it in the trigger set with care for non-DM unread semantics, or add a separate DM-only huddle notification path. Keep participant join/left/end excluded from unread; the start card is the actionable event.

Other adversarial notes

  • The protocol shape is otherwise aligned with VISION.md: huddle lifecycle remains Nostr events (48100–48103) with channel scoping via h tags, and transcript posting is now opt-in.
  • The existing relay TODO around client-supplied parent_channel_id in crates/buzz-relay/src/audio/handler.rs is pre-existing, not introduced here, but this PR does lean harder on it for DM joins. I’d track it as a follow-up hardening item.
  • TESTING.md has no huddle-specific live smoke path; I validated the feasible targeted suite and leaned on CI for the broader matrix.

Validation I ran

  • cd desktop && pnpm exec node --import ./test-loader.mjs --experimental-strip-types --test ... focused huddle/thread/message constants tests ✅ (60 tests)
  • cd desktop && pnpm check && pnpm typecheck
  • cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --check
  • cargo check --manifest-path desktop/src-tauri/Cargo.toml attempted, but local build setup is missing desktop/src-tauri/binaries/buzz-acp-aarch64-apple-darwin; GitHub CI’s Rust/Desktop checks are green.
  • GitHub checks for PR #1347 are green, including Desktop, Mobile, Rust Lint, Desktop E2E, and Windows Rust.

Verdict: Request changes until DM huddle starts produce the expected unread/notification signal.

@wesbillman

Copy link
Copy Markdown
Collaborator

Follow-up/refinement after reconciling with Brain: please keep the fix DM-scoped.

I would not add KIND_HUDDLE_STARTED directly to CHANNEL_MESSAGE_EVENT_KINDS, because that shared set also affects non-DM unread / Home mention semantics. A stream huddle start should not become a general Stream unread trigger.

Preferred shape: add a DM-only notifiable/unread trigger set such as:

const DM_NOTIFIABLE_KINDS = [...CHANNEL_MESSAGE_EVENT_KINDS, KIND_HUDDLE_STARTED];

Then use that for DM notification + DM unread handling only. Keep 48101/48102/48103 excluded; only the start card is the actionable invite.

A good regression test would assert both sides:

  • inactive DM + KIND_HUDDLE_STARTED bumps unread / is notifiable
  • stream/forum huddle start does not become a generic unread trigger

@klopez4212 klopez4212 force-pushed the kennylopez-huddles-dm branch from b5a8c18 to 668c557 Compare June 29, 2026 13:43
@klopez4212

Copy link
Copy Markdown
Contributor Author

🤖 Addressed the requested change in 668c5575a.

What changed:

  • Added a DM-scoped huddle-start activity set instead of adding KIND_HUDDLE_STARTED to CHANNEL_MESSAGE_EVENT_KINDS.
  • DM desktop notifications and live unread triggers now include only the huddle start invite (48100).
  • DM catch-up unread queries include huddle starts, so inactive/offline DMs can still show the invite as unread.
  • Stream/forum huddle starts remain excluded from the generic unread trigger path; 48101/48102/48103 remain quiet.
  • Added regression tests for DM huddle-start notification/unread behavior and the non-DM exclusion.

@klopez4212 klopez4212 requested a review from wesbillman June 29, 2026 13:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 668c5575a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +206 to +207
const isStaleUnconfirmedHuddle =
!isCurrentHuddle && isHuddleStartStale(message.createdAt);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Confirm lifecycle before enabling huddle joins

The stale guard only disables cards after the one-hour TTL, so it does not cover a busy channel/DM that produces more than 100 huddle lifecycle events within that hour. Because subscribeToHuddleEvents only replays the last 100 lifecycle events, an ended huddle's 48103 can fall out of the replay while this age check is still false; the card then reconstructs from the seeded 48100 only and enables Join into an already archived room. Fresh evidence beyond the prior stale-card fix is that this path still fails when the lifecycle window is exceeded before HUDDLE_JOINABLE_WINDOW_SECONDS elapses.

Useful? React with 👍 / 👎.

@klopez4212 klopez4212 merged commit b58f671 into main Jun 29, 2026
25 checks passed
@klopez4212 klopez4212 deleted the kennylopez-huddles-dm branch June 29, 2026 15:49
tlongwell-block pushed a commit that referenced this pull request Jun 29, 2026
Brings the merged #1321 multi-tenant relay rewrite (and other main
commits) under the chart-fix branch so #1348 renders and tests against
current main. No conflicts.

Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>

* origin/main:
  Multi-tenant Buzz relay: community_id as a server-resolved key (comprehensive rewrite) (#1321)
  Disable persona start while runtime discovery runs (#1353)
  chore(deps): update dependency @tanstack/react-virtual to v3.14.4 (#1342)
  Fix sidebar unread indicator placement (#1319)
  fix(desktop): un-clip hover action bar's upward bleed under content-visibility (#1354)
  Allow Huddle between 2 humans in DM (#1347)
  chore(release): release Buzz Desktop version 0.3.36 (#1352)
  Polish agent runtime cards (#1327)
  Rework desktop message-timeline scrolling: de-virtualize + native overflow-anchor (#1338)
  Keep wave huddles pending for placeholder profiles (#1349)
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