Skip to content

feat(extension): local user notes (Phase 1)#10

Merged
erichuang1425 merged 2 commits into
mainfrom
claude/unmerged-prs-app-dev-9i3p0c
Jun 23, 2026
Merged

feat(extension): local user notes (Phase 1)#10
erichuang1425 merged 2 commits into
mainfrom
claude/unmerged-prs-app-dev-9i3p0c

Conversation

@erichuang1425

Copy link
Copy Markdown
Owner

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_state was clean, so it merged into main with 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 existing storage permission.

type a note ─▶ key by (origin, author) ─▶ persist ─▶ reflect on every post by that author

What changed

  • 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. 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 from options.userNotes; posts whose author already 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 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 canonical Initial Plan.md checklist, and the extension README.md.

Roadmap (Phase 1)

  • Clean reading mode
  • OP highlighting
  • New posts since last visit
  • Save comments
  • Local user notes ← this PR
  • Markdown export
  • Discourse adapter
  • Hacker News adapter

Verification

  • pnpm -r typecheck — passes (core + parser + storage + extension)
  • pnpm test113 tests pass (+19: user-note store incl. origin scoping & empty-note deletion, note rendering & per-author flag/sync)
  • pnpm --filter @forumforge/extension build — bundles dist/

Intentionally not done

  • A notes management / browse view and Markdown exportUserNotes.all() already returns notes most-recently-updated first to feed it, but those are later Phase 1 items, out of scope here.
  • Stable author identity beyond the visible display name — the generic phase can only key on the name shown on the page; a site adapter with a real author id could refine this later (documented in userNotes.ts).
  • Clicking through in a real browser is a manual step (needs a browser); the store, render, and wiring are unit-tested.

🤖 Generated with Claude Code


Generated by Claude Code

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

@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: 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".

Comment thread apps/extension/public/sidepanel.html
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
@erichuang1425 erichuang1425 merged commit acc975c into main Jun 23, 2026
1 check passed
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