feat(desktop): partition preview browsers by profile

Groundwork for browser profiles: each profile maps to its own Electron
session partition, so a tab opened under one profile cannot see another's
cookies.

Two profiles are built in and synthesized rather than stored, so they cannot
be renamed away or deleted by hand-editing settings. Default keeps the bare
environment id the browser already used as its partition scope, so upgrading
does not strand existing logins in an orphaned partition. Incognito derives a
non-persistent partition, which Chromium discards with the process.

Incognito partitions omit the `persist:` prefix, so `will-attach-webview` —
which only prefix-checks — now recognises both shapes; without that, incognito
tabs would simply fail to attach.

Clearing cookies or cache takes an optional profile. It previously reached
every partition unconditionally, which under profiles would mean signing out
of every profile from any one tab.

Partition derivation stays in main. The attach gate only checks the partition
string's prefix, so a renderer-supplied partition could attach to a session
that never had the UA rewrite or permission handlers installed.

`navigate` and `reportStatus` rebuild the snapshot field by field rather than
spreading, so both carry the profile explicitly — otherwise a tab would move
to another partition on its first navigation. The regression test was checked
against a reverted fix to confirm it fails for that reason.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

feat(web): open preview tabs under a browser profile

Threads the tab's profile from the server snapshot down to the Chromium guest,
so a tab opened under one profile mounts against that profile's partition.

The webview-config atom is now keyed by environment *and* profile. `Atom.family`
keys on its argument, so the two are folded into one string rather than passed
as an object, which would allocate a fresh entry on every render.

Storage clearing in the three-dot menu names the tab's profile and scopes the
call to it. Previously it cleared every partition, which under profiles would
have signed the user out of every profile from any one tab.

A configured default pointing at a deleted profile falls back to Default
rather than opening tabs into a partition with nothing behind it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
3503088d88Julius Marminge committed on 9/2/2026, 9:34:14 PMparent28ddaf7
23 files changedLine totals unavailable