diff --git a/src/renderer/src/app-shell/TitlebarMainStrip.tsx b/src/renderer/src/app-shell/TitlebarMainStrip.tsx index 6ffcb316283..3f1b865ba9e 100644 --- a/src/renderer/src/app-shell/TitlebarMainStrip.tsx +++ b/src/renderer/src/app-shell/TitlebarMainStrip.tsx @@ -10,7 +10,6 @@ import { selectActiveTerminalChromeState } from './active-terminal-chrome-select import { hasCustomTitleBar } from './app-window-chrome' import type { AppChromeLayout } from './use-app-chrome-layout' import { RunActionButton } from '../components/run-actions/RunActionButton' -import { CloudWorkspaceNumberChip } from '../components/cloud-workspaces/CloudWorkspaceNumberChip' import { CloudWorkspaceOwnerChangedChip } from '../components/cloud-workspaces/CloudWorkspaceOwnerChangedChip' import { CloudWorkspacePeople } from '../components/cloud-workspaces/CloudWorkspacePeople' @@ -75,7 +74,6 @@ export function TitlebarMainStrip({ layout }: { layout: AppChromeLayout }): Reac <> - ) : null} {layout.workspaceChromeActive && !layout.creationLayoutActive && activeWorktreeId ? ( diff --git a/src/renderer/src/components/cloud-workspaces/CloudWorkspaceConfirmDialog.tsx b/src/renderer/src/components/cloud-workspaces/CloudWorkspaceConfirmDialog.tsx index e7dbff81b24..1b445e87ac5 100644 --- a/src/renderer/src/components/cloud-workspaces/CloudWorkspaceConfirmDialog.tsx +++ b/src/renderer/src/components/cloud-workspaces/CloudWorkspaceConfirmDialog.tsx @@ -203,7 +203,7 @@ export function CloudWorkspaceConfirmDialog({ {pending.kind === 'private' ? t('auto.components.cloudWorkspaces.makePrivate', 'Make private') : pending.kind === 'delete' - ? t('auto.components.sidebar.DeleteCloudWorkspace.delete', 'Delete workspace') + ? t('auto.components.sidebar.DeleteCloudWorkspace.delete', 'Delete') : pending.kind === 'archive' ? t('auto.components.cloudWorkspaces.archive', 'Archive') : busy diff --git a/src/renderer/src/components/cloud-workspaces/CloudWorkspaceNumberChip.fixture.tsx b/src/renderer/src/components/cloud-workspaces/CloudWorkspaceNumberChip.fixture.tsx deleted file mode 100644 index 52913938e71..00000000000 --- a/src/renderer/src/components/cloud-workspaces/CloudWorkspaceNumberChip.fixture.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { defineFixture } from '../../component-fixtures/component-fixture' -import { CloudWorkspaceNumberChip } from './CloudWorkspaceNumberChip' -import { refreshCloudWorktreeBindings, rememberCloudWorkspaces } from './cloud-workspace-identity' -import { workspace } from './cloud-workspaces.test-fixture' - -const WORKTREE = 'repo-1::/vercel/orca/workspaces/app/fix-login' -const SANDBOX = 'sbx_00000000000000000000c197' - -async function seed(): Promise { - Object.assign(window.api.cloudWorkspaces, { - localWorkspaces: () => - Promise.resolve([{ sandboxId: SANDBOX, worktreeId: WORKTREE, runtimeEnvironmentId: null }]), - environmentBindings: () => Promise.resolve({}), - get: () => Promise.resolve({ ok: false as const, error: 'not_found' }) - }) - // The headless frame has no clipboard permission; the chip only needs the write to succeed. - Object.defineProperty(navigator, 'clipboard', { - configurable: true, - value: { writeText: () => Promise.resolve() } - }) - rememberCloudWorkspaces([ - workspace({ id: SANDBOX, number: 197, link: 'orca://cloud/acme/W-197', title: 'Fix login' }) - ]) - await refreshCloudWorktreeBindings() -} - -async function chip(frame: HTMLElement): Promise { - await seed() - const deadline = performance.now() + 2000 - let button = frame.querySelector('button') - while (!button && performance.now() < deadline) { - await new Promise((resolve) => setTimeout(resolve, 25)) - button = frame.querySelector('button') - } - return button -} - -/** Shown beside Run in the workspace's tab bar: link glyph + W-number, muted at rest. */ -export const atRest = defineFixture({ - width: 160, - render: () => ( -
- -
- ), - interact: async (frame) => { - await chip(frame) - } -}) - -/** Keyboard focus shows the ring and the "Copy link to W-197" tooltip. */ -export const focused = defineFixture({ - width: 260, - render: () => ( -
- -
- ), - interact: async (frame) => { - ;(await chip(frame))?.focus() - await new Promise((resolve) => setTimeout(resolve, 400)) - } -}) - -/** After a click: check glyph, same width, "Link copied" in the tooltip for about 1.5 s. */ -export const copied = defineFixture({ - width: 260, - render: () => ( -
- -
- ), - interact: async (frame) => { - ;(await chip(frame))?.click() - await new Promise((resolve) => setTimeout(resolve, 150)) - } -}) diff --git a/src/renderer/src/components/cloud-workspaces/CloudWorkspaceNumberChip.tsx b/src/renderer/src/components/cloud-workspaces/CloudWorkspaceNumberChip.tsx deleted file mode 100644 index 92a74dfce0e..00000000000 --- a/src/renderer/src/components/cloud-workspaces/CloudWorkspaceNumberChip.tsx +++ /dev/null @@ -1,100 +0,0 @@ -// W-123 in the top bar when the workspace in front is a cloud workspace; click copies its link -// (the same as ⌘⌥⇧L) and confirms in place; the tooltip says who the link is for. Renders nothing for local workspaces or before the -// number is known. -import React, { useEffect, useState } from 'react' -import { Check, Link2 } from 'lucide-react' -import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' -import { formatOptionalPrimaryShortcutLabel } from '@/hooks/useShortcutLabel' -import { useTranslate } from '@/i18n/use-translate' -import { cn } from '@/lib/class-names' -import { useAppStore } from '@/store' -import { formatWorkspaceNumber } from '../../../../shared/cloud-workspaces/cloud-workspaces-wire' -import { sandboxIdForWorktree, useCloudWorkspaceIdentities } from './cloud-workspace-identity' -import { copyCloudWorkspaceLink } from './open-cloud-workspace' - -const COPIED_MS = 1_500 - -export function CloudWorkspaceNumberChip({ - worktreeId -}: { - worktreeId: string -}): React.JSX.Element | null { - const t = useTranslate() - const hostId = useAppStore((s) => s.activeWorkspaceExecutionHostId) - const keybindings = useAppStore((s) => s.keybindings) - const identities = useCloudWorkspaceIdentities() - const [copied, setCopied] = useState(false) - // Hover/focus opens the tooltip; a copy holds it open to confirm, so the chip never changes width. - const [tipOpen, setTipOpen] = useState(false) - useEffect(() => { - if (!copied) { - return - } - const timer = setTimeout(() => setCopied(false), COPIED_MS) - return () => clearTimeout(timer) - }, [copied]) - const sandboxId = sandboxIdForWorktree({ id: worktreeId, hostId }, identities) - const number = sandboxId ? (identities.bySandbox.get(sandboxId)?.number ?? null) : null - if (!sandboxId || !number) { - return null - } - const label = formatWorkspaceNumber(number) - const shortcut = formatOptionalPrimaryShortcutLabel('cloudWorkspace.copyLink', keybindings) - const copiedLabel = t('auto.components.cloudWorkspaces.linkCopiedShort', 'Link copied') - const hint = t( - 'auto.components.cloudWorkspaces.copyLinkHint', - 'Teammates with access can open this workspace' - ) - return ( - <> - - - - - - {copied ? ( - copiedLabel - ) : ( - <> -
- {t('auto.components.cloudWorkspaces.copyLinkTo', 'Copy link to {{number}}', { - number: label - })} - {shortcut ? {shortcut} : null} -
- {/* Says what the link is for: the W-number alone didn't (N-05 follow-up). */} -
{hint}
- - )} -
-
- - {copied ? copiedLabel : ''} - - - ) -} diff --git a/src/renderer/src/components/cloud-workspaces/cloud-workspace-links.ts b/src/renderer/src/components/cloud-workspaces/cloud-workspace-links.ts index 529fdf24323..36d0b9a22b2 100644 --- a/src/renderer/src/components/cloud-workspaces/cloud-workspace-links.ts +++ b/src/renderer/src/components/cloud-workspaces/cloud-workspace-links.ts @@ -53,7 +53,7 @@ type Front = { let front: Front = null /** - * ⌘⌥⇧L: the workspace's own link (its W-number), like the tab-bar chip and the cloud workspace + * ⌘⌥⇧L: the workspace's own link (its W-number), like the cloud workspace * list's "Copy link to W-n". A link to the focused chat or terminal is a separate menu item, never the shortcut. */ export function copyShortcutLink(sandboxId: string): Promise { diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteCloudWorkspaceParts.tsx b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteCloudWorkspaceParts.tsx index 5ab594a2061..3944ea1971c 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteCloudWorkspaceParts.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteCloudWorkspaceParts.tsx @@ -166,18 +166,18 @@ export function DeleteCloudWorkspaceFooter({ ) } -/** "Archive instead": close the dialog and run the ordinary archive (Sleep, snapshot, Undo toast). */ +/** "Archive": close the dialog and run the ordinary archive (Sleep, snapshot, Undo toast). */ export function archiveInsteadOfDelete( worktree: { id: string; displayName?: string }, closeModal: () => void diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeDialog.fixture.tsx b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeDialog.fixture.tsx index e9f5d2f5e71..221e81c2a54 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeDialog.fixture.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeDialog.fixture.tsx @@ -109,7 +109,7 @@ export const cloudWorkspaceArchiveTooltip = defineFixture({ interact: () => focusWhenShown(() => [...document.querySelectorAll('[role="dialog"] button')].find((button) => - button.textContent?.includes('Archive instead') + button.textContent?.trim() === 'Archive' ) ) }) diff --git a/src/renderer/src/components/tab-group/TabGroupPanel.tsx b/src/renderer/src/components/tab-group/TabGroupPanel.tsx index 64034b6ed16..671f810f287 100644 --- a/src/renderer/src/components/tab-group/TabGroupPanel.tsx +++ b/src/renderer/src/components/tab-group/TabGroupPanel.tsx @@ -26,7 +26,6 @@ import { UNFOCUSED_SPLIT_GROUP_OPACITY } from './split-group-dim' import { useWindowBackdropActive } from '@/app-shell/appearance/window-backdrop' import { EditorRevealFlash } from './EditorRevealFlash' import { SplitPaneLanding } from './SplitPaneLanding' -import { CloudWorkspaceNumberChip } from '../cloud-workspaces/CloudWorkspaceNumberChip' import { CloudWorkspaceOwnerChangedChip } from '../cloud-workspaces/CloudWorkspaceOwnerChangedChip' import { CloudWorkspacePeople } from '../cloud-workspaces/CloudWorkspacePeople' import { CloudGitSetupStrip } from '../orca-cloud/CloudGitSetupStrip' @@ -320,7 +319,6 @@ export default function TabGroupPanel({ <> - ) : null} {!hasSplitGroups || isFocused ? : null} diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index adeab671f03..a8cb23cd366 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -8460,8 +8460,8 @@ "DeleteCloudWorkspace": { "title": "Delete {{name}}?", "cancel": "Cancel", - "archiveInstead": "Archive instead", - "delete": "Delete workspace", + "archiveInstead": "Archive", + "delete": "Delete", "uncommitted_one": "{{count}} uncommitted change", "uncommitted_other": "{{count}} uncommitted changes", "bodyNoSnapshot": "Deletes the sandbox and its disk, including chats, terminals and uncommitted changes. This can't be undone.", @@ -21335,9 +21335,7 @@ "errorSeatSandboxLimitOwner_one": "{{name}} already has {{count}} sandbox running. This workspace runs on their seat, so ask them to put it to sleep, then try again.", "errorSeatSandboxLimitOwner_other": "{{name}} already has {{count}} sandboxes running. This workspace runs on their seat, so ask them to put one to sleep, then try again.", "viewOwnerProfile": "View {{name}}'s profile", - "linkCopiedShort": "Link copied", "copyLinkTo": "Copy link to {{number}}", - "copyLinkHint": "Teammates with access can open this workspace", "linkNoAccess": "You don't have access to {{number}}.", "linkOtherTeam2": "{{number}} is in {{team}}.", "linkSwitchTeam": "Switch and open",