mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 03:45:06 +03:00
fix(storage): keep the preview panel's URL button and row handles as they were
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N3euXsz25sTybsGTcxCFfn
This commit is contained in:
1 parent
183d5f2114
commit
53e0e57ffe
6 files changed
+14
-21
No files matched your search
@@ -99,9 +99,9 @@ const CurrentFilePreview = ({
|
||||
|
||||
<div className="mt-2 flex flex-col">
|
||||
<div className="shrink">
|
||||
<p className="truncate text-sm font-medium text-foreground" title={file.name}>
|
||||
{file.name}
|
||||
</p>
|
||||
{/* No `title`: the explorer rows use it as their handle, and a second
|
||||
element carrying the same one makes `getByTitle` ambiguous. */}
|
||||
<p className="truncate text-sm font-medium text-foreground">{file.name}</p>
|
||||
<p className="mt-0.5 flex flex-wrap items-center gap-x-1.5 truncate text-xs text-foreground-light">
|
||||
{mimeType}
|
||||
{size && <>, {size}</>}
|
||||
@@ -137,7 +137,7 @@ const CurrentFilePreview = ({
|
||||
disabled={file.isCorrupted}
|
||||
onClick={() => onCopyUrl(file.path!)}
|
||||
>
|
||||
Copy URL
|
||||
Get URL
|
||||
</Button>
|
||||
) : (
|
||||
<DropdownMenu>
|
||||
@@ -148,9 +148,9 @@ const CurrentFilePreview = ({
|
||||
icon={<Copy size={14} />}
|
||||
iconRight={<ChevronDown size={14} />}
|
||||
disabled={file.isCorrupted}
|
||||
aria-label={`Copy URL for ${file.name}`}
|
||||
aria-label={`Get URL for ${file.name}`}
|
||||
>
|
||||
Copy URL
|
||||
Get URL
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
|
||||
@@ -52,7 +52,7 @@ export const VersionCompareWidget = ({
|
||||
versionId={selectedVersion.versionId}
|
||||
/>
|
||||
</div>
|
||||
<p className="truncate text-center font-mono text-[11px] text-brand">
|
||||
<p className="truncate text-center font-mono text-xs text-brand">
|
||||
{dayjs(selectedVersion.createdAt).format('MMM D')} · {formatBytes(selectedVersion.size)}
|
||||
</p>
|
||||
</div>
|
||||
@@ -62,7 +62,7 @@ export const VersionCompareWidget = ({
|
||||
{/* No `versionId`, so the endpoint resolves the current version. */}
|
||||
<FilePreview path={path} mimeType={mimeType} size={currentVersion?.size} />
|
||||
</div>
|
||||
<p className="truncate text-center font-mono text-[11px] text-foreground-lighter">
|
||||
<p className="truncate text-center font-mono text-xs text-foreground-lighter">
|
||||
Current{currentVersion && <> · {formatBytes(currentVersion.size)}</>}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
+2
-4
@@ -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 }) => (
|
||||
<span className={cn(POLICY_CHIP_CLASSNAME, 'border-strong bg-surface-300 text-foreground-light')}>
|
||||
@@ -86,9 +86,7 @@ export const VersionHistoryPolicyRow = ({
|
||||
{hasCap && <PolicyChip>{cap} noncurrent v. retained</PolicyChip>}
|
||||
</span>
|
||||
{hasExpiryDays && !hasCap && (
|
||||
<span className="font-mono text-[11px] text-foreground-lighter">
|
||||
— no retention cap
|
||||
</span>
|
||||
<span className="font-mono text-xs text-foreground-lighter">— no retention cap</span>
|
||||
)}
|
||||
<Info size={13} className="text-foreground-lighter" />
|
||||
</button>
|
||||
|
||||
@@ -44,7 +44,7 @@ const ThumbnailImage = ({
|
||||
return (
|
||||
<span
|
||||
role="presentation"
|
||||
className="h-full w-full rounded-[5px] bg-cover bg-center bg-no-repeat"
|
||||
className="h-full w-full rounded-sm bg-cover bg-center bg-no-repeat"
|
||||
style={{ backgroundImage: `url('${url}')` }}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"],
|
||||
|
||||
Reference in new issue
Block a user