Skip to content

feat(extension): OP highlighting in the side panel (Phase 1)#7

Merged
erichuang1425 merged 2 commits into
mainfrom
claude/resume-development-xweomg
Jun 21, 2026
Merged

feat(extension): OP highlighting in the side panel (Phase 1)#7
erichuang1425 merged 2 commits into
mainfrom
claude/resume-development-xweomg

Conversation

@erichuang1425

Copy link
Copy Markdown
Owner

Summary

Continues Phase 1 with the next roadmap item after clean reading mode
(#6): OP highlighting.

The parser already detects each post's role (op / mod / admin) and follows
the OP through the whole thread, and render.ts already set a data-role
attribute plus a generic badge. But every role looked identical — the same grey
pill — and OP posts didn't stand out from the rest of the thread. This PR adds
the visual treatment that is the feature.

parser role detection ─▶ data-role on each post ─▶ readable badge + colored edge

What changed

  • src/render.ts — maps roles to readable badge text (OP / Mod /
    Admin) and drops the badge for the unmarked user default, so it's signal,
    not noise.
  • public/sidepanel.html — OP / mod / admin posts get a colored left edge
    and a faint background tint, plus a colored badge. The role is signaled by
    text as well as color, so the highlight doesn't rely on color alone.

No new dependencies; no data-model or parser changes (role detection already
landed in #3).

Roadmap (Phase 1)

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

Docs synced in the same change: ROADMAP.md, the canonical Initial Plan.md
checklist, and the app README.md.

Verification

  • pnpm -r typecheck — passes (core + parser + storage + extension)
  • pnpm test76 tests pass (1 new: highlighted roles get a readable
    badge, user posts get none)
  • pnpm --filter @forumforge/extension build — bundles dist/

Intentionally not done

  • Viewing the highlight in a real browser is a manual step (needs a
    browser); the render logic is unit-tested against a DOM and the styling is
    plain CSS.
  • User-marked "helpful" / "unreliable" authors (from the plan's highlighting
    list) need the local-notes feature first, so they're a later Phase 1 follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WMZRs1b1oGfUuWrgzpStdm


Generated by Claude Code

Continue Phase 1 with the next roadmap item after clean reading mode. The
parser already detects each post's role (op/mod/admin), following the OP
through the whole thread, and render set a `data-role` attribute plus a
generic badge — but every role looked identical and OP posts didn't stand
out. This adds the visual treatment that is the feature:

- render.ts maps roles to readable badge text (OP / Mod / Admin) and drops
  the badge for the unmarked "user" default.
- sidepanel.html gives OP / mod / admin posts a colored left edge and a
  faint tint, plus a colored badge — signaled by text as well as color, so
  it doesn't rely on color alone.

Docs (ROADMAP, Initial Plan checklist, app README) updated to mark OP
highlighting done. render tests updated for the new badge text and a case
asserting "user" posts get no badge.

Verification: pnpm -r typecheck passes; pnpm test 76 pass (1 new);
pnpm --filter @forumforge/extension build bundles dist/.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WMZRs1b1oGfUuWrgzpStdm

@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: bb479db43c

ℹ️ 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 mod role badge used white 11px text on #16a34a (~3.3:1 contrast), below
the WCAG AA 4.5:1 threshold for small text. Since the badge text is the
non-color signal for OP highlighting, low-vision users could miss it. Use
green-700 (#15803d, ~5:1). OP (#2563eb) and admin (#9333ea) badges already
clear AA, so only the mod badge changes. Raised in PR review.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WMZRs1b1oGfUuWrgzpStdm
@erichuang1425 erichuang1425 merged commit 09ee0f2 into main Jun 21, 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