mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
refactor(storage): trim comments to one line where they earn their place
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N3euXsz25sTybsGTcxCFfn
This commit is contained in:
3 files changed
+4
-12
No files matched your search
@@ -39,10 +39,7 @@ const ArchivedFilesContext = createContext<ArchivedFilesContextValue>({
|
||||
|
||||
export const useArchivedFilesContext = () => useContext(ArchivedFilesContext)
|
||||
|
||||
/**
|
||||
* Fetched once here rather than per row. Not gated on the bucket's versioning
|
||||
* state — a suspended bucket can still be retaining files.
|
||||
*/
|
||||
/** Not gated on the bucket's versioning state: a suspended bucket can still be retaining files. */
|
||||
export const ArchivedFilesProvider = ({ children }: PropsWithChildren) => {
|
||||
const { projectRef, selectedBucket } = useStorageExplorerStateSnapshot()
|
||||
const { showArchivedInline } = useStoragePreference(projectRef)
|
||||
|
||||
@@ -121,8 +121,7 @@ export const FileExplorerRow = ({
|
||||
|
||||
const onSelectFile = (columnIndex: number) => {
|
||||
if (isArchivedFile) {
|
||||
// Archived rows have no live object to preview, so collapse to this column
|
||||
// and let the archived pane take over.
|
||||
// No live object to preview, so let the archived pane take over.
|
||||
truncateToColumn(columnIndex)
|
||||
selectArchivedObject(archivedObjectId)
|
||||
return
|
||||
@@ -320,7 +319,6 @@ export const FileExplorerRow = ({
|
||||
isSelected && 'bg-selection',
|
||||
isPreviewed && 'bg-selection hover:bg-selection',
|
||||
item.status !== STORAGE_ROW_STATUS.LOADING && 'cursor-pointer',
|
||||
// Also drives the stripe color via `currentColor`.
|
||||
isArchived && 'text-foreground-lighter [&_p]:text-foreground-lighter',
|
||||
// Keyboard focus on the checkbox: ring the whole row
|
||||
'has-[:focus-visible]:outline-solid has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-[-2px] has-[:focus-visible]:outline-[var(--ring)]'
|
||||
@@ -422,8 +420,7 @@ export const FileExplorerRow = ({
|
||||
size={14}
|
||||
/>
|
||||
) : isArchived ? (
|
||||
// Archived rows have no checkbox or context menu, so without this
|
||||
// button they'd have nothing keyboard-reachable.
|
||||
// Archived rows drop the checkbox and menu, so this is their only focus target.
|
||||
isArchivedFile ? (
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -23,9 +23,7 @@ export const StorageExplorer = () => {
|
||||
return (
|
||||
<ArchivedFilesProvider>
|
||||
<div className="bg-studio flex h-full w-full flex-col">
|
||||
{/* The skeleton swap is silent, and a live region must be mounted before it changes.
|
||||
`aria-live` rather than `role="status"`: that role is how toasts announce
|
||||
themselves here, and tests wait on it to tell when an upload has finished. */}
|
||||
{/* `aria-live` rather than `role="status"`, which is how toasts announce here. */}
|
||||
<span aria-live="polite" aria-atomic="true" className="sr-only">
|
||||
{isBucketReady ? 'Bucket contents loaded' : 'Loading bucket contents'}
|
||||
</span>
|
||||
|
||||
Reference in new issue
Block a user