Add: greyed toolbar icon + "off" badge when enforcement is paused (spec 0010 FR-2a)#236
Merged
Merged
Conversation
…ec 0010 FR-2a) The badge already shows a per-tab scrub count, but a clean protected page and a page where the shield is paused look identical — an empty badge. So "am I protected on this tab?" can't be answered without opening the popup. Make the toolbar action reflect per-tab protection state. A tab is "off" when the global enforcement kill-switch is off (every tab) or the active tab's top-frame URL matches the per-site denylist (ADR-0018). On an off tab the action shows a greyed shield icon, an "off" badge in neutral grey (#6b7280 — not the amber detection color, so the three badge meanings stay distinct), and a tooltip naming the scope (all tabs vs this site). - New icons/icon-off.svg, rendered to toolbar-size PNGs by build-icons.ts. - New lib/toolbar-protection.ts holds the pure decision logic + appearance constants (unit-tested); background.ts owns the chrome.action side effects, a per-tab URL cache, and the enforcement/denylist subscriptions that drive repaints. Icon/tooltip are only re-issued when the on/off state flips; the count badge still refreshes on every rule-count message. - Spec 0010 FR-2a + user story + implementation pointer; install.md gains a "Reading the toolbar icon" guide. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The toolbar badge already shows a per-tab scrub count, but a clean protected page and a page where the shield is paused look identical — both show an empty badge. So "am I protected on this tab?" can't be answered without opening the popup. This adds the missing protection-off signal.
The toolbar action now reflects per-tab protection state. A tab is off when:
On an off tab the action shows:
icons/icon-off-*.png) — the primary signal,offbadge in neutral grey (#6b7280), deliberately not the amber detection color so the three badge meanings stay distinct (blue = count, amber = detection, grey = inactive),The signal recomputes when enforcement toggles, the denylist changes, or the tab navigates. The icon/tooltip are only re-issued when the on/off state flips; the count badge still refreshes on every rule-count message.
How
extension/icons/icon-off.svg— greyed shield, rendered to toolbar-size PNGs bybuild-icons.ts(generalized to render multiple sources). The blue icons are byte-identical (resvg is deterministic).extension/src/lib/toolbar-protection.ts(new) — purecomputeProtectionState/actionTitle/ appearance constants, fully unit-tested without a chrome mock.extension/src/background.ts— owns thechrome.actionside effects (applyProtectionAppearance,refreshAllTabs), a per-tab URL cache fed fromtabs.onUpdated/onActivated, and new enforcement + denylist subscriptions that repaint open tabs on a global state change.Spec / docs
specs/0010-extension-ui-and-controls.md: new FR-2a, user story, implementation pointer.docs/src/content/docs/install.md: new Reading the toolbar icon guide.Testing
bun run preflightgreen (biome + eslint, typecheck, knip, coverage above thresholds).bun run build— purity canary ok, off-icons copied intodist/.🤖 Generated with Claude Code