The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
fix(web): hiding a revealed email no longer flashes its placeholder (#38996)
Co-authored-by: DominikScholz <12826585+DominikScholz@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
tiliakoos committed
Nov 19, 2026 at 08:37 UTC
26b872b46a4dd7a96dd1aaab57bc5a4fb4cef25f
2 files changed
+48
-3
apps/web/src/components/settings/ProviderSettingsPanel.environment.browser.test.tsx
+28
@@ -483,6 +483,34 @@ describe("EnvironmentProviderSettings provider list", () => {
483
});
484
});
485
486
+describe("EnvironmentProviderSettings account email", () => {
487
+ it("keeps the real email until the hide blur finishes", async () => {
488
+ await setup();
489
+ const email = "developer@example.com";
490
+ await setProviders([{ ...provider(), auth: { status: "authenticated", email } }]);
491
+ await using _screen = await render(panel({ targetInstanceId: codexId }));
492
+ const toggle = page.getByRole("button", { name: "Toggle account email visibility" });
493
+ const button = toggle.element() as HTMLButtonElement;
494
+
495
+ await act(() => button.click());
496
+ for (const animation of button.getAnimations()) animation.finish();
497
+ await expect.element(toggle).toHaveTextContent(email);
498
+
499
+ await act(() => button.click());
500
+ const blur = button
501
+ .getAnimations()
502
+ .find(
503
+ (animation) =>
504
+ animation instanceof CSSTransition && animation.transitionProperty === "filter",
505
+ )!;
506
+ blur.pause();
507
+ expect(button.textContent).toBe(email);
508
+
509
+ await act(() => blur.finish());
510
+ await expect.element(toggle).not.toHaveTextContent(email);
511
+ });
512
+});
513
+
514
describe("EnvironmentProviderSettings instance removal", () => {
515
it("resets a configured default instance only once the user confirms", async () => {
516
await setup();
apps/web/src/components/settings/RedactedSensitiveText.tsx
+20
-3
@@ -1,4 +1,5 @@
1
import { useState } from "react";
2
+import { flushSync } from "react-dom";
3
4
import { cn } from "../../lib/utils";
5
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
@@ -31,7 +32,8 @@ export function RedactedSensitiveText(props: {
32
readonly hideTooltip: string;
33
readonly className?: string;
34
}) {
34
- const [revealed, setRevealed] = useState(false);
35
+ const [visibility, setVisibility] = useState<"hidden" | "hiding" | "revealed">("hidden");
36
+ const revealed = visibility === "revealed";
37
const value = props.value?.trim();
38
const redacted = value ? redactedPlaceholder(value) : "";
39
@@ -48,10 +50,25 @@ export function RedactedSensitiveText(props: {
50
revealed ? "text-muted-foreground" : "select-none text-muted-foreground blur-xs",
51
props.className,
52
)}
51
- onClick={() => setRevealed((current) => !current)}
53
+ onClick={(event) => {
54
+ if (!revealed) return setVisibility("revealed");
55
+ const button = event.currentTarget;
56
+ flushSync(() => setVisibility("hiding"));
57
+ const finishHiding = () =>
58
+ setVisibility((current) => (current === "hiding" ? "hidden" : current));
59
+ const blur = button
60
+ .getAnimations()
61
+ .find(
62
+ (animation) =>
63
+ animation instanceof CSSTransition && animation.transitionProperty === "filter",
64
+ );
65
+ // Theme changes suppress the transition; a reversed one settles once revealed.
66
+ if (blur) void blur.finished.then(finishHiding, finishHiding);
67
+ else finishHiding();
68
+ }}
69
aria-label={props.ariaLabel}
70
>
54
- {revealed ? value : redacted}
71
+ {visibility === "hidden" ? redacted : value}
72
</button>
73
}
74
/>