The best way to control Claude Code, Codex and more from any computer or phone
feat(web): copy the app version from General settings (#24788)
Utkarsh Patil committed
Oct 31, 2026 at 14:12 UTC
bfb44fbe6c1336825f3c0724e1f0f64ffcd1d4da
3 files changed
+70
-9
apps/web/src/components/settings/AboutVersionTitle.browser.test.tsx
new
+21
@@ -0,0 +1,21 @@
1
+import { expect, it, vi } from "vite-plus/test";
2
+import { page } from "vite-plus/test/browser";
3
+
4
+import { render } from "../../../test/render";
5
+import { APP_VERSION } from "../../branding";
6
+import { AnchoredToastProvider } from "../ui/toast";
7
+import { AboutVersionTitle } from "./AboutVersionTitle";
8
+
9
+it("shows copy confirmation when the version is clicked without waiting for a hover tooltip", async () => {
10
+ await using screen = await render(
11
+ <AnchoredToastProvider>
12
+ <AboutVersionTitle />
13
+ </AnchoredToastProvider>,
14
+ );
15
+ using write = vi.spyOn(navigator.clipboard, "writeText").mockResolvedValue(undefined);
16
+
17
+ await screen.getByRole("button", { name: `Copy version ${APP_VERSION}` }).click();
18
+
19
+ expect(write).toHaveBeenCalledWith(APP_VERSION);
20
+ await expect.element(page.getByText(/^Copied!?$/)).toBeVisible();
21
+});
apps/web/src/components/settings/AboutVersionTitle.tsx
new
+48
@@ -0,0 +1,48 @@
1
+import { useRef } from "react";
2
+
3
+import { APP_VERSION } from "../../branding";
4
+import { useCopyToClipboard } from "../../hooks/useCopyToClipboard";
5
+import { showAnchoredCopySuccessToast } from "../ui/anchoredCopyToast";
6
+import { InlineButton } from "../ui/button";
7
+import { stackedThreadToast, toastManager } from "../ui/toast";
8
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
9
+
10
+export function AboutVersionTitle() {
11
+ const copyButtonRef = useRef<HTMLButtonElement>(null);
12
+ const { copyToClipboard } = useCopyToClipboard<void>({
13
+ target: "version",
14
+ onCopy: () => showAnchoredCopySuccessToast(copyButtonRef),
15
+ onError: (error) => {
16
+ toastManager.add(
17
+ stackedThreadToast({
18
+ type: "error",
19
+ title: "Could not copy version",
20
+ description: error.message,
21
+ }),
22
+ );
23
+ },
24
+ });
25
+
26
+ return (
27
+ <span className="inline-flex items-baseline gap-2">
28
+ <span>Version</span>
29
+ <code className="text-2xs font-medium">
30
+ <Tooltip>
31
+ <TooltipTrigger
32
+ render={
33
+ <InlineButton
34
+ ref={copyButtonRef}
35
+ tone="muted"
36
+ aria-label={`Copy version ${APP_VERSION}`}
37
+ onClick={() => copyToClipboard(APP_VERSION, undefined)}
38
+ >
39
+ {APP_VERSION}
40
+ </InlineButton>
41
+ }
42
+ />
43
+ <TooltipPopup>Copy version</TooltipPopup>
44
+ </Tooltip>
45
+ </code>
46
+ </span>
47
+ );
48
+}
apps/web/src/components/settings/SettingsPanels.tsx
+1
-9
@@ -26,6 +26,7 @@ import { createModelSelection } from "@t3tools/shared/model";
26
import * as Equal from "effect/Equal";
27
import * as Schema from "effect/Schema";
28
import { APP_VERSION, HOSTED_APP_CHANNEL, HOSTED_APP_CHANNEL_LABEL } from "../../branding";
29
+import { AboutVersionTitle } from "./AboutVersionTitle";
30
import { CliCommandSettingsRow } from "./CliCommandSettingsRow";
31
import { MobileAppSettingsRow } from "./MobileAppSettingsRow";
32
import {
@@ -140,15 +141,6 @@ const QUIT_CONFIRMATION_MODE_LABELS: Record<QuitConfirmationMode, string> = {
141
};
142
143
const DEFAULT_DRIVER_KIND = ProviderDriverKind.make("codex");
143
-function AboutVersionTitle() {
144
- return (
145
- <span className="inline-flex items-baseline gap-2">
146
- <span>Version</span>
147
- <code className="text-2xs font-medium text-muted-foreground">{APP_VERSION}</code>
148
- </span>
149
- );
150
-}
151
-
144
function AboutVersionSection() {
145
const updateState = useDesktopUpdateState();
146
const [switchChannel, setSwitchChannel] = useState<DesktopUpdateChannel | null>(null);