fix(collab-c5): F-165 — your name on your own comments, not "Anonymous"#116
Merged
Conversation
A posted comment's author rendered as "Anonymous": Notes + Journal passed
`authorName={localPresenceName()}`, which reads a renderer-local
localStorage pref that nothing ever sets. The signed vault profile
(`roster.self().displayName`, Collab-C6) is the real identity and was
already wired into the ShareDialog member list + existing comments — the
optimistic author echo was the one path still on the localStorage default.
- packages/sdk/src/use-self-display-name.ts — a small React hook:
prefer the profile displayName, fall back to the short key fingerprint
when it's unset (honest — it's your key, not "Anonymous"), and only
fall back to localPresenceName() when the roster is unavailable (older
shell / no `roster.read`). New `@brainstorm/sdk/self-display-name`
subpath + vitest alias.
- Notes + Journal comment panels now pass the resolved self name.
+5 tests (profile name / fingerprint fallback / whitespace trim / null
roster / rejected self()). Notes+Journal+SDK suites green (3094);
touched apps + packages typecheck clean (pre-existing contacts `lexical`
worktree gap unrelated).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Part of 0.2.1. A posted comment's author rendered as "Anonymous" — Notes + Journal passed
authorName={localPresenceName()}, a renderer-locallocalStoragepref that nothing sets. The signed vault profile (roster.self().displayName, Collab-C6) is the real identity and was already wired into the ShareDialog member list + existing comments; the optimistic author echo of a just-posted comment was the one path still on the localStorage default.@brainstorm/sdk/self-display-name— a small hook: prefer the profiledisplayName, fall back to the short key fingerprint when unset (honest — it's your key, not "Anonymous"), and only fall back tolocalPresenceName()when the roster is unavailable (older shell / noroster.read).Also pre-stages presence (same self-name resolution).
Tests: +5 (profile name / fingerprint fallback / whitespace trim / null roster / rejected
self()). Notes+Journal+SDK suites green (3094). Touched apps + packages typecheck clean (the pre-existing contactslexicalworktree gap is unrelated).🤖 Generated with Claude Code