aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/files-app.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-05 11:53:57 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-05 11:53:57 +0200
commit8f25294b0f6bc3f292442edd69a2e149f0717b52 (patch)
tree58cfe661b15fce395ab5116f19341bdb6a5b07fe /packages/meshbay-hub/src/meshbay_hub/static/files-app.js
parent28752696f376eb11feb686580a435b166750a723 (diff)
downloadmeshbay-8f25294b0f6bc3f292442edd69a2e149f0717b52.tar.gz
feat: open a group, a folder or a file from a #/name@owner link
A group can now be reached by the handle shown under its name, and a path after it points inside the group: #/name@owner/root/dir/file downloads the file and opens Files on its folder; a folder opens Files there. The handle is resolved in the client against the account's own /v1/groups/mine, so no hub route answers for a name and nobody can probe for one. While a group is open the address shows the handle (replace, no history entry); a linked path is taken out of the address once acted on, so a reload does not download twice. Signing in no longer sends everyone home: the form stood in for the page the address named, and that is where a link opened signed out was going. group-link.js holds the parsing and lookups, executed whole by test_group_link.py; harness/group_link_probe.py drives the router in Chrome. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/files-app.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/files-app.js6
1 files changed, 5 insertions, 1 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 38157b9..978090c 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/files-app.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/files-app.js
@@ -142,12 +142,16 @@ function FilesPanel({
entries, nodeDirs, nodeRoots, setEntries, setNodeDirs, setNodeRoots, applyIndex,
isNodeAdmin, operatorPaired, userId, setError, onPreview,
showGroup, readOnly, getTransport, onRefreshIndex, showRefresh, onReport,
+ openDirectory,
}) {
const [selected, setSelected] = useState(() => new Set());
const [sortKey, setSortKey] = useState('name');
const [sortAsc, setSortAsc] = useState(true);
const [filter, setFilter] = useState('');
- const [currentPath, setCurrentPath] = useState('');
+ const [currentPath, setCurrentPath] = useState(() => (openDirectory ? openDirectory.dir : ''));
+ // A link into the group named a folder (group-page.js); a new object each
+ // time, so the same folder linked twice is opened twice.
+ useEffect(() => { if (openDirectory) setCurrentPath(openDirectory.dir); }, [openDirectory]);
const [refreshing, setRefreshing] = useState(false);
// The toolbar pins below the page's own band and tells the column heads how
// far down to pin. Its height is not a constant — it wraps to three rows on