BlueGit

timfa filemanager

Group topbar actions into Upload and User dropdowns

timfa Tim Falken · pushed by timfa

Authored 2026-05-17 · 6 months ago

Hash
734fa62d0a71106bceaa1717a74d4a48fc4229e5
Parent
c4f74075
4 files changed +180 −58
.github/technical-reference.md +3 −3
@@ -133,7 +133,7 @@
133 133
134 134 ## public/index.html
135 135 - Auth form - Login/setup form uses username plus mode-specific password autocomplete tokens so browser password managers behave correctly.
136 - Top bar - Includes global file search input/button controls.
136 - Top bar - Places icon-only Refresh to the left of breadcrumb/Home, keeps search input with icon-only search button, and groups actions into Upload/User dropdown triggers.
137 137 - Admin panel - Includes an icon-only global favicon button that opens the shared icon picker modal.
138 138 - Admin modal - Includes User Folders controls (user path + per-user size limit) and a dedicated save action for that config.
139 139 - Import map - Maps `three` and `three/addons/` to local vendored modules for client-side STL/OBJ previews.
@@ -170,11 +170,11 @@
170 170 - observeFolderIcon(iconEl) - Registers a folder icon element with IntersectionObserver for lazy loading.
171 171 - loadOneFolderIcon(iconEl) - Fetches /api/files/folder-icon then the thumbnail blob and overlays it inside the folder SVG; no-op if no icon available.
172 172 - applyFolderThumbnail(iconEl, srcUrl) - Injects an SVG <image> element clipped to the folder outline path into the folder's icon SVG.
173 - initTopbarDropdowns() / closeTopbarDropdowns() - Controls Upload/User roll-down menus (open/close, outside-click close, Escape close) without resizing the top bar.
173 174 - openFolderIconPicker(item) - Opens the folder icon picker modal; shows cached-thumbnail files from the folder (including video thumbnails); allows selection, clearing, and cancellation.
174 175 - openIconPickerModal(options) - Shared icon-picker modal used by folder-icon and global-favicon flows; includes live thumbnail-name filtering.
175 - openGlobalFaviconPicker() - Opens the shared icon picker for the current folder and sets/clears global favicon via `/files/global-favicon`.
176 176 - openGlobalFaviconPicker() - Opens a debounced, server-backed image-search modal across all accessible roots and sets/clears global favicon via `/files/global-favicon`.
177 - refreshGlobalFavicon() - Reads `/files/global-favicon`, updates topbar preview button, and applies/removes the page `<link rel="icon">` URL.
177 - refreshGlobalFavicon() - Reads `/files/global-favicon`, updates admin-panel favicon preview button, and applies/removes the page `<link rel="icon">` URL.
178 178 - refreshAfterIconChange(item) - Resets and reloads the folder icon in both the grid tile and sidebar after set/clear operations.
179 179 - disconnectFolderIconObserver() - Disconnects and clears the folder icon IntersectionObserver on grid rebuild.
180 180 - getThumbnailKind(name) - Classifies files into image/text/badge thumbnail strategies.
@@ -133,7 +133,7 @@
133
133
134## public/index.html
134## public/index.html
135- Auth form - Login/setup form uses username plus mode-specific password autocomplete tokens so browser password managers behave correctly.
135- Auth form - Login/setup form uses username plus mode-specific password autocomplete tokens so browser password managers behave correctly.
136- Top bar - Includes global file search input/button controls.
136- Top bar - Places icon-only Refresh to the left of breadcrumb/Home, keeps search input with icon-only search button, and groups actions into Upload/User dropdown triggers.
137- Admin panel - Includes an icon-only global favicon button that opens the shared icon picker modal.
137- Admin panel - Includes an icon-only global favicon button that opens the shared icon picker modal.
138- Admin modal - Includes User Folders controls (user path + per-user size limit) and a dedicated save action for that config.
138- Admin modal - Includes User Folders controls (user path + per-user size limit) and a dedicated save action for that config.
139- Import map - Maps `three` and `three/addons/` to local vendored modules for client-side STL/OBJ previews.
139- Import map - Maps `three` and `three/addons/` to local vendored modules for client-side STL/OBJ previews.
@@ -170,11 +170,11 @@
170- observeFolderIcon(iconEl) - Registers a folder icon element with IntersectionObserver for lazy loading.
170- observeFolderIcon(iconEl) - Registers a folder icon element with IntersectionObserver for lazy loading.
171- loadOneFolderIcon(iconEl) - Fetches /api/files/folder-icon then the thumbnail blob and overlays it inside the folder SVG; no-op if no icon available.
171- loadOneFolderIcon(iconEl) - Fetches /api/files/folder-icon then the thumbnail blob and overlays it inside the folder SVG; no-op if no icon available.
172- applyFolderThumbnail(iconEl, srcUrl) - Injects an SVG <image> element clipped to the folder outline path into the folder's icon SVG.
172- applyFolderThumbnail(iconEl, srcUrl) - Injects an SVG <image> element clipped to the folder outline path into the folder's icon SVG.
173- initTopbarDropdowns() / closeTopbarDropdowns() - Controls Upload/User roll-down menus (open/close, outside-click close, Escape close) without resizing the top bar.
173- openFolderIconPicker(item) - Opens the folder icon picker modal; shows cached-thumbnail files from the folder (including video thumbnails); allows selection, clearing, and cancellation.
174- openFolderIconPicker(item) - Opens the folder icon picker modal; shows cached-thumbnail files from the folder (including video thumbnails); allows selection, clearing, and cancellation.
174- openIconPickerModal(options) - Shared icon-picker modal used by folder-icon and global-favicon flows; includes live thumbnail-name filtering.
175- openIconPickerModal(options) - Shared icon-picker modal used by folder-icon and global-favicon flows; includes live thumbnail-name filtering.
175- openGlobalFaviconPicker() - Opens the shared icon picker for the current folder and sets/clears global favicon via `/files/global-favicon`.
176- openGlobalFaviconPicker() - Opens a debounced, server-backed image-search modal across all accessible roots and sets/clears global favicon via `/files/global-favicon`.
176- openGlobalFaviconPicker() - Opens a debounced, server-backed image-search modal across all accessible roots and sets/clears global favicon via `/files/global-favicon`.
177- refreshGlobalFavicon() - Reads `/files/global-favicon`, updates topbar preview button, and applies/removes the page `<link rel="icon">` URL.
177- refreshGlobalFavicon() - Reads `/files/global-favicon`, updates admin-panel favicon preview button, and applies/removes the page `<link rel="icon">` URL.
178- refreshAfterIconChange(item) - Resets and reloads the folder icon in both the grid tile and sidebar after set/clear operations.
178- refreshAfterIconChange(item) - Resets and reloads the folder icon in both the grid tile and sidebar after set/clear operations.
179- disconnectFolderIconObserver() - Disconnects and clears the folder icon IntersectionObserver on grid rebuild.
179- disconnectFolderIconObserver() - Disconnects and clears the folder icon IntersectionObserver on grid rebuild.
180- getThumbnailKind(name) - Classifies files into image/text/badge thumbnail strategies.
180- getThumbnailKind(name) - Classifies files into image/text/badge thumbnail strategies.
public/app.js +55 −4
@@ -1542,6 +1542,8 @@ function showApp ()
1542 1542 openFolderSidebar();
1543 1543 }
1544 1544 document.getElementById('btn-admin').classList.toggle('hidden', !STATE.isAdmin);
1545 const userLabel = document.getElementById('user-menu-label');
1546 if (userLabel) userLabel.textContent = STATE.username || 'User';
1545 1547 void refreshGlobalFavicon();
1546 1548 if (STATE.isAdmin)
1547 1549 {
@@ -4983,14 +4985,14 @@ let _adminUpdateStatus = null;
4983 4985 function setAdminUpdateBadge (count)
4984 4986 {
4985 4987 const badge = document.getElementById('admin-update-badge');
4986 const adminBtn = document.getElementById('btn-admin');
4987 if (!badge || !adminBtn) return;
4988 const userMenuBtn = document.getElementById('btn-user-menu');
4989 if (!badge || !userMenuBtn) return;
4988 4990
4989 4991 if (!STATE.isAdmin || !Number.isFinite(count) || count <= 0)
4990 4992 {
4991 4993 badge.classList.add('hidden');
4992 4994 badge.textContent = '';
4993 adminBtn.removeAttribute('data-update-count');
4995 userMenuBtn.removeAttribute('data-update-count');
4994 4996 return;
4995 4997 }
4996 4998
@@ -4998,7 +5000,7 @@ function setAdminUpdateBadge (count)
4998 5000 const capped = Math.min(whole, 99);
4999 5001 badge.textContent = capped >= 99 ? '99+' : String(capped);
5000 5002 badge.classList.remove('hidden');
5001 adminBtn.dataset.updateCount = String(whole);
5003 userMenuBtn.dataset.updateCount = String(whole);
5002 5004 }
5003 5005
5004 5006 function pulseAdminUpdateButton ()
@@ -5871,8 +5873,57 @@ function applyFolderThumbnail (iconEl, srcUrl)
5871 5873 iconEl.dataset.thumbReady = '1';
5872 5874 }
5873 5875
5876 function closeTopbarDropdowns ()
5877 {
5878 document.querySelectorAll('.topbar-dropdown.open').forEach((dropdown) =>
5879 {
5880 dropdown.classList.remove('open');
5881 const trigger = dropdown.querySelector('button[aria-expanded]');
5882 if (trigger) trigger.setAttribute('aria-expanded', 'false');
5883 });
5884 }
5885
5886 function initTopbarDropdowns ()
5887 {
5888 document.querySelectorAll('.topbar-dropdown').forEach((dropdown) =>
5889 {
5890 const trigger = dropdown.querySelector('button[aria-expanded]');
5891 if (!trigger) return;
5892
5893 trigger.addEventListener('click', (e) =>
5894 {
5895 e.stopPropagation();
5896 const shouldOpen = !dropdown.classList.contains('open');
5897 closeTopbarDropdowns();
5898 if (shouldOpen)
5899 {
5900 dropdown.classList.add('open');
5901 trigger.setAttribute('aria-expanded', 'true');
5902 }
5903 });
5904
5905 dropdown.querySelectorAll('.topbar-menu-item').forEach((itemBtn) =>
5906 {
5907 itemBtn.addEventListener('click', () => closeTopbarDropdowns());
5908 });
5909 });
5910
5911 document.addEventListener('click', (e) =>
5912 {
5913 if (e.target && e.target.closest && e.target.closest('.topbar-dropdown')) return;
5914 closeTopbarDropdowns();
5915 });
5916
5917 document.addEventListener('keydown', (e) =>
5918 {
5919 if (e.key === 'Escape') closeTopbarDropdowns();
5920 });
5921 }
5922
5874 5923 function wireEvents ()
5875 5924 {
5925 initTopbarDropdowns();
5926
5876 5927 // Auth form
5877 5928 document.getElementById('auth-form').addEventListener('submit', async (e) =>
5878 5929 {
@@ -1542,6 +1542,8 @@ function showApp ()
1542 openFolderSidebar();
1542 openFolderSidebar();
1543 }
1543 }
1544 document.getElementById('btn-admin').classList.toggle('hidden', !STATE.isAdmin);
1544 document.getElementById('btn-admin').classList.toggle('hidden', !STATE.isAdmin);
1545 const userLabel = document.getElementById('user-menu-label');
1546 if (userLabel) userLabel.textContent = STATE.username || 'User';
1545 void refreshGlobalFavicon();
1547 void refreshGlobalFavicon();
1546 if (STATE.isAdmin)
1548 if (STATE.isAdmin)
1547 {
1549 {
@@ -4983,14 +4985,14 @@ let _adminUpdateStatus = null;
4983function setAdminUpdateBadge (count)
4985function setAdminUpdateBadge (count)
4984{
4986{
4985 const badge = document.getElementById('admin-update-badge');
4987 const badge = document.getElementById('admin-update-badge');
4986 const adminBtn = document.getElementById('btn-admin');
4988 const userMenuBtn = document.getElementById('btn-user-menu');
4987 if (!badge || !adminBtn) return;
4989 if (!badge || !userMenuBtn) return;
4988
4990
4989 if (!STATE.isAdmin || !Number.isFinite(count) || count <= 0)
4991 if (!STATE.isAdmin || !Number.isFinite(count) || count <= 0)
4990 {
4992 {
4991 badge.classList.add('hidden');
4993 badge.classList.add('hidden');
4992 badge.textContent = '';
4994 badge.textContent = '';
4993 adminBtn.removeAttribute('data-update-count');
4995 userMenuBtn.removeAttribute('data-update-count');
4994 return;
4996 return;
4995 }
4997 }
4996
4998
@@ -4998,7 +5000,7 @@ function setAdminUpdateBadge (count)
4998 const capped = Math.min(whole, 99);
5000 const capped = Math.min(whole, 99);
4999 badge.textContent = capped >= 99 ? '99+' : String(capped);
5001 badge.textContent = capped >= 99 ? '99+' : String(capped);
5000 badge.classList.remove('hidden');
5002 badge.classList.remove('hidden');
5001 adminBtn.dataset.updateCount = String(whole);
5003 userMenuBtn.dataset.updateCount = String(whole);
5002}
5004}
5003
5005
5004function pulseAdminUpdateButton ()
5006function pulseAdminUpdateButton ()
@@ -5871,8 +5873,57 @@ function applyFolderThumbnail (iconEl, srcUrl)
5871 iconEl.dataset.thumbReady = '1';
5873 iconEl.dataset.thumbReady = '1';
5872}
5874}
5873
5875
5876function closeTopbarDropdowns ()
5877{
5878 document.querySelectorAll('.topbar-dropdown.open').forEach((dropdown) =>
5879 {
5880 dropdown.classList.remove('open');
5881 const trigger = dropdown.querySelector('button[aria-expanded]');
5882 if (trigger) trigger.setAttribute('aria-expanded', 'false');
5883 });
5884}
5885
5886function initTopbarDropdowns ()
5887{
5888 document.querySelectorAll('.topbar-dropdown').forEach((dropdown) =>
5889 {
5890 const trigger = dropdown.querySelector('button[aria-expanded]');
5891 if (!trigger) return;
5892
5893 trigger.addEventListener('click', (e) =>
5894 {
5895 e.stopPropagation();
5896 const shouldOpen = !dropdown.classList.contains('open');
5897 closeTopbarDropdowns();
5898 if (shouldOpen)
5899 {
5900 dropdown.classList.add('open');
5901 trigger.setAttribute('aria-expanded', 'true');
5902 }
5903 });
5904
5905 dropdown.querySelectorAll('.topbar-menu-item').forEach((itemBtn) =>
5906 {
5907 itemBtn.addEventListener('click', () => closeTopbarDropdowns());
5908 });
5909 });
5910
5911 document.addEventListener('click', (e) =>
5912 {
5913 if (e.target && e.target.closest && e.target.closest('.topbar-dropdown')) return;
5914 closeTopbarDropdowns();
5915 });
5916
5917 document.addEventListener('keydown', (e) =>
5918 {
5919 if (e.key === 'Escape') closeTopbarDropdowns();
5920 });
5921}
5922
5874function wireEvents ()
5923function wireEvents ()
5875{
5924{
5925 initTopbarDropdowns();
5926
5876 // Auth form
5927 // Auth form
5877 document.getElementById('auth-form').addEventListener('submit', async (e) =>
5928 document.getElementById('auth-form').addEventListener('submit', async (e) =>
5878 {
5929 {
public/index.html +48 −51
@@ -45,79 +45,76 @@
45 45 <nav id="breadcrumb" aria-label="Breadcrumb"></nav>
46 46 </div>
47 47 <div id="topbar-actions">
48 <button id="btn-refresh" class="icon-btn" title="Refresh page" aria-label="Refresh page">
48 <button id="btn-refresh" class="icon-btn icon-only" title="Refresh page" aria-label="Refresh page">
49 49 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
50 50 stroke-linecap="round" stroke-linejoin="round">
51 51 <polyline points="23 4 23 10 17 10" />
52 52 <polyline points="1 20 1 14 7 14" />
53 53 <path d="M3.51 9a9 9 0 0 1 14.13-3.36L23 10M1 14l5.36 4.36A9 9 0 0 0 20.49 15" />
54 54 </svg>
55 Refresh
56 55 </button>
57 56
58 57 <div id="top-search" class="top-search" role="search">
59 58 <input id="top-search-input" type="text" placeholder="Search files" aria-label="Search files" />
60 <button id="btn-search" class="icon-btn" title="Search files" aria-label="Search files">
59 <button id="btn-search" class="icon-btn icon-only" title="Search files" aria-label="Search files">
61 60 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
62 61 stroke-linecap="round" stroke-linejoin="round">
63 62 <circle cx="11" cy="11" r="8" />
64 63 <line x1="21" y1="21" x2="16.65" y2="16.65" />
65 64 </svg>
66 Search
67 65 </button>
68 66 </div>
69 67
70 <button id="btn-upload" class="icon-btn" title="Upload files" aria-label="Upload files">
71 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
72 stroke-linecap="round" stroke-linejoin="round">
73 <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
74 <polyline points="17 8 12 3 7 8" />
75 <line x1="12" y1="3" x2="12" y2="15" />
76 </svg>
77 Upload
78 </button>
79 68 <input id="file-input" type="file" multiple class="hidden" aria-hidden="true" />
80 69 <input id="folder-input" type="file" webkitdirectory directory multiple class="hidden" aria-hidden="true" />
81 70
82 <button id="btn-upload-folder" class="icon-btn" title="Upload folder" aria-label="Upload folder">
83 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
84 stroke-linecap="round" stroke-linejoin="round">
85 <path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
86 <path d="M12 11v6" />
87 <path d="M9 14h6" />
88 </svg>
89 Folder
90 </button>
91
92 <button id="btn-new-folder" class="icon-btn" title="Create new folder" aria-label="Create new folder">
93 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
94 stroke-linecap="round" stroke-linejoin="round">
95 <path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
96 <path d="M12 11v6" />
97 <path d="M9 14h6" />
98 </svg>
99 New Folder
100 </button>
101
102 <button id="btn-admin" class="icon-btn hidden" title="Admin panel" aria-label="Admin panel">
103 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
104 stroke-linecap="round" stroke-linejoin="round">
105 <circle cx="12" cy="8" r="4" />
106 <path d="M6 20v-2a6 6 0 0 1 12 0v2" />
107 </svg>
108 <span class="icon-btn-label">Admin</span>
109 <span id="admin-update-badge" class="topbar-badge hidden" aria-hidden="true"></span>
110 </button>
71 <div class="topbar-dropdown" data-dropdown>
72 <button id="btn-upload-menu" class="icon-btn" title="Upload options" aria-label="Upload options" aria-expanded="false">
73 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
74 stroke-linecap="round" stroke-linejoin="round">
75 <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
76 <polyline points="17 8 12 3 7 8" />
77 <line x1="12" y1="3" x2="12" y2="15" />
78 </svg>
79 Upload
80 </button>
81 <div class="topbar-dropdown-menu" role="menu" aria-label="Upload actions">
82 <button id="btn-upload" class="topbar-menu-item" type="button" role="menuitem">Upload file</button>
83 <button id="btn-upload-folder" class="topbar-menu-item" type="button" role="menuitem">Upload folder</button>
84 <button id="btn-new-folder" class="topbar-menu-item" type="button" role="menuitem">New folder</button>
85 </div>
86 </div>
111 87
112 <button id="btn-logout" class="icon-btn" title="Sign out" aria-label="Sign out">
113 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
114 stroke-linecap="round" stroke-linejoin="round">
115 <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
116 <polyline points="16 17 21 12 16 7" />
117 <line x1="21" y1="12" x2="9" y2="12" />
118 </svg>
119 Sign out
120 </button>
88 <div class="topbar-dropdown" data-dropdown>
89 <button id="btn-user-menu" class="icon-btn" title="User menu" aria-label="User menu" aria-expanded="false">
90 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
91 stroke-linecap="round" stroke-linejoin="round">
92 <circle cx="12" cy="8" r="4" />
93 <path d="M6 20v-2a6 6 0 0 1 12 0v2" />
94 </svg>
95 <span id="user-menu-label">User</span>
96 <span id="admin-update-badge" class="topbar-badge hidden" aria-hidden="true"></span>
97 </button>
98 <div class="topbar-dropdown-menu topbar-dropdown-menu--right" role="menu" aria-label="User actions">
99 <button id="btn-admin" class="topbar-menu-item hidden" type="button" role="menuitem" title="Admin panel" aria-label="Admin panel">
100 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
101 stroke-linecap="round" stroke-linejoin="round">
102 <rect x="3" y="11" width="18" height="11" rx="2" ry="2" />
103 <path d="M7 11V7a5 5 0 0 1 10 0v4" />
104 </svg>
105 Admin
106 </button>
107 <button id="btn-logout" class="topbar-menu-item" type="button" role="menuitem" title="Sign out" aria-label="Sign out">
108 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
109 stroke-linecap="round" stroke-linejoin="round">
110 <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
111 <polyline points="16 17 21 12 16 7" />
112 <line x1="21" y1="12" x2="9" y2="12" />
113 </svg>
114 Sign out
115 </button>
116 </div>
117 </div>
121 118 </div>
122 119 </header>
123 120
@@ -45,79 +45,76 @@
45 <nav id="breadcrumb" aria-label="Breadcrumb"></nav>
45 <nav id="breadcrumb" aria-label="Breadcrumb"></nav>
46 </div>
46 </div>
47 <div id="topbar-actions">
47 <div id="topbar-actions">
48 <button id="btn-refresh" class="icon-btn" title="Refresh page" aria-label="Refresh page">
48 <button id="btn-refresh" class="icon-btn icon-only" title="Refresh page" aria-label="Refresh page">
49 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
49 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
50 stroke-linecap="round" stroke-linejoin="round">
50 stroke-linecap="round" stroke-linejoin="round">
51 <polyline points="23 4 23 10 17 10" />
51 <polyline points="23 4 23 10 17 10" />
52 <polyline points="1 20 1 14 7 14" />
52 <polyline points="1 20 1 14 7 14" />
53 <path d="M3.51 9a9 9 0 0 1 14.13-3.36L23 10M1 14l5.36 4.36A9 9 0 0 0 20.49 15" />
53 <path d="M3.51 9a9 9 0 0 1 14.13-3.36L23 10M1 14l5.36 4.36A9 9 0 0 0 20.49 15" />
54 </svg>
54 </svg>
55 Refresh
56 </button>
55 </button>
57
56
58 <div id="top-search" class="top-search" role="search">
57 <div id="top-search" class="top-search" role="search">
59 <input id="top-search-input" type="text" placeholder="Search files" aria-label="Search files" />
58 <input id="top-search-input" type="text" placeholder="Search files" aria-label="Search files" />
60 <button id="btn-search" class="icon-btn" title="Search files" aria-label="Search files">
59 <button id="btn-search" class="icon-btn icon-only" title="Search files" aria-label="Search files">
61 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
60 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
62 stroke-linecap="round" stroke-linejoin="round">
61 stroke-linecap="round" stroke-linejoin="round">
63 <circle cx="11" cy="11" r="8" />
62 <circle cx="11" cy="11" r="8" />
64 <line x1="21" y1="21" x2="16.65" y2="16.65" />
63 <line x1="21" y1="21" x2="16.65" y2="16.65" />
65 </svg>
64 </svg>
66 Search
67 </button>
65 </button>
68 </div>
66 </div>
69
67
70 <button id="btn-upload" class="icon-btn" title="Upload files" aria-label="Upload files">
71 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
72 stroke-linecap="round" stroke-linejoin="round">
73 <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
74 <polyline points="17 8 12 3 7 8" />
75 <line x1="12" y1="3" x2="12" y2="15" />
76 </svg>
77 Upload
78 </button>
79 <input id="file-input" type="file" multiple class="hidden" aria-hidden="true" />
68 <input id="file-input" type="file" multiple class="hidden" aria-hidden="true" />
80 <input id="folder-input" type="file" webkitdirectory directory multiple class="hidden" aria-hidden="true" />
69 <input id="folder-input" type="file" webkitdirectory directory multiple class="hidden" aria-hidden="true" />
81
70
82 <button id="btn-upload-folder" class="icon-btn" title="Upload folder" aria-label="Upload folder">
71 <div class="topbar-dropdown" data-dropdown>
83 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
72 <button id="btn-upload-menu" class="icon-btn" title="Upload options" aria-label="Upload options" aria-expanded="false">
84 stroke-linecap="round" stroke-linejoin="round">
73 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
85 <path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
74 stroke-linecap="round" stroke-linejoin="round">
86 <path d="M12 11v6" />
75 <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
87 <path d="M9 14h6" />
76 <polyline points="17 8 12 3 7 8" />
88 </svg>
77 <line x1="12" y1="3" x2="12" y2="15" />
89 Folder
78 </svg>
90 </button>
79 Upload
91
80 </button>
92 <button id="btn-new-folder" class="icon-btn" title="Create new folder" aria-label="Create new folder">
81 <div class="topbar-dropdown-menu" role="menu" aria-label="Upload actions">
93 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
82 <button id="btn-upload" class="topbar-menu-item" type="button" role="menuitem">Upload file</button>
94 stroke-linecap="round" stroke-linejoin="round">
83 <button id="btn-upload-folder" class="topbar-menu-item" type="button" role="menuitem">Upload folder</button>
95 <path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
84 <button id="btn-new-folder" class="topbar-menu-item" type="button" role="menuitem">New folder</button>
96 <path d="M12 11v6" />
85 </div>
97 <path d="M9 14h6" />
86 </div>
98 </svg>
99 New Folder
100 </button>
101
102 <button id="btn-admin" class="icon-btn hidden" title="Admin panel" aria-label="Admin panel">
103 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
104 stroke-linecap="round" stroke-linejoin="round">
105 <circle cx="12" cy="8" r="4" />
106 <path d="M6 20v-2a6 6 0 0 1 12 0v2" />
107 </svg>
108 <span class="icon-btn-label">Admin</span>
109 <span id="admin-update-badge" class="topbar-badge hidden" aria-hidden="true"></span>
110 </button>
111
87
112 <button id="btn-logout" class="icon-btn" title="Sign out" aria-label="Sign out">
88 <div class="topbar-dropdown" data-dropdown>
113 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
89 <button id="btn-user-menu" class="icon-btn" title="User menu" aria-label="User menu" aria-expanded="false">
114 stroke-linecap="round" stroke-linejoin="round">
90 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
115 <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
91 stroke-linecap="round" stroke-linejoin="round">
116 <polyline points="16 17 21 12 16 7" />
92 <circle cx="12" cy="8" r="4" />
117 <line x1="21" y1="12" x2="9" y2="12" />
93 <path d="M6 20v-2a6 6 0 0 1 12 0v2" />
118 </svg>
94 </svg>
119 Sign out
95 <span id="user-menu-label">User</span>
120 </button>
96 <span id="admin-update-badge" class="topbar-badge hidden" aria-hidden="true"></span>
97 </button>
98 <div class="topbar-dropdown-menu topbar-dropdown-menu--right" role="menu" aria-label="User actions">
99 <button id="btn-admin" class="topbar-menu-item hidden" type="button" role="menuitem" title="Admin panel" aria-label="Admin panel">
100 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
101 stroke-linecap="round" stroke-linejoin="round">
102 <rect x="3" y="11" width="18" height="11" rx="2" ry="2" />
103 <path d="M7 11V7a5 5 0 0 1 10 0v4" />
104 </svg>
105 Admin
106 </button>
107 <button id="btn-logout" class="topbar-menu-item" type="button" role="menuitem" title="Sign out" aria-label="Sign out">
108 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
109 stroke-linecap="round" stroke-linejoin="round">
110 <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
111 <polyline points="16 17 21 12 16 7" />
112 <line x1="21" y1="12" x2="9" y2="12" />
113 </svg>
114 Sign out
115 </button>
116 </div>
117 </div>
121 </div>
118 </div>
122 </header>
119 </header>
123
120
public/style.css +74 −0
@@ -225,6 +225,10 @@ button.danger.admin-update-highlight {
225 225 flex-shrink: 0;
226 226 }
227 227
228 #topbar > #btn-refresh {
229 flex: 0 0 auto;
230 }
231
228 232 #breadcrumb-wrap {
229 233 flex: 1;
230 234 min-width: 0;
@@ -269,6 +273,59 @@ button.danger.admin-update-highlight {
269 273 align-items: center;
270 274 gap: 0.25rem;
271 275 flex-shrink: 0;
276 position: relative;
277 }
278
279 .topbar-dropdown {
280 position: relative;
281 }
282
283 .topbar-dropdown-menu {
284 position: absolute;
285 top: calc(100% + 0.4rem);
286 left: 0;
287 min-width: 180px;
288 background: var(--surface);
289 border: 1px solid var(--border);
290 border-radius: var(--radius);
291 box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
292 padding: 0.35rem;
293 z-index: 140;
294 display: none;
295 }
296
297 .topbar-dropdown-menu--right {
298 left: auto;
299 right: 0;
300 }
301
302 .topbar-dropdown.open .topbar-dropdown-menu {
303 display: flex;
304 flex-direction: column;
305 gap: 0.2rem;
306 }
307
308 .topbar-menu-item {
309 display: flex;
310 align-items: center;
311 gap: 0.48rem;
312 width: 100%;
313 background: transparent;
314 color: var(--text-muted);
315 border-radius: 6px;
316 padding: 0.45rem 0.55rem;
317 text-align: left;
318 }
319
320 .topbar-menu-item svg {
321 width: 16px;
322 height: 16px;
323 flex: 0 0 auto;
324 }
325
326 .topbar-menu-item:hover {
327 background: var(--surface2);
328 color: var(--text);
272 329 }
273 330
274 331 .top-search {
@@ -1167,6 +1224,10 @@ button.danger.admin-update-highlight {
1167 1224 flex-direction: column;
1168 1225 }
1169 1226
1227 #topbar > #btn-refresh {
1228 align-self: flex-start;
1229 }
1230
1170 1231 #breadcrumb-wrap {
1171 1232 width: 100%;
1172 1233 }
@@ -1189,6 +1250,19 @@ button.danger.admin-update-highlight {
1189 1250 width: auto;
1190 1251 }
1191 1252
1253 .topbar-dropdown-menu {
1254 position: fixed;
1255 top: calc(var(--topbar-h) + 0.35rem);
1256 left: 0.6rem;
1257 right: 0.6rem;
1258 min-width: 0;
1259 }
1260
1261 .topbar-dropdown-menu--right {
1262 left: 0.6rem;
1263 right: 0.6rem;
1264 }
1265
1192 1266 .icon-btn {
1193 1267 padding: 0.4rem 0.55rem;
1194 1268 font-size: 0.82rem;
@@ -225,6 +225,10 @@ button.danger.admin-update-highlight {
225 flex-shrink: 0;
225 flex-shrink: 0;
226}
226}
227
227
228#topbar > #btn-refresh {
229 flex: 0 0 auto;
230}
231
228#breadcrumb-wrap {
232#breadcrumb-wrap {
229 flex: 1;
233 flex: 1;
230 min-width: 0;
234 min-width: 0;
@@ -269,6 +273,59 @@ button.danger.admin-update-highlight {
269 align-items: center;
273 align-items: center;
270 gap: 0.25rem;
274 gap: 0.25rem;
271 flex-shrink: 0;
275 flex-shrink: 0;
276 position: relative;
277}
278
279.topbar-dropdown {
280 position: relative;
281}
282
283.topbar-dropdown-menu {
284 position: absolute;
285 top: calc(100% + 0.4rem);
286 left: 0;
287 min-width: 180px;
288 background: var(--surface);
289 border: 1px solid var(--border);
290 border-radius: var(--radius);
291 box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
292 padding: 0.35rem;
293 z-index: 140;
294 display: none;
295}
296
297.topbar-dropdown-menu--right {
298 left: auto;
299 right: 0;
300}
301
302.topbar-dropdown.open .topbar-dropdown-menu {
303 display: flex;
304 flex-direction: column;
305 gap: 0.2rem;
306}
307
308.topbar-menu-item {
309 display: flex;
310 align-items: center;
311 gap: 0.48rem;
312 width: 100%;
313 background: transparent;
314 color: var(--text-muted);
315 border-radius: 6px;
316 padding: 0.45rem 0.55rem;
317 text-align: left;
318}
319
320.topbar-menu-item svg {
321 width: 16px;
322 height: 16px;
323 flex: 0 0 auto;
324}
325
326.topbar-menu-item:hover {
327 background: var(--surface2);
328 color: var(--text);
272}
329}
273
330
274.top-search {
331.top-search {
@@ -1167,6 +1224,10 @@ button.danger.admin-update-highlight {
1167 flex-direction: column;
1224 flex-direction: column;
1168 }
1225 }
1169
1226
1227 #topbar > #btn-refresh {
1228 align-self: flex-start;
1229 }
1230
1170 #breadcrumb-wrap {
1231 #breadcrumb-wrap {
1171 width: 100%;
1232 width: 100%;
1172 }
1233 }
@@ -1189,6 +1250,19 @@ button.danger.admin-update-highlight {
1189 width: auto;
1250 width: auto;
1190 }
1251 }
1191
1252
1253 .topbar-dropdown-menu {
1254 position: fixed;
1255 top: calc(var(--topbar-h) + 0.35rem);
1256 left: 0.6rem;
1257 right: 0.6rem;
1258 min-width: 0;
1259 }
1260
1261 .topbar-dropdown-menu--right {
1262 left: 0.6rem;
1263 right: 0.6rem;
1264 }
1265
1192 .icon-btn {
1266 .icon-btn {
1193 padding: 0.4rem 0.55rem;
1267 padding: 0.4rem 0.55rem;
1194 font-size: 0.82rem;
1268 font-size: 0.82rem;