feat(extension): local user notes (Phase 1)#10
Merged
Conversation
Add private, on-device notes attached to a username. The reader can jot a note about an author and see it again on every post by that author, across every thread on the forum. - src/userNotes.ts (new): a UserNotes store over a @forumforge/storage Collection. Notes are scoped per forum ORIGIN (not per thread) so a note follows the author across threads but never leaks onto a like-named stranger on another site. An emptied note deletes itself. API: get / set / remove / notesFor / all. - src/render.ts: each post gets a collapsed "Note" toggle and a per-author editor pre-filled from options.userNotes; posts whose author has a note are flagged (data-has-note) with a non-color dot cue. renderThread stays a pure view; setNoteState is exported and shared by initial render and the panel's update so they never drift. - src/sidepanel.ts: loads the forum's notes, passes them to render, and via the delegated output handler toggles the editor and persists a note, syncing every post by that author. UI follows what storage reached. - public/sidepanel.html: note toggle, editor, and annotated-author cue styles. Docs synced: ROADMAP.md, Initial Plan.md checklist, extension README.md. Verification: pnpm -r typecheck passes; pnpm test 113 pass (+19); extension bundle builds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2jBqrrrkjqDkHaYsCgw4C
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31ac2b5ecc
ℹ️ 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".
The .ff-post__note rule sets display:flex, which overrides the hidden attribute's default display:none (a class rule beats the UA hidden style), so the note editor rendered visible even while collapsed and the Note toggle couldn't hide it. Add an explicit .ff-post__note[hidden] override. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2jBqrrrkjqDkHaYsCgw4C
8 tasks
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.
Summary
First, handled the one outstanding unmerged PR (#9, "save useful posts") — it had no review comments, no general comments, and no reviews to fix, CI was green, and
mergeable_statewasclean, so it merged intomainwith no conflicts. Then continued Phase 1 with the next roadmap item: local user notes.ForumForge now lets the reader attach a private note to a username. Jot something about an author ("helpful with GPU driver issues", "check their sources on pricing") and see it again on every post by that author — and across every thread on that forum, since a note is about a person, not a single post.
Everything stays on-device (local-first, see
docs/PRIVACY.md): nothing the reader writes about anyone leaves the browser, and no new permissions are needed — notes reuse the existingstoragepermission.What changed
src/userNotes.ts(new) — aUserNotesstore over a@forumforge/storageCollection. Notes are scoped per forum origin (not per thread), so a note follows the author across threads but never leaks onto a like-named stranger on another site. Saving an empty/whitespace note deletes it. API:get/set/remove/notesFor/all.src/render.ts— each post gets a collapsed "Note" toggle plus a per-author editor pre-filled fromoptions.userNotes; posts whose author already has a note are flagged (data-has-note) with a non-color dot cue.renderThreadstays a pure view;setNoteStateis exported and shared by initial render and the panel's update so the two never drift.src/sidepanel.ts— loads the forum's notes, passes them to render, and a single delegated handler on the persistent output container toggles the editor and persists a note, then syncs every post by that author at once. The UI follows what storage actually reached — a failed write stays honest.public/sidepanel.html— note toggle, collapsible editor, and annotated-author cue styles.Docs synced in the same change:
ROADMAP.md, the canonicalInitial Plan.mdchecklist, and the extensionREADME.md.Roadmap (Phase 1)
Verification
pnpm -r typecheck— passes (core + parser + storage + extension)pnpm test— 113 tests pass (+19: user-note store incl. origin scoping & empty-note deletion, note rendering & per-author flag/sync)pnpm --filter @forumforge/extension build— bundlesdist/Intentionally not done
UserNotes.all()already returns notes most-recently-updated first to feed it, but those are later Phase 1 items, out of scope here.userNotes.ts).🤖 Generated with Claude Code
Generated by Claude Code