Skip to content

Add: greyed toolbar icon + "off" badge when enforcement is paused (spec 0010 FR-2a)#236

Merged
twschiller merged 1 commit into
mainfrom
toolbar-protection-off-signal
Jun 9, 2026
Merged

Add: greyed toolbar icon + "off" badge when enforcement is paused (spec 0010 FR-2a)#236
twschiller merged 1 commit into
mainfrom
toolbar-protection-off-signal

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

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:

  • 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 (icons/icon-off-*.png) — the primary signal,
  • an off badge in neutral grey (#6b7280), deliberately not the amber detection color so the three badge meanings stay distinct (blue = count, amber = detection, grey = inactive),
  • a tooltip naming the scope: "enforcement off (all tabs)" vs "enforcement off on this site".

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 by build-icons.ts (generalized to render multiple sources). The blue icons are byte-identical (resvg is deterministic).
  • extension/src/lib/toolbar-protection.ts (new) — pure computeProtectionState / actionTitle / appearance constants, fully unit-tested without a chrome mock.
  • extension/src/background.ts — owns the chrome.action side effects (applyProtectionAppearance, refreshAllTabs), a per-tab URL cache fed from tabs.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

  • 13 new unit tests for the decision logic; full suite 2014 passing.
  • bun run preflight green (biome + eslint, typecheck, knip, coverage above thresholds).
  • bun run build — purity canary ok, off-icons copied into dist/.

🤖 Generated with Claude Code

…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>
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-browser-shield-demo-site Ready Ready Preview, Comment Jun 9, 2026 9:30pm

Request Review

@twschiller twschiller merged commit 4ceb004 into main Jun 9, 2026
7 checks passed
@twschiller twschiller deleted the toolbar-protection-off-signal branch June 9, 2026 21:39
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.

1 participant