searching, nested folders are now displayed like files, with a smaller font for their parent-folder
Massimo Melina committed
Sep 19, 2024 at 15:29 UTC
22ae8570f5cce72956174519ea315b320423802f
1 file changed
+2
-2
frontend/src/BrowseFiles.ts
+2
-2
@@ -198,7 +198,7 @@ const Entry = ({ entry, midnight, separator }: EntryProps) => {
198
const { uri, isFolder, name, n } = entry
199
const { showFilter, selected, file_menu_on_link } = useSnapState()
200
const isLink = Boolean(entry.url)
201
- const containerName = n.slice(0, -name.length)
201
+ const containerName = n.slice(0, -name.length - (isFolder ? 1 : 0))
202
let className = isFolder ? 'folder' : 'file'
203
if (entry.cantOpen)
204
className += ' cant-open'
@@ -228,7 +228,7 @@ const Entry = ({ entry, midnight, separator }: EntryProps) => {
228
// we treat webpages as folders, with menu to comment
229
isFolder ? h(Fragment, {}, // internal navigation, use Link component
230
h(Link, { to: uri, reloadDocument: entry.web, onClick, ...ariaProps }, // without reloadDocument, once you enter the web page, the back button won't bring you back to the frontend
231
- ico, entry.n.slice(0, -1)), // don't use name, as we want to include whole path in case of search
231
+ ico, h('span', { className: 'container-folder' }, containerName), name), // don't use name, as we want to include whole path in case of search
232
// popup button is here to be able to detect link-wrapper:hover
233
file_menu_on_link && !showingButton && h('button', {
234
className: 'popup-menu-button',