Structural cleanup based on thermo-nuclear code quality review:
- Extract shared color-picker.css and color-popover.css from badges.css (611→85 lines)
- Extract shared lib/presets.js for preset CRUD used by popup and popover
- Unify dark mode to single applyDarkModeClass on <html>, removing 4 scattered functions
- Fix stale closure in startPostObserver, data-driven reload key check
- Remove dead exports, getHelpers wrapper, duplicated colorToHex
- Replace DOM expando properties with state array in popup.js
Net: -318 lines of duplication, no file over 401 lines.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add project housekeeping files and sync manifest version to 0.1.0.
Also stages previously untracked chat summaries and score-ratio docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
Rework card layout from flex to block flow for sidebar compatibility.
Add voting pill capsule with voted-state tinting (orange/purple),
rank badge watermark, custom rt-selected selection system replacing
Reddit/RES classes, density-responsive border radius, bold titles,
and comprehensive dark mode variants for all interactive states.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Move isDarkMode/getColorPrefix to settings.js as shared infra
- Add align-items: flex-start to #siteTable flex container
- Add width: 100% to .rt-card for flex-start compatibility
- Clarify scope: old.reddit.com only
Co-authored-by: Cursor <cursoragent@cursor.com>
saveSettings() writes all keys including 'enabled', which triggered
the storage.onChanged reload check even when enabled didn't actually
change. Compare oldValue vs newValue so the reload only fires when
the enabled state genuinely toggles.
Co-authored-by: Cursor <cursoragent@cursor.com>
shadcn/Radix badges use hover:bg-primary/80 to reduce opacity to 80%.
Apply the same pattern with opacity:0.8 for a subtle, clean hover.
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace filter:brightness(1.1) with an inset box-shadow overlay
that subtly darkens only the background without washing out text
or border colors. Matches how GitHub/Bootstrap handle label hover.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Add global color presets: save/apply/delete sets of {bg, border, text}
colors as reusable presets, shown as mini badges in their own colors.
- Popover: preset badges under preview with + to save, click to apply,
× on hover to delete.
- Popup: dedicated Color Presets section with same functionality,
applying to light subreddit badge colors.
- Storage: colorPresets array added to settings defaults.
- Fix badge hover: change brightness(0.9) to brightness(1.1) so hover
brightens (activates) instead of dimming.
Co-authored-by: Cursor <cursoragent@cursor.com>
position:fixed pinned the popover to the viewport layer, so scrolling
the page could never reveal off-screen content. Revert to absolute
positioning (scrolls with the page) and dynamically compute max-height
based on available viewport space so the popover fits and scrolls
internally when content exceeds the available area.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Switch popover from position:absolute to position:fixed to avoid
scroll-offset math and simplify viewport clamping.
- Add max-height + overflow-y:auto so the popover scrolls internally
instead of overflowing the viewport.
- Remove the reposition call after picker opens — this was causing
the popover to flash and jump when the picker changed its height.
- Improve edge clamping: if neither above nor below fits, clamp to
viewport bottom rather than flipping unpredictably.
- Remove the CSS arrow (::before) which was mispositioned when the
popover appeared above the badge or near edges.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Popover: call positionPopover() after opening the picker so the
popover flips above the badge if it would clip the viewport bottom.
- Popup: debounce saveFromControls() calls during picker drag (200ms)
to avoid dozens of storage writes per gesture.
Co-authored-by: Cursor <cursoragent@cursor.com>
Without this, new subreddit entries would not persist their color
overrides because _dirtyModes was never set when picking via the
custom color picker.
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace native color inputs with swatch divs wired to the shared
tabbed picker widget for global and per-subreddit color controls.
Co-authored-by: Cursor <cursoragent@cursor.com>
Address six gaps found during review:
- Fix subreddit name extraction bug (gear icon text in textContent)
- Prevent gear icon layout shift via absolute positioning
- Handle native color picker dialog in click-outside detection
- Make per-subreddit overrides mode-aware (light/dark)
- Replace badge hover opacity with filter: brightness
- Split popover logic into separate file
Co-authored-by: Cursor <cursoragent@cursor.com>
- Default subreddit badge background from transparent to opaque fill
(light: #fde8e0, dark: #3d2518) so page highlights don't bleed through
- Remove lingering "to" text node from tagline when subreddit is hidden
- Hide the <li> wrapping the comments link (not just the <a>) to
eliminate leftover whitespace in the flat-list
- Simplify popup: subreddit bg fields are now color pickers (no longer
need transparent text-input workaround)
Co-authored-by: Cursor <cursoragent@cursor.com>