From 7d98b04d63d0b6553b8285954239b13b2ef19af5 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Tue, 1 Dec 2026 01:09:12 +0100 Subject: [PATCH] feat(web): expand folders in place in the file browser Opening a folder replaced the root listing, so every step inward lost the way back and the tree above it. A folder now opens under its parent, nested folders open under theirs, and the root stays visible. Each folder is read again when it is expanded, so files a turn added or removed show up the next time the folder opens. The size column hides below 260px of list width, where the indent leaves no room for both a name and a size. --- web/app/assets/css/main.css | 80 +++++++++------- web/app/components/FilesPane.vue | 160 ++++++++++++++++++------------- 2 files changed, 139 insertions(+), 101 deletions(-) diff --git a/web/app/assets/css/main.css b/web/app/assets/css/main.css index b3075c8..5922ad9 100644 --- a/web/app/assets/css/main.css +++ b/web/app/assets/css/main.css @@ -1684,6 +1684,7 @@ body.pane-resizing * { min-height: 0; display: flex; flex-direction: column; + container-type: inline-size; } .files-resizer { @@ -1729,50 +1730,14 @@ body.files-resizing-y * { user-select: none !important; } -.crumbs { +.tree-head { flex: 0 0 auto; padding: var(--sp-2); border-bottom: 1px solid var(--border); - display: flex; - flex-direction: column; - gap: var(--sp-1); -} - -.crumbs-row { - display: flex; - align-items: center; - gap: var(--sp-1); - flex-wrap: wrap; - min-width: 0; font-size: var(--fs-small); color: var(--muted); } -.crumb { - border: 0; - background: transparent; - padding: 0; - color: var(--muted); - font-size: var(--fs-small); - line-height: var(--lh-body); - overflow-wrap: anywhere; - text-align: left; -} - -.crumb:hover { - color: var(--text); - text-decoration: underline; -} - -.crumb-back { - display: inline-flex; - align-items: center; - gap: var(--sp-1); - align-self: flex-start; - color: var(--muted); - font-size: var(--fs-small); -} - .file-list { flex: 1; min-height: 0; @@ -1787,6 +1752,7 @@ body.files-resizing-y * { align-items: center; gap: var(--sp-1); padding: var(--sp-1) var(--sp-2); + padding-left: calc(var(--sp-2) + var(--tree-depth, 0) * var(--sp-3)); border: 1px solid transparent; border-radius: var(--r-control); background: transparent; @@ -1817,6 +1783,42 @@ body.files-resizing-y * { font-size: var(--fs-small); } +.tree-caret { + flex: 0 0 auto; + color: var(--faint); + transition: transform 120ms ease; +} + +.tree-caret.open { + transform: rotate(90deg); +} + +.tree-caret-gap { + flex: 0 0 auto; + width: 14px; +} + +.tree-note { + margin: 0; + padding: var(--sp-1) var(--sp-2); + padding-left: calc(var(--sp-2) + var(--tree-depth, 0) * var(--sp-3) + var(--sp-6)); + color: var(--faint); + font-size: var(--fs-small); + line-height: var(--lh-body); +} + +.tree-note.error { + color: var(--danger); +} + +/* In a narrow list the name matters more than the size, and the indent + for nested rows leaves no room for both. */ +@container (max-width: 260px) { + .file-row-size { + display: none; + } +} + .files-viewer { min-width: 0; min-height: 0; @@ -2543,4 +2545,8 @@ details:not([open]) > *:not(summary) { .sidebar { transition: none; } + + .tree-caret { + transition: none; + } } diff --git a/web/app/components/FilesPane.vue b/web/app/components/FilesPane.vue index 70d5b03..b75e9fa 100644 --- a/web/app/components/FilesPane.vue +++ b/web/app/components/FilesPane.vue @@ -1,6 +1,6 @@