Cover and document folder view controls
@@ -77,6 +77,7 @@
77
77
- GET /api/files/folder-icon - Returns the current icon source file for a folder ({icon:{filePath}} or {icon:null}); explicit assignment takes priority over auto-first.
78
78
- POST /api/files/folder-icon - Sets or clears a folder's explicit icon assignment; imagePath must have a cached thumbnail; write access required.
79
79
- GET /api/files/search - Fuzzy-searches all readable roots (and personal folder when configured) for files, returning ranked matches with path metadata.
80
- GET /api/files/list - Returns directory items including name/path/isDir plus size, mtime, and uploadedAt (creation-time approximation) used by client folder sorting/grouping.
80
81
- GET /api/files/search-images - Fuzzy-searches readable roots for image files with ready thumbnails, returning capped results plus scan-truncation metadata for scalable global favicon selection.
81
82
- GET /api/files/global-favicon-image - Publicly serves the configured global favicon thumbnail file so browsers can load `<link rel="icon">` without auth headers.
82
83
- GET /api/files/global-favicon - Returns the configured global favicon source file path ({favicon:{filePath}} or {favicon:null}).
@@ -248,6 +249,8 @@
248
249
- formatRootAccessList(users) - Formats root access entries as "username mode" values for sidebar rendering.
249
250
- 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.
250
251
- openFolderSidebar() - Shows current folder details when nothing is selected; when at root base-level it also shows root access list.
252
- openFolderSidebar() / renderFolderViewControls(actions, dirPath) - In folder overview mode, renders per-folder view controls (Sort by, Group by, folders-first, ascending) and persists them per user+folder in localStorage.
253
- renderFileGrid() / buildFileGridRows(items, prefs) - Applies folder view ordering as Group option > folders-first option > sort option, and inserts labelled separator rows when grouping is enabled.
251
254
- openRenameModal(item) - Renames files/folders; for roots this writes display alias via /api/files/root-alias and reloads roots.
252
255
- uploadFiles(fileList) - Uploads files one-by-one with per-file conflict prompt (overwrite/rename/cancel) when names already exist.
253
256
- openUserModal(user, paths) - Admin user editor; enforces UI permission rule that Write is disabled/unchecked while Read is unchecked and disables the Admin checkbox when editing the current signed-in admin account.
@@ -77,6 +77,7 @@77
- GET /api/files/folder-icon - Returns the current icon source file for a folder ({icon:{filePath}} or {icon:null}); explicit assignment takes priority over auto-first.
77
- GET /api/files/folder-icon - Returns the current icon source file for a folder ({icon:{filePath}} or {icon:null}); explicit assignment takes priority over auto-first.
78
- POST /api/files/folder-icon - Sets or clears a folder's explicit icon assignment; imagePath must have a cached thumbnail; write access required.
78
- POST /api/files/folder-icon - Sets or clears a folder's explicit icon assignment; imagePath must have a cached thumbnail; write access required.
79
- GET /api/files/search - Fuzzy-searches all readable roots (and personal folder when configured) for files, returning ranked matches with path metadata.
79
- GET /api/files/search - Fuzzy-searches all readable roots (and personal folder when configured) for files, returning ranked matches with path metadata.
80
- GET /api/files/list - Returns directory items including name/path/isDir plus size, mtime, and uploadedAt (creation-time approximation) used by client folder sorting/grouping.
80
- GET /api/files/search-images - Fuzzy-searches readable roots for image files with ready thumbnails, returning capped results plus scan-truncation metadata for scalable global favicon selection.
81
- GET /api/files/search-images - Fuzzy-searches readable roots for image files with ready thumbnails, returning capped results plus scan-truncation metadata for scalable global favicon selection.
81
- GET /api/files/global-favicon-image - Publicly serves the configured global favicon thumbnail file so browsers can load `<link rel="icon">` without auth headers.
82
- GET /api/files/global-favicon-image - Publicly serves the configured global favicon thumbnail file so browsers can load `<link rel="icon">` without auth headers.
82
- GET /api/files/global-favicon - Returns the configured global favicon source file path ({favicon:{filePath}} or {favicon:null}).
83
- GET /api/files/global-favicon - Returns the configured global favicon source file path ({favicon:{filePath}} or {favicon:null}).
@@ -248,6 +249,8 @@248
- formatRootAccessList(users) - Formats root access entries as "username mode" values for sidebar rendering.
249
- formatRootAccessList(users) - Formats root access entries as "username mode" values for sidebar rendering.
249
- 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.
250
- 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.
250
- openFolderSidebar() - Shows current folder details when nothing is selected; when at root base-level it also shows root access list.
251
- openFolderSidebar() - Shows current folder details when nothing is selected; when at root base-level it also shows root access list.
252
- openFolderSidebar() / renderFolderViewControls(actions, dirPath) - In folder overview mode, renders per-folder view controls (Sort by, Group by, folders-first, ascending) and persists them per user+folder in localStorage.
253
- renderFileGrid() / buildFileGridRows(items, prefs) - Applies folder view ordering as Group option > folders-first option > sort option, and inserts labelled separator rows when grouping is enabled.
251
- openRenameModal(item) - Renames files/folders; for roots this writes display alias via /api/files/root-alias and reloads roots.
254
- openRenameModal(item) - Renames files/folders; for roots this writes display alias via /api/files/root-alias and reloads roots.
252
- uploadFiles(fileList) - Uploads files one-by-one with per-file conflict prompt (overwrite/rename/cancel) when names already exist.
255
- uploadFiles(fileList) - Uploads files one-by-one with per-file conflict prompt (overwrite/rename/cancel) when names already exist.
253
- openUserModal(user, paths) - Admin user editor; enforces UI permission rule that Write is disabled/unchecked while Read is unchecked and disables the Admin checkbox when editing the current signed-in admin account.
256
- openUserModal(user, paths) - Admin user editor; enforces UI permission rule that Write is disabled/unchecked while Read is unchecked and disables the Admin checkbox when editing the current signed-in admin account.
@@ -704,6 +704,101 @@ describe('page load smoke test', () =>
704
704
dom.window.close();
705
705
});
706
706
707
test('folder sidebar view options apply grouping/sorting and persist per folder', async () =>
708
{
709
listFixture = {
710
'/data': [
711
{
712
name: 'sub',
713
path: '/data/sub',
714
isDir: true,
715
size: 0,
716
mtime: '2026-05-10T08:00:00.000Z',
717
uploadedAt: '2026-05-09T08:00:00.000Z',
718
},
719
{
720
name: 'small.txt',
721
path: '/data/small.txt',
722
isDir: false,
723
size: 20,
724
mtime: '2026-05-15T10:00:00.000Z',
725
uploadedAt: '2026-05-15T10:00:00.000Z',
726
},
727
{
728
name: 'big.txt',
729
path: '/data/big.txt',
730
isDir: false,
731
size: 100,
732
mtime: '2026-05-11T10:00:00.000Z',
733
uploadedAt: '2026-05-11T10:00:00.000Z',
734
},
735
{
736
name: 'clip.mp4',
737
path: '/data/clip.mp4',
738
isDir: false,
739
size: 50,
740
mtime: '2026-05-12T10:00:00.000Z',
741
uploadedAt: '2026-05-12T10:00:00.000Z',
742
},
743
],
744
'/data/sub': [
745
{
746
name: 'inside.txt',
747
path: '/data/sub/inside.txt',
748
isDir: false,
749
size: 1,
750
mtime: '2026-05-01T00:00:00.000Z',
751
uploadedAt: '2026-05-01T00:00:00.000Z',
752
},
753
],
754
};
755
756
const { dom, runtimeErrors } = await bootClient();
757
expect(runtimeErrors).toEqual([]);
758
759
await waitFor(dom, () => dom.window.document.querySelectorAll('.file-item').length === 4);
760
await waitFor(dom, () => !!dom.window.document.querySelector('select[data-view-option="sort"]'));
761
const sortSelect = dom.window.document.querySelector('select[data-view-option="sort"]');
762
const groupSelect = dom.window.document.querySelector('select[data-view-option="group"]');
763
const ascInput = dom.window.document.querySelector('input[data-view-option="ascending"]');
764
expect(sortSelect).toBeTruthy();
765
expect(groupSelect).toBeTruthy();
766
expect(ascInput).toBeTruthy();
767
768
sortSelect.value = 'size';
769
sortSelect.dispatchEvent(new dom.window.Event('change', { bubbles: true }));
770
ascInput.checked = false;
771
ascInput.dispatchEvent(new dom.window.Event('change', { bubbles: true }));
772
773
await waitFor(dom, () =>
774
{
775
const names = Array.from(dom.window.document.querySelectorAll('.file-item .name')).map((el) => el.textContent);
776
const bigIdx = names.indexOf('big.txt');
777
const clipIdx = names.indexOf('clip.mp4');
778
const smallIdx = names.indexOf('small.txt');
779
return names[0] === 'sub' && bigIdx > -1 && clipIdx > -1 && smallIdx > -1 && bigIdx < clipIdx && clipIdx < smallIdx;
780
});
781
782
groupSelect.value = 'fileType';
783
groupSelect.dispatchEvent(new dom.window.Event('change', { bubbles: true }));
784
await waitFor(dom, () => dom.window.document.querySelectorAll('.file-group-separator').length >= 2);
785
786
const subTile = dom.window.document.querySelector('.file-item[data-path="/data/sub"]');
787
subTile.dispatchEvent(new dom.window.MouseEvent('dblclick', { bubbles: true }));
788
await waitFor(dom, () => !!dom.window.document.querySelector('.file-item[data-path="/data/sub/inside.txt"]'));
789
790
const homeCrumb = dom.window.document.querySelector('#breadcrumb .crumb');
791
homeCrumb.dispatchEvent(new dom.window.MouseEvent('click', { bubbles: true }));
792
793
await waitFor(dom, () => !!dom.window.document.querySelector('.file-item[data-path="/data/sub"]'));
794
await waitFor(dom, () => !!dom.window.document.querySelector('select[data-view-option="group"]'));
795
expect(dom.window.document.querySelector('select[data-view-option="sort"]').value).toBe('size');
796
expect(dom.window.document.querySelector('select[data-view-option="group"]').value).toBe('fileType');
797
expect(dom.window.document.querySelectorAll('.file-group-separator').length).toBeGreaterThanOrEqual(2);
798
799
dom.window.close();
800
});
801
707
802
test('shows pending icon spinner when image thumbnail cache is not ready', async () =>
708
803
{
709
804
listFixture = {
@@ -704,6 +704,101 @@ describe('page load smoke test', () =>704
dom.window.close();
704
dom.window.close();
705
});
705
});
706
706
707
test('folder sidebar view options apply grouping/sorting and persist per folder', async () =>
708
{
709
listFixture = {
710
'/data': [
711
{
712
name: 'sub',
713
path: '/data/sub',
714
isDir: true,
715
size: 0,
716
mtime: '2026-05-10T08:00:00.000Z',
717
uploadedAt: '2026-05-09T08:00:00.000Z',
718
},
719
{
720
name: 'small.txt',
721
path: '/data/small.txt',
722
isDir: false,
723
size: 20,
724
mtime: '2026-05-15T10:00:00.000Z',
725
uploadedAt: '2026-05-15T10:00:00.000Z',
726
},
727
{
728
name: 'big.txt',
729
path: '/data/big.txt',
730
isDir: false,
731
size: 100,
732
mtime: '2026-05-11T10:00:00.000Z',
733
uploadedAt: '2026-05-11T10:00:00.000Z',
734
},
735
{
736
name: 'clip.mp4',
737
path: '/data/clip.mp4',
738
isDir: false,
739
size: 50,
740
mtime: '2026-05-12T10:00:00.000Z',
741
uploadedAt: '2026-05-12T10:00:00.000Z',
742
},
743
],
744
'/data/sub': [
745
{
746
name: 'inside.txt',
747
path: '/data/sub/inside.txt',
748
isDir: false,
749
size: 1,
750
mtime: '2026-05-01T00:00:00.000Z',
751
uploadedAt: '2026-05-01T00:00:00.000Z',
752
},
753
],
754
};
755
756
const { dom, runtimeErrors } = await bootClient();
757
expect(runtimeErrors).toEqual([]);
758
759
await waitFor(dom, () => dom.window.document.querySelectorAll('.file-item').length === 4);
760
await waitFor(dom, () => !!dom.window.document.querySelector('select[data-view-option="sort"]'));
761
const sortSelect = dom.window.document.querySelector('select[data-view-option="sort"]');
762
const groupSelect = dom.window.document.querySelector('select[data-view-option="group"]');
763
const ascInput = dom.window.document.querySelector('input[data-view-option="ascending"]');
764
expect(sortSelect).toBeTruthy();
765
expect(groupSelect).toBeTruthy();
766
expect(ascInput).toBeTruthy();
767
768
sortSelect.value = 'size';
769
sortSelect.dispatchEvent(new dom.window.Event('change', { bubbles: true }));
770
ascInput.checked = false;
771
ascInput.dispatchEvent(new dom.window.Event('change', { bubbles: true }));
772
773
await waitFor(dom, () =>
774
{
775
const names = Array.from(dom.window.document.querySelectorAll('.file-item .name')).map((el) => el.textContent);
776
const bigIdx = names.indexOf('big.txt');
777
const clipIdx = names.indexOf('clip.mp4');
778
const smallIdx = names.indexOf('small.txt');
779
return names[0] === 'sub' && bigIdx > -1 && clipIdx > -1 && smallIdx > -1 && bigIdx < clipIdx && clipIdx < smallIdx;
780
});
781
782
groupSelect.value = 'fileType';
783
groupSelect.dispatchEvent(new dom.window.Event('change', { bubbles: true }));
784
await waitFor(dom, () => dom.window.document.querySelectorAll('.file-group-separator').length >= 2);
785
786
const subTile = dom.window.document.querySelector('.file-item[data-path="/data/sub"]');
787
subTile.dispatchEvent(new dom.window.MouseEvent('dblclick', { bubbles: true }));
788
await waitFor(dom, () => !!dom.window.document.querySelector('.file-item[data-path="/data/sub/inside.txt"]'));
789
790
const homeCrumb = dom.window.document.querySelector('#breadcrumb .crumb');
791
homeCrumb.dispatchEvent(new dom.window.MouseEvent('click', { bubbles: true }));
792
793
await waitFor(dom, () => !!dom.window.document.querySelector('.file-item[data-path="/data/sub"]'));
794
await waitFor(dom, () => !!dom.window.document.querySelector('select[data-view-option="group"]'));
795
expect(dom.window.document.querySelector('select[data-view-option="sort"]').value).toBe('size');
796
expect(dom.window.document.querySelector('select[data-view-option="group"]').value).toBe('fileType');
797
expect(dom.window.document.querySelectorAll('.file-group-separator').length).toBeGreaterThanOrEqual(2);
798
799
dom.window.close();
800
});
801
707
test('shows pending icon spinner when image thumbnail cache is not ready', async () =>
802
test('shows pending icon spinner when image thumbnail cache is not ready', async () =>
708
{
803
{
709
listFixture = {
804
listFixture = {