Skip to content

Commit 6f0bae1

Browse files
shivamhwpclaude
andcommitted
fix(web): a dismissed discovery warning ends when its cause changes
Dismissing cause A, then seeing B and A again, kept A hidden. A dismissal now covers one occurrence of a cause. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 6a824fe commit 6f0bae1

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎apps/web/src/components/device/DevicePanel.browser.test.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ describe("DevicePanel discovery warning", () => {
245245
.element(screen.getByText("iOS and Android lists on This Mac may be incomplete."))
246246
.toBeVisible();
247247

248+
currentState = withCause("second cause");
249+
await screen.rerender(devicePanel(threadA));
250+
await expect.element(screen.getByText(warning)).toBeVisible();
251+
248252
currentState = withCause("third cause");
249253
await screen.rerender(devicePanel(threadA));
250254
await expect.element(screen.getByText(warning)).toBeVisible();

‎apps/web/src/components/device/DevicePanel.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ function DeviceDiscoveryWarning(props: {
421421
const [retrying, setRetrying] = useState(false);
422422
const [dismissedCause, setDismissedCause] = useState<string | null>(null);
423423
const cause = `${props.incompletePlatforms.join()}\u0000${props.detail}`;
424+
// A dismissal hides one occurrence; a cause that returns later shows again.
425+
if (dismissedCause !== null && dismissedCause !== cause) setDismissedCause(null);
424426
if (dismissedCause === cause) return null;
425427
const platforms = props.incompletePlatforms.map((platform) =>
426428
platform === "ios" ? "iOS" : "Android",

0 commit comments

Comments
 (0)