Skip to content

Commit c930bd4

Browse files
fix(web): clear the partition a legacy tab actually runs in
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>
1 parent ee6fa72 commit c930bd4

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

apps/web/src/components/preview/PreviewView.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { scopedThreadKey } from "@t3tools/client-runtime/environment";
44
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
55
import {
6+
DEFAULT_BROWSER_PROFILE_ID,
67
FILL_PREVIEW_VIEWPORT,
78
type PreviewAnnotationPayload,
89
type PreviewViewportSetting,
@@ -146,10 +147,13 @@ export function PreviewView({
146147
const loadProgress = useLoadingProgress(loading);
147148
const viewport = snapshot?.viewport ?? FILL_PREVIEW_VIEWPORT;
148149
const browserDefaults = useBrowserDefaults();
149-
// A tab created before profiles existed carries no profile of its own, so it
150-
// runs in — and must clear — the configured default. Passing the snapshot's
151-
// raw `undefined` through would reach the IPC layer as "every profile".
152-
const activeProfileId = snapshot?.profileId ?? browserDefaults.profileId;
150+
// A tab created before profiles existed carries no profile of its own. It
151+
// runs in the built-in `default` partition — the scope the browser used
152+
// before profiles — not in whatever profile is configured as the default
153+
// now, so that is what its label names and its clear actions target.
154+
// Passing the snapshot's raw `undefined` through would reach the IPC layer
155+
// as "every profile".
156+
const activeProfileId = snapshot?.profileId ?? DEFAULT_BROWSER_PROFILE_ID;
153157
const activeProfile = browserDefaults.profiles.find((profile) => profile.id === activeProfileId);
154158
const panelRect = useBrowserSurfaceStore((state) =>
155159
runtimeTabId ? (state.byTabId[runtimeTabId]?.rect ?? null) : null,

0 commit comments

Comments
 (0)