From 8bd4a9c9945337c38a1f10f980cfd38c9aa9c4d7 Mon Sep 17 00:00:00 2001 From: allison-truhlar Date: Mon, 6 Oct 2025 14:10:01 -0400 Subject: [PATCH 1/2] fix: switch order of conditionals to check zarr v3 first --- src/hooks/useZarrMetadata.ts | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/hooks/useZarrMetadata.ts b/src/hooks/useZarrMetadata.ts index 6654dedf..49b584f7 100644 --- a/src/hooks/useZarrMetadata.ts +++ b/src/hooks/useZarrMetadata.ts @@ -156,44 +156,44 @@ export default function useZarrMetadata() { fileBrowserState.currentFileOrFolder.path ); - const zarrayFile = getFile('.zarray'); - if (zarrayFile) { - await checkZarrArray(imageUrl, 2, signal); - } else { - const zattrsFile = getFile('.zattrs'); - if (zattrsFile) { - const attrs = (await fetchFileAsJson( - fileBrowserState.currentFileSharePath.name, - zattrsFile.path, - cookies - )) as any; - if (signal.aborted) { - return; - } - if (attrs.multiscales) { - await checkOmeZarrMetadata(imageUrl, 2, signal); + const zarrJsonFile = getFile('zarr.json'); + if (zarrJsonFile) { + const attrs = (await fetchFileAsJson( + fileBrowserState.currentFileSharePath.name, + zarrJsonFile.path, + cookies + )) as any; + if (signal.aborted) { + return; + } + if (attrs.node_type === 'array') { + await checkZarrArray(imageUrl, 3, signal); + } else if (attrs.node_type === 'group') { + if (attrs.attributes?.ome?.multiscales) { + await checkOmeZarrMetadata(imageUrl, 3, signal); + } else { + log.info('Zarrv3 group has no multiscales', attrs.attributes); } } else { - const zarrJsonFile = getFile('zarr.json'); - if (zarrJsonFile) { + log.warn('Unknown Zarrv3 node type', attrs.node_type); + } + } else { + const zarrayFile = getFile('.zarray'); + if (zarrayFile) { + await checkZarrArray(imageUrl, 2, signal); + } else { + const zattrsFile = getFile('.zattrs'); + if (zattrsFile) { const attrs = (await fetchFileAsJson( fileBrowserState.currentFileSharePath.name, - zarrJsonFile.path, + zattrsFile.path, cookies )) as any; if (signal.aborted) { return; } - if (attrs.node_type === 'array') { - await checkZarrArray(imageUrl, 3, signal); - } else if (attrs.node_type === 'group') { - if (attrs.attributes?.ome?.multiscales) { - await checkOmeZarrMetadata(imageUrl, 3, signal); - } else { - log.info('Zarrv3 group has no multiscales', attrs.attributes); - } - } else { - log.warn('Unknown Zarrv3 node type', attrs.node_type); + if (attrs.multiscales) { + await checkOmeZarrMetadata(imageUrl, 2, signal); } } } From 34953beedf146ba7aaad0e6ba43f8ae639bc7e48 Mon Sep 17 00:00:00 2001 From: allison-truhlar Date: Mon, 6 Oct 2025 14:10:55 -0400 Subject: [PATCH 2/2] chore: linting --- README.md | 2 +- src/components/ui/Sidebar/FavoritesBrowser.tsx | 8 ++++---- src/components/ui/Sidebar/Sidebar.tsx | 12 ++++++------ src/components/ui/Sidebar/ZonesBrowser.tsx | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1a713564..43975483 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ See the [Fileglancer User Guide](https://janeliascicomp.github.io/fileglancer-us ## Software Architecture -Fileglancer is built on top of JuptyerHub, which provides the infrastructure for allowing users to login and interact directly with their files on mounted network file systems. JupyterHub runs a "single user server" for each user who logs in, in a process owned by that user. The Fileglancer plugin for JupyterHub replaces the UI with a new SPA webapp that connects back to a custom backend running inside the single user server. We also added a "central server" to serve shared data and to manage connections to a shared database for saving preferences, data links, and other persistent information. +Fileglancer is built on top of JuptyerHub, which provides the infrastructure for allowing users to login and interact directly with their files on mounted network file systems. JupyterHub runs a "single user server" for each user who logs in, in a process owned by that user. The Fileglancer plugin for JupyterHub replaces the UI with a new SPA webapp that connects back to a custom backend running inside the single user server. We also added a "central server" to serve shared data and to manage connections to a shared database for saving preferences, data links, and other persistent information. Fileglancer architecture diagram diff --git a/src/components/ui/Sidebar/FavoritesBrowser.tsx b/src/components/ui/Sidebar/FavoritesBrowser.tsx index b01522af..5456709c 100644 --- a/src/components/ui/Sidebar/FavoritesBrowser.tsx +++ b/src/components/ui/Sidebar/FavoritesBrowser.tsx @@ -88,27 +88,27 @@ export default function FavoritesBrowser({ return ( ); })} {/* File share path favorites */} {displayFileSharePaths.map((fsp, index) => { - return ; + return ; })} {/* Directory favorites */} {displayFolders.map(folderFavorite => { return ( ); })} diff --git a/src/components/ui/Sidebar/Sidebar.tsx b/src/components/ui/Sidebar/Sidebar.tsx index c7248ea8..99f2d4e8 100644 --- a/src/components/ui/Sidebar/Sidebar.tsx +++ b/src/components/ui/Sidebar/Sidebar.tsx @@ -21,12 +21,12 @@ export default function Sidebar() {
) => handleSearchChange(e) } + placeholder="Type to filter zones" + type="search" + value={searchQuery} > @@ -34,10 +34,10 @@ export default function Sidebar() { {searchQuery ? ( diff --git a/src/components/ui/Sidebar/ZonesBrowser.tsx b/src/components/ui/Sidebar/ZonesBrowser.tsx index 0a6e87cd..0e807f56 100644 --- a/src/components/ui/Sidebar/ZonesBrowser.tsx +++ b/src/components/ui/Sidebar/ZonesBrowser.tsx @@ -70,9 +70,9 @@ export default function ZonesBrowser({ return ( ); }