Skip to content

fix(popup): report split-tunneling state on the collapsed row - #117

Merged
dantraynor merged 1 commit into
mainfrom
assess-open-issues
Aug 27, 2026
Merged

fix(popup): report split-tunneling state on the collapsed row#117
dantraynor merged 1 commit into
mainfrom
assess-open-issues

Conversation

@dantraynor

@dantraynor dantraynor commented Aug 27, 2026

Copy link
Copy Markdown
Owner

What

The Split tunneling row rendered a toggle switch that only opened and closed the editor, with its state in a module-level variable that resets whenever the popup document is recreated — so reopening the popup showed an off-looking switch styled exactly like the Shields Up and MagicDNS preference toggles while the saved rules were still in force. It is now a disclosure row modelled on Exit Node: a summary value (Off, Bypass · 2 domains, Only · 1 domain) plus a chevron that rotates when expanded, with aria-expanded/aria-controls, refreshed both optimistically on save and from state in updateConnected. Only with an empty domain list is deliberately not reported as Off, since that combination routes nothing through the exit node.

Why

Closes #116

How to Test

  • Connect, pick an exit node, expand Split tunneling, add a domain and hit Save rules
  • Close and reopen the popup — the collapsed row reports Bypass · 1 domain instead of an off-looking switch
  • Clear the domains in Bypass mode and confirm the row reads Off; switch to Only with an empty list and confirm it reads Only · no domains
  • Click the row to expand and collapse; the chevron rotates and the editor follows

Checklist

  • Tested in Chrome
  • Tested in Firefox
  • Updated README if needed

Verification: pnpm typecheck clean, 571 unit tests pass (4 new in connected.test.ts), and the full e2e suite passes in Chrome (26 cases) and Firefox (20 cases). The split-tunneling e2e scenario now reopens the popup after saving to assert the row still reports the saved rules — the exact regression reported in the issue.

The Split tunneling row rendered a toggle switch that only opened and
closed the editor. Its state lived in a module-level variable that resets
every time the popup document is recreated, so reopening the popup showed
an off-looking switch styled exactly like the Shields Up and MagicDNS
preference toggles — while the saved rules were still in force.

Replace it with a disclosure row modelled on Exit Node: a summary value
plus a chevron that rotates when expanded, with aria-expanded and
aria-controls. The summary reports the saved rules ("Off",
"Bypass · 2 domains", "Only · 1 domain") and refreshes both optimistically
on save and from state in updateConnected.

"Only" with an empty domain list is deliberately not reported as "Off":
that combination routes nothing through the exit node, so calling it off
would trade one wrong state for another.

The e2e scenario now expands the row through a new expandDisclosureRow
helper and reopens the popup after saving to assert the row still reports
the saved rules.

Closes #116
@dantraynor
dantraynor marked this pull request as draft August 27, 2026 03:52
@dantraynor
dantraynor marked this pull request as ready for review August 27, 2026 19:47
@dantraynor
dantraynor merged commit e776f45 into main Aug 27, 2026
15 checks passed
@dantraynor
dantraynor deleted the assess-open-issues branch August 27, 2026 19:48
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.

Split tunneling UI shows the wrong state

1 participant