Skip to content

Commit ea5c788

Browse files
fix(web): say why clearing a profile did nothing
`clearProfileData` returned silently when no environment was connected, while the menu item stayed enabled — a dead control with no explanation. It now reports the same way `importInto` does for the same precondition. Also switches `browserImport` to the subpath namespace import the rest of `packages/contracts` uses. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent e6bf948 commit ea5c788

2 files changed

Lines changed: 25 additions & 13 deletions

File tree

apps/web/src/components/settings/IntegrationsSettings.tsx

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,17 @@ function BrowserProfilesSetting({ disabled }: { readonly disabled: boolean }) {
568568
};
569569

570570
const clearProfileData = (id: string, name: string) => {
571-
if (!environmentId || !previewBridge) return;
571+
// Reported rather than ignored: the menu item stays enabled in this
572+
// window, so bailing silently reads as a dead control. Matches what
573+
// `importInto` says for the same precondition.
574+
if (!environmentId || !previewBridge) {
575+
toastManager.add({
576+
type: "error",
577+
title: `Could not clear ${name}'s data`,
578+
description: "No environment is connected yet.",
579+
});
580+
return;
581+
}
572582
void Promise.all([
573583
previewBridge.clearCookies(environmentId, id),
574584
previewBridge.clearCache(environmentId, id),
@@ -761,17 +771,11 @@ function BrowserProfilesSetting({ disabled }: { readonly disabled: boolean }) {
761771
}
762772
>
763773
{/*
764-
Dimmed as a whole when the section is unavailable. The built-in rows
765-
are a plain span and a badge rather than `h3`/`p` or disabled controls,
766-
so the block's own dimming does not reach them and they would be the
767-
only full-contrast content inside "only available in the desktop app".
774+
The bordered container groups rows unambiguously at any width, and
775+
carries the bottom spacing `SettingsRow` leaves to its children
776+
(`pt-3 pb-1`).
768777
*/}
769-
<div
770-
className={cn(
771-
"mt-2 overflow-hidden rounded-lg border border-border/60",
772-
disabled && "opacity-64",
773-
)}
774-
>
778+
<div className="mt-2 mb-2 overflow-hidden rounded-lg border border-border/60">
775779
{listedProfiles.map((profile, index) => {
776780
const builtIn = isBuiltInBrowserProfileId(profile.id);
777781
const isDefault = profile.id === resolvedDefaultId;
@@ -785,7 +789,15 @@ function BrowserProfilesSetting({ disabled }: { readonly disabled: boolean }) {
785789
>
786790
<span className="flex min-w-0 flex-1 items-center gap-2">
787791
{builtIn ? (
788-
<span className="truncate text-sm text-foreground">{profile.name}</span>
792+
// Dimmed here rather than on the table: a wrapper-level dim
793+
// stacks with the rename field's and the row menu button's
794+
// own, landing them near 0.41 while every other disabled
795+
// control in the block sits at 0.64.
796+
<span
797+
className={cn("truncate text-sm text-foreground", disabled && "opacity-64")}
798+
>
799+
{profile.name}
800+
</span>
789801
) : (
790802
<DraftInput
791803
nativeInput

packages/contracts/src/browserImport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @module BrowserImport
1414
*/
15-
import { Schema } from "effect";
15+
import * as Schema from "effect/Schema";
1616
import { TrimmedNonEmptyString } from "./baseSchemas.ts";
1717
import { BrowserProfileId } from "./browserProfile.ts";
1818

0 commit comments

Comments
 (0)