From 252fccb9f1e10decf86b7ed84490fbc032df0ae8 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 25 Sep 2026 14:10:36 +0000 Subject: [PATCH] fix(storage): hide the empty folder placeholder from archived rows The live listing filters it out of every folder, but the archived overlay was rendering it as a file. It still rolls its folder up, so an archived empty folder stays visible rather than exposing the placeholder. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01N3euXsz25sTybsGTcxCFfn --- .../archivedOverlay.utils.test.ts | 18 ++++++++++++++++++ .../StorageExplorer/archivedOverlay.utils.ts | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/archivedOverlay.utils.test.ts b/apps/studio/components/interfaces/Storage/StorageExplorer/archivedOverlay.utils.test.ts index 593f26913e9..f53e336eede 100644 --- a/apps/studio/components/interfaces/Storage/StorageExplorer/archivedOverlay.utils.test.ts +++ b/apps/studio/components/interfaces/Storage/StorageExplorer/archivedOverlay.utils.test.ts @@ -110,6 +110,24 @@ describe('getArchivedOverlayItems', () => { expect(rows.map((r) => r.type)).toEqual([STORAGE_ROW_TYPES.FOLDER, STORAGE_ROW_TYPES.FILE]) }) + it('hides the empty folder placeholder, as the live listing does', () => { + expect(overlay(['matches'], [archived('matches/.emptyFolderPlaceholder')])).toEqual([]) + }) + + it('still shows the folder whose only archived object is the placeholder', () => { + const rows = overlay([], [archived('matches/.emptyFolderPlaceholder')]) + expect(rows.map((r) => r.name)).toEqual(['matches']) + expect(rows[0].type).toBe(STORAGE_ROW_TYPES.FOLDER) + }) + + it('still shows a folder that holds a real object beside the placeholder', () => { + const rows = overlay( + [], + [archived('matches/.emptyFolderPlaceholder'), archived('matches/final.png')] + ) + expect(rows.map((r) => r.name)).toEqual(['matches']) + }) + it('only descends one level at a time', () => { const rows = overlay([], [archived('a/b/c/d.png')]) expect(rows.map((r) => r.name)).toEqual(['a']) diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/archivedOverlay.utils.ts b/apps/studio/components/interfaces/Storage/StorageExplorer/archivedOverlay.utils.ts index 0510fd96808..0592b5a1535 100644 --- a/apps/studio/components/interfaces/Storage/StorageExplorer/archivedOverlay.utils.ts +++ b/apps/studio/components/interfaces/Storage/StorageExplorer/archivedOverlay.utils.ts @@ -1,5 +1,6 @@ import { STORAGE_ROW_STATUS, STORAGE_ROW_TYPES } from '../Storage.constants' import type { StorageItem } from '../Storage.types' +import { EMPTY_FOLDER_PLACEHOLDER_FILE_NAME } from './StorageExplorer.utils' import type { ArchivedObject } from '@/data/storage/versioning/archived-objects-query' const splitPath = (path: string): string[] => path.split('/').filter((segment) => segment !== '') @@ -40,6 +41,10 @@ export const getArchivedOverlayItems = ({ continue } + // Hidden as in the live listing. It still rolled the folder up above, so an archived + // empty folder stays visible and actionable rather than showing its placeholder. + if (nextSegment === EMPTY_FOLDER_PLACEHOLDER_FILE_NAME) continue + if (existingItemNames.has(nextSegment)) continue files.push({