36 lines
2.1 KiB
Markdown
36 lines
2.1 KiB
Markdown
|
|
# Score Ratio Badge — Subagent-Driven Implementation
|
||
|
|
|
||
|
|
**Date:** 2026-08-27 15:04
|
||
|
|
**Task:** Implement the Score Ratio Badge feature using Subagent-Driven Development
|
||
|
|
|
||
|
|
## Changes Made
|
||
|
|
|
||
|
|
### Task 1: Settings infrastructure + popup toggle (`dfaca51`)
|
||
|
|
- Added `scoreRatio: true` to DEFAULTS in `lib/settings.js`
|
||
|
|
- Added "Score ratio badge" checkbox to `popup/popup.html` in Card Layout section
|
||
|
|
- Wired `populateControls`, `saveFromControls`, and change listener in `popup/popup.js`
|
||
|
|
|
||
|
|
### Task 2: Font Awesome solid subset + ratio badge CSS (`93931a8`)
|
||
|
|
- Downloaded FA 6.7.2 solid woff2 to `content/fonts/fontawesome/fa-solid-900.woff2` (sha256 verified)
|
||
|
|
- Created `content/styles/fontawesome-scoped.css` — scoped FA selectors under `.rt-badge--ratio`
|
||
|
|
- Created `content/styles/ratio.css` — temperature-colored badges using CSS custom properties, dark mode via `.rt-dark`, neutral state, hover override
|
||
|
|
- Added both CSS files to manifest
|
||
|
|
|
||
|
|
### Task 3: Core ratio module + main.js integration (`2db30fd`)
|
||
|
|
- Created `content/tweaks/ratio.js` — IIFE module with score parsing (title attr, k/m suffixes, bullet detection), comment count parsing, ratio computation, HSL hue mapping, badge DOM injection
|
||
|
|
- Wired into `main.js` at all 5 integration points (init, post observer, dark mode observer, storage reload trigger, settings update)
|
||
|
|
- Added `ratio.js` to manifest JS array
|
||
|
|
|
||
|
|
## Review Results
|
||
|
|
|
||
|
|
- All 3 per-task reviews: Spec ✅, Approved
|
||
|
|
- Final whole-branch review: Ready to merge (no Critical/Important issues blocking)
|
||
|
|
- Minor findings noted: `data-rt-ratio-processed` set before insertion confirm, observer dependency on badgeLayout/cardLayout (accepted), accessibility context on badges
|
||
|
|
|
||
|
|
## Follow-up Items
|
||
|
|
|
||
|
|
- Consider `title` attribute on badges for tooltip/accessibility (e.g. "Score per comment: 12.7")
|
||
|
|
- Dark mode edge case: score-ratio-only mode (both layouts off) won't get `.rt-dark` class — document as unsupported or add shared dark-mode helper
|
||
|
|
- Move `data-rt-ratio-processed` to after successful insertion for minor hardening
|
||
|
|
- Doc naming drift: spec file is `vote-ratio-badge-design.md` but feature is "score ratio"
|