Repository navigation
Conversation
Read and write the shared thread titles Buzz 0.x, agents and the `buzz` CLI already set (NIP-AR kind 45010, type `buzz.thread-title`): a titled thread shows its title under its first message in the channel and on its thread tab, and renaming a thread tab sets the title for everyone in the channel. A rename that can't be saved stays on that tab on this device. One title store per relay session reads joined channels' current titles and re-reads only channels a live title revision touched. Writes compare against the revision last seen and report a conflict rather than overwriting. Provided by a new optional Named threads plugin (`buzz.threads`), on by default. While it is off, nothing reads titles and renaming a thread tab stays device-local, as on main. Channels can't see another plugin's state, so the plugin turns titles on through a counted switch in the title store (`enableThreadTitles`, from a `ctx.effect`); counting keeps titles on when a reloaded plugin's old instance is disposed after the new one starts. Part of block#3455. Co-authored-by: Engineer <f79d52bb0d4ab12c7affaf2235c113a7fc797a9da8f9707757123b67cfafa6c6@buzz.matrixsoftwareinc.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jeff Hedlund <jhedlund@gmail.com>
joahg
left a comment
There was a problem hiding this comment.
🤖 This is a comment, not an approval. A human maintainer (design or core team) must review this PR, since it adds a user-visible, default-on plugin and changes tab rename behavior.
I read the diff against root AGENTS.md, the plugin architecture and defaults docs, and the artifact helpers it reuses. No FOUNDATION file is changed: crates/plugin-manager/src/lib.rs only gets a catalog entry and a default-on entry. There are no path-local AGENTS.md files under src/bundled/ or src/features/messages/ in this checkout.
What looks right
- Titles are kind 45010 artifacts with a derived
d, so a thread has one title. Writes use a strong head read and aprevcheck, and a lost race is a conflict, not an overwrite. - The store never trusts live events as-is. It marks the channel stale and rereads the relay's current heads, so edits, restores and deletes show correctly and
created_atordering is not used. - On read it keeps only titles whose
dmatches the root and whose channel was asked for. Reads are batched at 100 channels. - The store has no live subscription of its own, uses a WeakMap per session, and closes when the last reader leaves. The counted on/off switch survives a plugin reload.
- The accessory is a plugin registration through the existing conversation API, so no core conversation files are edited.
- Tests cover the plan, conflict, batching, stale marking, the switch and the tab rename paths.
Findings
- P1: Titles are not checked on read.
parseTitleonly checks that the tags exist. The 512-byte limit and trimming apply to writes only, so any client that can publish an artifact can set a huge, multi-line or bidi-override title. It then renders in every member's timeline and tab label. Clamp length and strip control and bidi characters inparseTitle, and truncate in the accessory. See the inline comments. - P2: Who may set or change a title is not stated. The client never looks at
pubkey, so a title is not tied to the thread author or a channel admin, and the row shows no author. If the relay lets any member update the head, any member can retitle someone else's thread and it reads like part of the thread. Please document the relay rule, and maintainers should decide whether that is intended. - P2: A tab rename is now a channel-wide write with no confirmation. If the write fails or the name is over 512 bytes, the local name stays and shadows the shared title (
tab.namewins). The only signal is aconsole.warn. See the inline comment. - P2: Read volume on a default-on plugin. Each client reads up to 500 current artifacts per 100 joined channels on start and on every change to the joined set. One title change in a channel rereads the whole channel. Titles past 500 per read are dropped, and
partialanderrorare set but nothing in this PR shows them. A failed first read is not retried until the channel list changes. AGENTS.md asks for jitter and capped backoff on fleet-wide read paths. Maintainers should decide whether this ships on or opt-in. - P3: Every message row mounts the accessory and subscribes to the whole store snapshot, so a title change rerenders all mounted rows. A selector for one key would avoid it.
refresh()has no caller in this PR. - P3: The
buzz.thread-titletype name and the module-level switch between Channels and this plugin need a maintainer decision, as the description says. A plugin fits the architecture here, but a generic conversation contribution would touch FOUNDATION files. - P3: The only screenshot is the channel row. Please add the tab label, light and dark, a narrow width, and a long title. The live relay check ran in a build with follow-up branches, not this head. Add tests for hostile titles and for a read that hits the 500 cap.
| }>; | ||
|
|
||
| /** A live title, or undefined for other types, deletions or malformed events. */ | ||
| export function parseTitle(event: EventData): ThreadTitle | undefined { |
There was a problem hiding this comment.
🤖 P1: parseTitle returns the title tag as-is. Other clients are not bound by normalizeTitle, so a member can publish a very long, multi-line or bidi-override title that shows in everyone's timeline and tabs. Clamp the byte length, collapse newlines and strip control and bidi characters here, so every consumer gets a safe string.
| onClick={() => openThread()} | ||
| > | ||
| <MessageReplyIcon size="1rem" aria-hidden="true" /> | ||
| <span className="text-body-sm">{title.title}</span> |
There was a problem hiding this comment.
🤖 P1: This span has no truncation, and the same text goes into aria-label. A long title will push the row wider or taller. Truncate to one line here and sanitize in parseTitle. Also consider showing who set the title, since it appears under someone else's message.
| }, | ||
| (cause) => { | ||
| console.warn( | ||
| "Couldn't save the thread title; kept it on this tab", |
There was a problem hiding this comment.
🤖 P2: On failure the typed name stays as the local tab name, so it hides the shared title for good, and the user only gets a console.warn. The same happens silently for names over 512 bytes. Please surface the failure and let the user retry or drop the local name. Maintainers should also confirm that a plain tab rename becoming a channel-wide write is intended.
- parseTitle cleans every title it reads: line breaks and controls become a space, bidi formatting characters are removed, and anything over 512 bytes is cut at a code point boundary. Typed titles get the same cleaning. - The timeline row keeps a title to one line, with the full title on hover. - A failed tab rename drops the typed name, so it can't hide the shared title, and shows an error toast with Retry. A name over the limit says so and changes nothing. - A failed title read is retried after a jittered delay that doubles up to five minutes, instead of waiting for the channel list to change. - useThreadTitle reads one key, so a title change rerenders only its row. - Drop the store's unused refresh(). Co-authored-by: Engineer <f79d52bb0d4ab12c7affaf2235c113a7fc797a9da8f9707757123b67cfafa6c6@buzz.matrixsoftwareinc.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jeff Hedlund <jhedlund@gmail.com>
- Retry writes against the revision the rename was typed over, so it conflicts instead of replacing a title someone else set meanwhile. A conflict offers no Retry: the tab shows the current title, and renaming again writes over it. A newer rename of the same tab retires an older rename's Retry and outcome. - A channel whose title read failed waits for its backoff even when live changes mark it stale, including changes that arrived during that read. - The help guide describes the rollback and recovery. Co-authored-by: Engineer <f79d52bb0d4ab12c7affaf2235c113a7fc797a9da8f9707757123b67cfafa6c6@buzz.matrixsoftwareinc.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jeff Hedlund <jhedlund@gmail.com>
Every thread-tab rename, including a device-local one and a blank one, retires earlier renames' pending Retry, and Retry does nothing while shared titles are off. Retry keeps the revision it was typed over. Co-authored-by: Engineer <f79d52bb0d4ab12c7affaf2235c113a7fc797a9da8f9707757123b67cfafa6c6@buzz.matrixsoftwareinc.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jeff Hedlund <jhedlund@gmail.com>
Only an accepted rename retires an earlier rename's outcome and Retry, so a name rejected as too long while a save is pending no longer leaves that save's typed name stranded on the tab when it fails. Co-authored-by: Engineer <f79d52bb0d4ab12c7affaf2235c113a7fc797a9da8f9707757123b67cfafa6c6@buzz.matrixsoftwareinc.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jeff Hedlund <jhedlund@gmail.com>
|
Thanks for the careful read. Pushed e2c9177..7baa678 with fixes for the P1 and the code-level P2/P3 items; the rest need a maintainer call, noted below. P1: titles not checked on read — fixed. P2: tab rename failure — fixed. A failed write now drops the typed name, so it can't shadow the shared title, and shows an error toast with the reason. Retry writes against the revision the rename was typed over, so it conflicts rather than replacing a title someone else set meanwhile; a conflict offers no Retry (the tab shows the current title, and renaming again writes over it), and a newer rename of the same tab retires an older one's Retry. A name over 512 bytes shows an error toast and changes nothing (before, it stayed local silently). The P2: read volume — partly addressed. A failed read is now retried after a jittered delay (0.5–1.5× of 5 s, doubling to a 5 min cap) instead of waiting for the joined set to change; live title changes in a failed channel wait for that retry rather than bypassing the backoff. Reads otherwise are unchanged: P2: who may set a title. The client doesn't restrict authorship: anyone the relay lets write a channel artifact can set or change a thread's title, same as the 0.x P3: rerenders — fixed. P3: type name / module-level switch. Left for the maintainer decision named in the description. |
|
Screenshots for the P3 item, from the current head (7baa678). They were rendered in the browser test fixture with mock data, light and dark, at 1440 px and 760 px. The first thread in the channel has a hostile title, as another client could publish it: several lines, a right-to-left override, and well past 512 bytes. It shows as one clean line in reading order, truncated, on the row and on its tab. The fixture run also checks that the shown title has no line breaks or bidi characters and stays within 512 bytes. Channel rows: light / dark, 1440 then 760 Thread tabs: light / dark, 1440 then 760 (at 760 the open thread fills the pane) A live relay check of this head in a desktop build is still to do.
|
|
🤖 Thanks for this. We're not going to take this on right now. Letting someone rename a thread for everyone needs extra security around who started the thread, rather than relying on the channel's existing access rules, and that's more than we want to build at the moment. |
|
Thanks for taking the time to look, and for the clear reason. That makes sense: tying a shared title to the thread's author would need relay-side enforcement, not just a client check. Closing this and the follow-up #3774. If that author-scoped rule lands in the relay later, I'm happy to revisit on top of it. (or I'd be willing to look into the relay change). I'll keep using this on my local so if it ever comes back up again I'll be ready for it. |








Part of #3455.
Shared thread titles in the channel and on thread tabs. This is the first of the four PRs proposed in #3455, and it works on its own.
Behaviour
buzz.thread-title) that Buzz 0.x, its agents and thebuzz threads titleCLI already read and write, so both apps show the same titles. The relay needs no change.Scope checkpoint
src/features/messages/thread-titles.ts: the title convention, mirroringbuzz_sdk::thread_titlein 0.x.src/features/messages/thread-title-store.ts: one live title set per relay session.src/bundled/channels/useConversationTabs.tsx: tab label and rename.src/bundled/threads/: the plugin, which registers only the timeline accessory.src/bundled/index.tsandcrates/plugin-manager/src/lib.rs.ceil(joined/100)current reads when the first reader subscribes and whenever the joined set changes, then one read per burst of title changes. Following titles adds no subscriptions, because the existing live routes already carry the joined channels.Two things to flag
buzz.threadsjoinsenabled_by_default(Rust) andenabledByDefault: true(TS). If you'd rather ship it opt-in, that is a two-line change and I'm happy to make it.thread-title-store.ts.enableThreadTitles()returns a disposer, and the plugin calls it fromctx.effect.useConversationTabshas no ctx and three callers in two plugins: Channels'PageTabsandChannelsPage, and Bestie'sBestieConversation. A service would have to be read and passed down by each of them.features/conversation/*, which are FOUNDATION files, so I didn't do it without asking.Question carried from #3455
Is
buzz.thread-titlean acceptable artifact type, or is thebuzz.*prefix yours to assign? The same question is open on block/buzz#8563. Renaming it is a one-constant change (THREAD_TITLE_TYPE). Titles already written under the current name would then need either a period of reading both names or a one-off rewrite, and I'd include that.What follows
threads/3-marks, for reference, not opened: pin and done. It waits on Shared thread titles and a Threads page #3455's questions 3 and 4 (Add synced personal thread pins and Recent sidebar navigation #2063, and thesession.tspass-through). About 540 production lines.threads/4-agent-tool, for reference, built on this PR: the agentthread_titletool. About 140 production lines.Verification
Typecheck and Biome are clean.
design:checkreports nothing in the files this PR adds. It does flag existing upstream CSS on Windows, unrelated to this PR.Targeted suites on this head pass, 83/83: threads, title store and titles, and the conversation-tab tests.
Every new test was checked against the bug it targets. Removing each guarded behaviour makes its test fail:
Broad vitest comparison against main 949034f, on Windows: threads, channels, Bestie, messages, app, plugins and the bundled catalog. That run was on the previous head, which differs only in one test file. No file fails here that passes on main. A few files failed in the parallel run and pass when re-run alone.
cargo
buzzodz-plugins:native_catalog_matches_desktop_bundlespasses. The three other failures also fail on main on Windows.Live check against a real relay: passed on 2026-11-17, with the revisions checked in the relay database. It was run in a Windows build that also includes the follow-up branches (feat(threads): add a Threads page listing titled threads #3774, pin and done, and the agent tool). As a standalone change, this PR rests on its own typecheck and suites above. The check covers:
On a folded agents-only message the title appears when the row is expanded, as the reply count does.
🤖 Generated with Claude Code