diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-06 02:48:28 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-06 02:48:28 +0200 |
| commit | e2885fec8dcb3cd452899e2628d6e9ad5c70b01e (patch) | |
| tree | 3a41bb77d52d1a0c1205709ee288d2ed0160ebc3 | |
| parent | 15c52d91f2efa73f3d1b6b06afed840fada29d8e (diff) | |
| download | meshbay-e2885fec8dcb3cd452899e2628d6e9ad5c70b01e.tar.gz | |
feat(node): add ".." parent row in file explorer, hide mkdir button
Show a ".." row at the top of subdirectory listings to navigate back to
the parent. No path traversal risk — currentPath is internal state built
from the node's own index. Hide the mkdir button (not useful yet); update
the upload-controls test marker accordingly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/files-app.js | 19 | ||||
| -rw-r--r-- | packages/meshbay-hub/tests/test_upload_controls_hidden.py | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/files-app.js b/packages/meshbay-hub/src/meshbay_hub/static/files-app.js index d6cb3b9..195c385 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/files-app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/files-app.js @@ -345,11 +345,6 @@ function FilesPanel({ onChange=${uploadFile} /> </label> `} - ${canCreateDir && html` - <button class="tb-btn" onClick=${makeDirectory}> - <${Icon} name="folder-plus" /> ${t('group.mkdir')} - </button> - `} </div> <div class="breadcrumbs"> @@ -406,6 +401,20 @@ function FilesPanel({ </tr> </thead> <tbody> + ${currentPath && html` + <tr class="file-row dir-row" key="__parent__" onClick=${() => { + const parts = currentPath.split('/'); + setCurrentPath(parts.slice(0, -1).join('/')); + }}> + <td class="sel-cell"></td> + <td>${'\u{1F4C1}'}</td> + <td>..</td> + <td class="file-size"></td> + ${showGroup && html`<td></td>`} + <td class="td-type"></td> + <td class="td-date"></td> + </tr> + `} ${subdirs.map(d => { const full = currentPath ? currentPath + '/' + d : d; const inside = entriesUnder(entries, full); diff --git a/packages/meshbay-hub/tests/test_upload_controls_hidden.py b/packages/meshbay-hub/tests/test_upload_controls_hidden.py index 955b47d..94917d2 100644 --- a/packages/meshbay-hub/tests/test_upload_controls_hidden.py +++ b/packages/meshbay-hub/tests/test_upload_controls_hidden.py @@ -47,7 +47,7 @@ def _component(app: str, name: str) -> str: def test_the_files_toolbar_hides_its_upload_button(): page = _component(FILES_APP.read_text(encoding="utf-8"), "FilesPanel") toolbar = page[page.index("file-toolbar"):] - toolbar = toolbar[:toolbar.index("group.mkdir")] + toolbar = toolbar[:toolbar.index("breadcrumbs")] assert "mayUpload &&" in toolbar, "the Upload button is offered regardless" |