Refine sidebar root handling and access display
@@ -189,6 +189,7 @@
189
189
- makeFileItem(item) - Builds a .file-item element; roots in Home now use folder-like interaction (single-click focus, double-click open), roots are non-draggable, and mobile long-press contextmenu suppression remains.
190
190
- attachMobileLongPress(el, item) - Adds mobile long-press detection on file/folder tiles to open the item sidebar without desktop side effects.
191
191
- openSidebar(item) - Renders item details/actions in sidebar; roots show alias + original name + usage stats, hide Move To/Delete, keep Rename.
192
- openSidebar(item) - Personal user roots display access as private and skip /files/root-access lookups to avoid forbidden noise.
192
193
- fetchRootAccessList(rootPath) - Fetches root access users from the server for a specific configured root.
193
194
- formatRootAccessList(users) - Formats root access entries as "username mode" values for sidebar rendering.
194
195
- openSidebar(item) - Renders item details/actions in sidebar; root selections include alias/original name/usage/access list and keep Rename while hiding Move To/Delete.
@@ -189,6 +189,7 @@189
- makeFileItem(item) - Builds a .file-item element; roots in Home now use folder-like interaction (single-click focus, double-click open), roots are non-draggable, and mobile long-press contextmenu suppression remains.
189
- makeFileItem(item) - Builds a .file-item element; roots in Home now use folder-like interaction (single-click focus, double-click open), roots are non-draggable, and mobile long-press contextmenu suppression remains.
190
- attachMobileLongPress(el, item) - Adds mobile long-press detection on file/folder tiles to open the item sidebar without desktop side effects.
190
- attachMobileLongPress(el, item) - Adds mobile long-press detection on file/folder tiles to open the item sidebar without desktop side effects.
191
- openSidebar(item) - Renders item details/actions in sidebar; roots show alias + original name + usage stats, hide Move To/Delete, keep Rename.
191
- openSidebar(item) - Renders item details/actions in sidebar; roots show alias + original name + usage stats, hide Move To/Delete, keep Rename.
192
- openSidebar(item) - Personal user roots display access as private and skip /files/root-access lookups to avoid forbidden noise.
192
- fetchRootAccessList(rootPath) - Fetches root access users from the server for a specific configured root.
193
- fetchRootAccessList(rootPath) - Fetches root access users from the server for a specific configured root.
193
- formatRootAccessList(users) - Formats root access entries as "username mode" values for sidebar rendering.
194
- formatRootAccessList(users) - Formats root access entries as "username mode" values for sidebar rendering.
194
- openSidebar(item) - Renders item details/actions in sidebar; root selections include alias/original name/usage/access list and keep Rename while hiding Move To/Delete.
195
- openSidebar(item) - Renders item details/actions in sidebar; root selections include alias/original name/usage/access list and keep Rename while hiding Move To/Delete.
@@ -1839,19 +1839,30 @@ async function openSidebar (item)
1839
1839
if (space)
1840
1840
{
1841
1841
const used = formatBytes(space.usedBytes);
1842
const free = space.freeBytes == null ? 'unknown' : formatBytes(space.freeBytes);
1842
const free = space.userFreeBytes != null
1843
? formatBytes(space.userFreeBytes)
1844
: (space.freeBytes == null ? 'unknown' : formatBytes(space.freeBytes));
1845
const freeLabel = space.userFreeBytes != null ? 'Free space remaining' : 'Remaining';
1843
1846
dl.innerHTML += `
1844
1847
<dt>Used</dt><dd>${used}</dd>
1845
<dt>Remaining</dt><dd>${free}</dd>
1848
<dt>${freeLabel}</dt><dd>${free}</dd>
1846
1849
`;
1847
1850
}
1848
1851
1849
const accessUsers = await fetchRootAccessList(item.path);
1850
if (accessUsers)
1852
if (item._root.isUserFolder)
1851
1853
{
1852
1854
dl.innerHTML += `
1853
<dt>Access</dt><dd>${formatRootAccessList(accessUsers)}</dd>
1855
<dt>Access</dt><dd>Private (your folder)</dd>
1854
1856
`;
1857
} else
1858
{
1859
const accessUsers = await fetchRootAccessList(item.path);
1860
if (accessUsers)
1861
{
1862
dl.innerHTML += `
1863
<dt>Access</dt><dd>${formatRootAccessList(accessUsers)}</dd>
1864
`;
1865
}
1855
1866
}
1856
1867
}
1857
1868
@@ -1989,6 +2000,12 @@ function openFolderSidebar ()
1989
2000
1990
2001
if (samePath(STATE.currentDir, STATE.currentRoot.path))
1991
2002
{
2003
if (STATE.currentRoot.isUserFolder)
2004
{
2005
dl.innerHTML += '<dt>Access</dt><dd>Private (your folder)</dd>';
2006
return;
2007
}
2008
1992
2009
dl.innerHTML += '<dt>Access</dt><dd>Loading…</dd>';
1993
2010
const currentDirAtStart = STATE.currentDir;
1994
2011
const currentRootPathAtStart = STATE.currentRoot.path;
@@ -1839,19 +1839,30 @@ async function openSidebar (item)1839
if (space)1839
if (space)1840
{1840
{1841
const used = formatBytes(space.usedBytes);1841
const used = formatBytes(space.usedBytes);1842
const free = space.freeBytes == null ? 'unknown' : formatBytes(space.freeBytes);1842
const free = space.userFreeBytes != null1843
? formatBytes(space.userFreeBytes)1844
: (space.freeBytes == null ? 'unknown' : formatBytes(space.freeBytes));1845
const freeLabel = space.userFreeBytes != null ? 'Free space remaining' : 'Remaining';1843
dl.innerHTML += `1846
dl.innerHTML += `1844
<dt>Used</dt><dd>${used}</dd>1847
<dt>Used</dt><dd>${used}</dd>1845
<dt>Remaining</dt><dd>${free}</dd>1848
<dt>${freeLabel}</dt><dd>${free}</dd>1846
`;1849
`;1847
}1850
}1848
1851
1849
const accessUsers = await fetchRootAccessList(item.path);1852
if (item._root.isUserFolder)1850
if (accessUsers)1851
{1853
{1852
dl.innerHTML += `1854
dl.innerHTML += `1853
<dt>Access</dt><dd>${formatRootAccessList(accessUsers)}</dd>1855
<dt>Access</dt><dd>Private (your folder)</dd>1854
`;1856
`;1857
} else1858
{1859
const accessUsers = await fetchRootAccessList(item.path);1860
if (accessUsers)1861
{1862
dl.innerHTML += `1863
<dt>Access</dt><dd>${formatRootAccessList(accessUsers)}</dd>1864
`;1865
}1855
}1866
}1856
}1867
}1857
1868
@@ -1989,6 +2000,12 @@ function openFolderSidebar ()1989
2000
1990
if (samePath(STATE.currentDir, STATE.currentRoot.path))2001
if (samePath(STATE.currentDir, STATE.currentRoot.path))1991
{2002
{2003
if (STATE.currentRoot.isUserFolder)2004
{2005
dl.innerHTML += '<dt>Access</dt><dd>Private (your folder)</dd>';2006
return;2007
}2008
1992
dl.innerHTML += '<dt>Access</dt><dd>Loading…</dd>';2009
dl.innerHTML += '<dt>Access</dt><dd>Loading…</dd>';1993
const currentDirAtStart = STATE.currentDir;2010
const currentDirAtStart = STATE.currentDir;1994
const currentRootPathAtStart = STATE.currentRoot.path;2011
const currentRootPathAtStart = STATE.currentRoot.path;