From 9523e6e25d67dd9fc9cdb1adb8549f86dd3e5485 Mon Sep 17 00:00:00 2001 From: Jordan Paulino Date: Wed, 13 May 2026 18:20:09 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=95=20feat(highlight):=20refined=20mod?= =?UTF-8?q?es=20+=20single=20accent=20+=20selection=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the always-on, six-color, dashed-rainbow highlight pass with a restrained four-mode model that defaults to "selection only" — closer to Chrome DevTools' element inspector and a much friendlier baseline for content-heavy editorial pages. Why --- On a typical New York Magazine page, the previous highlighter painted every component all the time, in dashed pink/yellow/teal, with width varying by sibling order. The result on a busy page was visually overwhelming — three nested components share an edge and you get three parallel dashes within 6px, with no encoding of *importance*. The extension was strictly harder to read with than without. Modes ----- - off — no ambient outlines anywhere. Hover + selection still render so click-to-inspect remains visible. - selection — ambient off, only hovered/selected elements outlined. NEW DEFAULT. - editable — ambient outlines on [data-editable] only. Useful for editorial / PM workflows. - all — ambient outlines on every component. The "give me the bird's-eye view" mode. Visual language --------------- - Single accent color (tailwind blue-600). State is encoded with width + opacity, not hue: ambient → 1px @ 18% accent hover → 2px @ 70% accent selected → 2px @ 100% accent + top-left labelled badge - Solid outlines (was: dashed/dotted/double). Reads as inspection, not "draft/error". - The selection badge is a small pill anchored above the selected box rendering the component name from a new data-clay-slip-label attr. - Find-on-page match outline kept as emerald green so it remains a *different signal* from the regular accent. How mode gating works --------------------- The stylesheet keys ambient rules off `html[data-clay-slip-mode]`, so switching modes is one attribute write — no per-element walking, no restyle pass. `mode='off'` writes the attribute explicitly so we can add `[mode="off"]` rules later (e.g. for diagnostics) without code changes. Wiring ------ - HighlightMode type added to UserPreferences (default 'selection'). loadPreferences() merges over DEFAULT_PREFERENCES so existing users get the new default for free without a migration. - Store gains setHighlightMode + cycleHighlightMode actions; both persist to chrome.storage.sync. The boolean highlightEnabled state + toggleHighlights action are dropped — `mode === 'off'` covers it. - Header eye button replaced with a HighlightModeMenu (native
popover) showing the four modes + descriptions with a click-outside-to-close handler for free. - `h` keyboard shortcut now cycles modes. - Options page gains a Highlight mode update('highlightMode', e.target.value as HighlightMode)} + > + {HIGHLIGHT_MODE_ORDER.map((m) => ( + + ))} + + +