feat(desktop): browser profiles for the preview browser - #7254
feat(desktop): browser profiles for the preview browser#7254juliusmarminge wants to merge 31 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
There was a problem hiding this comment.
Reviewed the web UI changes (RightPanelTabs, PreviewChromeRow/PreviewView, PreviewMoreMenu, IntegrationsSettings, menu.tsx) against the shared primitive contracts. Two consistency findings, both inline.
Posted via Macroscope — UI Consistency
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a cross-layer browser-profile capability that changes session partitioning, cookie/login isolation, storage deletion, and the default profile used for implicit preview opens. Its new configurable product default and sensitive browser-storage behavior warrant human review. You can add or adjust custom eligibility rules. Learn more. |
b7395b6 to
fe1bc48
Compare
fe1bc48 to
61d5a11
Compare
There was a problem hiding this comment.
Two findings in the changed web UI. The MenuSubTrigger icon treatment added in this revision fixes the alignment of the new Browser sub-trigger, but the selector it uses also matches the trailing chevron on the two existing icon-less sub-triggers and overrides their ms-auto.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding on the new profile badge in the preview chrome row: the truncate cap doesn't actually ellipsize because Badge is a flex container. Everything else in scope (the MenuSubTrigger icon-column fix, the MenuGroup/MenuGroupLabel wrapping in PreviewMoreMenu, the profile list rows reusing SettingsRow/ITEM_ROW_INNER_CLASSNAME/DraftInput/Button/AlertDialog, and the Select for the default profile) follows the existing primitives and settings conventions.
Posted via Macroscope — UI Consistency
0009cb1 to
1adce5c
Compare
1adce5c to
36b86ed
Compare
There was a problem hiding this comment.
One convention finding: the new browserProfile module (and its test) uses the consolidated import { Schema } from "effect" form instead of the subpath namespace import used by the rest of packages/contracts. Everything else in the diff (service interfaces on BrowserSession/PreviewManager, Schema.TaggedErrorClass errors with structural attributes, make/layer shape, dependency acquisition) matches the conventions.
Posted via Macroscope — Effect Service Conventions
The wrapper-level dim stacked with each control's own: the rename field and remove button composited to roughly 0.41 alpha while every other disabled control in the desktop-only block sits at 0.64. Only the built-in row's name and badge lack a disabled treatment, so the dim belongs there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Profile names are user-supplied and run to 48 characters. The Browser sub-menu rendered them bare inside an unbounded popup, so a long one widened it to fit-content and wrapped; it is now capped and truncated like the other name-bearing menus. The clear actions repeated the name their own group heading already shows, which drove the popup far past its width for no added information. The heading keeps the profile and the actions keep fixed-length labels. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bare rows stack on narrow viewports with a larger gap inside a row than between rows, so the remove button read as belonging to the profile below. Each profile is now a bounded row, and the list carries the bottom spacing `SettingsRow` leaves to its children. `MenuGroupLabel` renders a block box, so `text-overflow` on an inline span inside it never applied and a long profile name pushed the popup past its width. The truncation sits on the label itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A tab created before profiles existed carries no profile of its own and runs in the built-in `default` partition — the scope the browser used before profiles. It was labelled with, and cleared against, whatever profile is configured as the default now, so on a machine with a custom default the active tab's data was left untouched while another profile's was wiped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
580b003 to
1c96321
Compare
There was a problem hiding this comment.
Two UI-consistency findings in the changed web code; details inline.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit 2d10153. Configure here.
There was a problem hiding this comment.
One finding: the remove-profile tooltip that explains why removal is unavailable can never be shown, because its trigger is the disabled button itself.
Posted via Macroscope — UI Consistency

Adds profiles to the desktop preview browser so tabs can keep separate cookies and site data. This is the bottom of the remaining stack; the browser-access setting is already merged.
Default preserves existing login storage. Incognito uses an in-memory partition. Other profiles use a separate partition namespace with unambiguous environment/profile scoping. A tab keeps its chosen profile for its lifetime.
Settings supports creating, renaming, choosing a default, and removing profiles. Removal waits for cookie/cache cleanup across all known environments and retains the profile if cleanup fails. Existing tabs remain open after removal and are labeled “Removed profile.” The Browser menu supports opening a chosen profile, including touch input.
Validation: focused profile, preview, settings-hydration, and partition-isolation tests; web/desktop typechecks; scoped formatting and lint. Latest CI results are shown below. Earlier desktop behavior was verified by the maintainer; this audit did not run another GUI pass.
Compatibility: Default partitions are unchanged. Data created in custom profiles by an earlier unmerged version of this stack is not migrated from the collision-prone partition mapping.
Original implementation: Claude Code. Review fixes: GPT-5.6 Sol agents, coordinated through Codex.
Note
Add browser profiles to the preview browser
BrowserProfilecontracts with built-indefaultandincognitoprofiles, and adds settings UI to create, rename, delete, and set the default profileBrowserSessionto support aprofilenamespace and ephemeral (in-memory) partitions for incognito mode, keeping legacy partitions disjointPreviewManagerand IPC handlers to passprofileIdthrough snapshots, config requests, and partition-scoped clearing operationsRightPanelTabsto open specific profiles via a submenu, and keyspreviewWebviewConfigAtomby(environmentId, profileId)DesktopPreviewBridge.clearCookies,clearCache, andgetPreviewConfignow require(environmentId, profileId?)instead of taking no arguments or justenvironmentIdMacroscope summarized fe5480b.
Note
Medium Risk
Touches Electron session partitions and cookie/cache clearing semantics; legacy Default scope is preserved but IPC and storage-isolation behavior changes need careful regression on login persistence and multi-profile clears.
Overview
Adds browser profiles so preview tabs can use separate cookies and site data, wired end-to-end from contracts through desktop Electron sessions to the web UI.
Partitioning (desktop): New
resolvePartitionScopekeeps the Default profile on the legacy bareenvironmentIdscope; other profiles use a JSON-encoded scope plus aprofile-partition namespace so scopes likea::bvs environmenta+ profilebstay distinct. Incognito uses non-persistent partitions.getPreviewConfig,clearCookies, andclearCachenow takeenvironmentIdand optionalprofileId; per-profile clears load the session first so data is actually removed after restart.BrowserSessionsupports targeted clears and recognizes ephemeral partition prefixes.Server & contracts: Preview sessions carry optional
profileId(fixed at tab open); the server manager preserves it across navigate and status updates. Client settings addbrowserProfilesandbrowserDefaultProfileId, with built-in Default/Incognito synthesized inresolveBrowserProfiles.Web UX: Integrations settings to create/rename/remove profiles (removal clears data across connected environments), pick a default (not incognito), profile submenu when adding a browser tab, profile badge and scoped clear actions in preview chrome, and default profile resolution on all open-preview paths. Breaking for bridge callers:
clearCookies/clearCache/getPreviewConfignow requireenvironmentId(and accept optionalprofileId).Reviewed by Cursor Bugbot for commit fe5480b. Bugbot is set up for automated code reviews on this repo. Configure here.