From 53e0e57ffee0afbcbc3a6883d00a9aed57f12e7d Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Oct 2026 13:46:41 +0000 Subject: [PATCH] fix(storage): keep the preview panel's URL button and row handles as they were MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The redesign renamed the panel's "Get URL" button to "Copy URL" while the row context menu kept "Get URL", leaving one action with two names, and gave the panel's file name a `title` — the attribute the explorer rows use as their handle, so `getByTitle` matched two elements once a preview was open. Also snap five off-token sizes to the scale the ratchet enforces, and point the E2E delete helper at the confirmation's real label now that it says what it does instead of ConfirmationModal's "Submit" default. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01N3euXsz25sTybsGTcxCFfn --- .../Storage/StorageExplorer/PreviewPane.tsx | 12 ++++++------ .../Storage/StorageExplorer/VersionCompareWidget.tsx | 4 ++-- .../StorageExplorer/VersionHistoryPolicyRow.tsx | 6 ++---- .../Storage/StorageExplorer/VersionThumbnail.tsx | 2 +- e2e/studio/utils/storage-helpers.ts | 5 +++-- knip.jsonc | 6 ------ 6 files changed, 14 insertions(+), 21 deletions(-) diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/PreviewPane.tsx b/apps/studio/components/interfaces/Storage/StorageExplorer/PreviewPane.tsx index 9aab438c033..181df2a5022 100644 --- a/apps/studio/components/interfaces/Storage/StorageExplorer/PreviewPane.tsx +++ b/apps/studio/components/interfaces/Storage/StorageExplorer/PreviewPane.tsx @@ -99,9 +99,9 @@ const CurrentFilePreview = ({
-

- {file.name} -

+ {/* No `title`: the explorer rows use it as their handle, and a second + element carrying the same one makes `getByTitle` ambiguous. */} +

{file.name}

{mimeType} {size && <>, {size}} @@ -137,7 +137,7 @@ const CurrentFilePreview = ({ disabled={file.isCorrupted} onClick={() => onCopyUrl(file.path!)} > - Copy URL + Get URL ) : ( @@ -148,9 +148,9 @@ const CurrentFilePreview = ({ icon={} iconRight={} disabled={file.isCorrupted} - aria-label={`Copy URL for ${file.name}`} + aria-label={`Get URL for ${file.name}`} > - Copy URL + Get URL diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/VersionCompareWidget.tsx b/apps/studio/components/interfaces/Storage/StorageExplorer/VersionCompareWidget.tsx index a1f5eb3848c..68733b2d1ee 100644 --- a/apps/studio/components/interfaces/Storage/StorageExplorer/VersionCompareWidget.tsx +++ b/apps/studio/components/interfaces/Storage/StorageExplorer/VersionCompareWidget.tsx @@ -52,7 +52,7 @@ export const VersionCompareWidget = ({ versionId={selectedVersion.versionId} />

-

+

{dayjs(selectedVersion.createdAt).format('MMM D')} · {formatBytes(selectedVersion.size)}

@@ -62,7 +62,7 @@ export const VersionCompareWidget = ({ {/* No `versionId`, so the endpoint resolves the current version. */} -

+

Current{currentVersion && <> · {formatBytes(currentVersion.size)}}

diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/VersionHistoryPolicyRow.tsx b/apps/studio/components/interfaces/Storage/StorageExplorer/VersionHistoryPolicyRow.tsx index 0cca5f5c9a9..c9ad9b0ca23 100644 --- a/apps/studio/components/interfaces/Storage/StorageExplorer/VersionHistoryPolicyRow.tsx +++ b/apps/studio/components/interfaces/Storage/StorageExplorer/VersionHistoryPolicyRow.tsx @@ -5,7 +5,7 @@ import { Button, cn, HoverCard, HoverCardContent, HoverCardTrigger } from 'ui' import { BroomSparklesIcon } from '../BroomSparklesIcon' import type { ExpirationMode } from '../StorageVersioning.constants' -const POLICY_CHIP_CLASSNAME = 'rounded-sm border px-1.5 py-0.5 font-mono text-[10.5px]' +const POLICY_CHIP_CLASSNAME = 'rounded-sm border px-1.5 py-0.5 font-mono text-xs' const PolicyChip = ({ children }: { children: ReactNode }) => ( @@ -86,9 +86,7 @@ export const VersionHistoryPolicyRow = ({ {hasCap && {cap} noncurrent v. retained} {hasExpiryDays && !hasCap && ( - - — no retention cap - + — no retention cap )} diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/VersionThumbnail.tsx b/apps/studio/components/interfaces/Storage/StorageExplorer/VersionThumbnail.tsx index 54cf5c88fc1..b4d4c599b47 100644 --- a/apps/studio/components/interfaces/Storage/StorageExplorer/VersionThumbnail.tsx +++ b/apps/studio/components/interfaces/Storage/StorageExplorer/VersionThumbnail.tsx @@ -44,7 +44,7 @@ const ThumbnailImage = ({ return ( ) diff --git a/e2e/studio/utils/storage-helpers.ts b/e2e/studio/utils/storage-helpers.ts index b881b0ee08e..0c8d0cba046 100644 --- a/e2e/studio/utils/storage-helpers.ts +++ b/e2e/studio/utils/storage-helpers.ts @@ -202,8 +202,9 @@ export const deleteItem = async (page: Page, itemName: string) => { // Click delete option from context menu await page.getByRole('menuitem', { name: 'Delete' }).click() - // Confirm deletion in the modal - await page.getByRole('button', { name: 'Submit' }).click() + // Confirm deletion in the modal. The label says what it does rather than + // carrying ConfirmationModal's "Submit" default. + await page.getByRole('button', { name: 'Delete', exact: true }).click() // Wait for deletion to complete await page.waitForTimeout(1000) diff --git a/knip.jsonc b/knip.jsonc index 89373180d61..717c5fc0285 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -81,12 +81,6 @@ // alongside the rest of the Warehouse work so the values stay in one // place until the project-creation surface that consumes them lands. "components/interfaces/ProjectCreation/WarehouseFdwCustomImage.constants.ts": ["files"], - // Storage object versioning: the file preview panel that calls these - // lands in the next PR of the stack, which drops both entries. - "components/interfaces/Storage/BroomSparklesIcon.tsx": ["files"], - "data/storage/versioning/object-{purge,version-delete,version-restore}-mutation.ts": [ - "files", - ], }, // `vercel` is a globally installed CLI used by the `deploy:staging` script "ignoreBinaries": ["vercel"],