Soul fixes: a folder that empties keeps its Back row, blank titles get a label
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 4m1s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Void 2026-11-13 21:46:28 +00:00
commit b8eed50bd7
3 changed files with 7 additions and 3 deletions

View file

@ -131,7 +131,7 @@ export function AlbumView({ room, onTimeline }: AlbumViewProps) {
); );
} else if (encrypted) } else if (encrypted)
body = <Text>This zone is encrypted, so its albums cannot be listed here.</Text>; body = <Text>This zone is encrypted, so its albums cannot be listed here.</Text>;
else if (albums.length === 0) body = <Text>No albums yet.</Text>; else if (albums.length === 0 && path.length === 0) body = <Text>No albums yet.</Text>;
else { else {
const here = listFolder(albums, path); const here = listFolder(albums, path);
body = ( body = (

View file

@ -69,6 +69,10 @@ describe('listFolder', () => {
const odd = [album('$u', '///')]; const odd = [album('$u', '///')];
expect(names(listFolder(odd, []))).toEqual({ folders: [], albums: ['$u=///'] }); expect(names(listFolder(odd, []))).toEqual({ folders: [], albums: ['$u=///'] });
expect(names(listFolder(odd, ['x']))).toEqual({ folders: [], albums: [] }); expect(names(listFolder(odd, ['x']))).toEqual({ folders: [], albums: [] });
expect(names(listFolder([album('$w', ' ')], []))).toEqual({
folders: [],
albums: ['$w=Untitled album'],
});
}); });
it('server-supplied names like "constructor" are folders, not prototype hits', () => { it('server-supplied names like "constructor" are folders, not prototype hits', () => {

View file

@ -1,6 +1,6 @@
// Pure: folders are albums whose title is a `/`-separated path (docs/commons-files-desk.md, "Folders"). // Pure: folders are albums whose title is a `/`-separated path (docs/commons-files-desk.md, "Folders").
// No wire change: the album is still one thread root; the folder tree is only how the list is grouped. // No wire change: the album is still one thread root; the folder tree is only how the list is grouped.
import { Album } from './buildAlbums'; import { Album, UNTITLED } from './buildAlbums';
/** A path as segments. Empty segments and surrounding space drop out; `.` and `..` are ordinary names, never navigation. */ /** A path as segments. Empty segments and surrounding space drop out; `.` and `..` are ordinary names, never navigation. */
export const splitPath = (title: string): string[] => export const splitPath = (title: string): string[] =>
@ -36,7 +36,7 @@ export const listFolder = (albums: readonly Album[], at: string[]): FolderListin
const segs = splitPath(album.title); const segs = splitPath(album.title);
if (segs.length === 0) { if (segs.length === 0) {
// An untitled or all-slash title lives at the root under the title as written. // An untitled or all-slash title lives at the root under the title as written.
if (at.length === 0) direct.push({ album, leaf: album.title }); if (at.length === 0) direct.push({ album, leaf: album.title.trim() || UNTITLED });
return; return;
} }
if (!startsWith(segs, at)) return; if (!startsWith(segs, at)) return;