|
@@ -277,6 +277,17 @@ function filterAndSortFiles(
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// Keep the filename useful when fixed columns consume the available width,
|
|
|
|
|
+// and give the header spacer and row checkbox one shared track so every later
|
|
|
|
|
+// column stays aligned. min-w-min lets each auth variant size itself to its
|
|
|
|
|
+// intrinsic grid width inside the overflow-x-auto wrapper (#3105). Tags get a
|
|
|
|
|
+// floor too: with a 0 minimum they took the squeeze the filename used to take,
|
|
|
|
|
+// hitting 0px right where the wrapper starts scrolling.
|
|
|
|
|
+const fileListGridColumns = (authEnabled: boolean) => authEnabled
|
|
|
|
|
+ ? 'grid-cols-[24px_minmax(240px,1fr)_120px_100px_100px_100px_minmax(96px,200px)_220px]'
|
|
|
|
|
+ : 'grid-cols-[24px_minmax(240px,1fr)_100px_100px_100px_minmax(96px,200px)_220px]';
|
|
|
|
|
+const fileListGridMinWidth = 'min-w-min';
|
|
|
|
|
+
|
|
|
// New Folder Modal
|
|
// New Folder Modal
|
|
|
interface NewFolderModalProps {
|
|
interface NewFolderModalProps {
|
|
|
parentId: number | null;
|
|
parentId: number | null;
|
|
@@ -3628,7 +3639,10 @@ export function FileManagerPage() {
|
|
|
grids that compute `min-content` independently — the header's empty
|
|
grids that compute `min-content` independently — the header's empty
|
|
|
trailing div resolved to 0px, leaving body columns shifted left of
|
|
trailing div resolved to 0px, leaving body columns shifted left of
|
|
|
their headers. Fixed width keeps header and body in lockstep. */}
|
|
their headers. Fixed width keeps header and body in lockstep. */}
|
|
|
- <div className={`hidden sm:grid ${authEnabled ? 'grid-cols-[auto_1fr_120px_100px_100px_100px_minmax(0,200px)_220px]' : 'grid-cols-[auto_1fr_100px_100px_100px_minmax(0,200px)_220px]'} gap-4 px-4 py-2 bg-bambu-dark-secondary border-b border-bambu-dark-tertiary text-xs text-bambu-gray font-medium`}>
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ data-testid="file-list-grid-header"
|
|
|
|
|
+ className={`hidden sm:grid ${fileListGridColumns(authEnabled)} ${fileListGridMinWidth} gap-4 px-4 py-2 bg-bambu-dark-secondary border-b border-bambu-dark-tertiary text-xs text-bambu-gray font-medium`}
|
|
|
|
|
+ >
|
|
|
<div className="w-6" />
|
|
<div className="w-6" />
|
|
|
<div>{t('common.name')}</div>
|
|
<div>{t('common.name')}</div>
|
|
|
{authEnabled && <div>{t('fileManager.uploadedBy', { defaultValue: 'Uploaded By' })}</div>}
|
|
{authEnabled && <div>{t('fileManager.uploadedBy', { defaultValue: 'Uploaded By' })}</div>}
|
|
@@ -3642,7 +3656,8 @@ export function FileManagerPage() {
|
|
|
{filteredAndSortedFiles.map((file) => (
|
|
{filteredAndSortedFiles.map((file) => (
|
|
|
<div
|
|
<div
|
|
|
key={file.id}
|
|
key={file.id}
|
|
|
- className={`grid ${authEnabled ? 'grid-cols-[auto_1fr_120px_100px_100px_100px_minmax(0,200px)_220px]' : 'grid-cols-[auto_1fr_100px_100px_100px_minmax(0,200px)_220px]'} gap-4 px-4 py-3 items-center border-b border-bambu-dark-tertiary last:border-b-0 cursor-pointer hover:bg-bambu-dark/50 transition-colors ${
|
|
|
|
|
|
|
+ data-testid="file-list-grid-row"
|
|
|
|
|
+ className={`grid ${fileListGridColumns(authEnabled)} ${fileListGridMinWidth} gap-4 px-4 py-3 items-center border-b border-bambu-dark-tertiary last:border-b-0 cursor-pointer hover:bg-bambu-dark/50 transition-colors ${
|
|
|
selectedFiles.includes(file.id) ? 'bg-bambu-green/10' : ''
|
|
selectedFiles.includes(file.id) ? 'bg-bambu-green/10' : ''
|
|
|
}`}
|
|
}`}
|
|
|
onClick={() => handleFileSelect(file.id)}
|
|
onClick={() => handleFileSelect(file.id)}
|
|
@@ -3749,9 +3764,9 @@ export function FileManagerPage() {
|
|
|
{/* Prints */}
|
|
{/* Prints */}
|
|
|
<div className="text-sm text-bambu-gray">{file.print_count > 0 ? `${file.print_count}x` : '-'}</div>
|
|
<div className="text-sm text-bambu-gray">{file.print_count > 0 ? `${file.print_count}x` : '-'}</div>
|
|
|
{/* Tags (#1268) — clickable chips push into the active
|
|
{/* Tags (#1268) — clickable chips push into the active
|
|
|
- filter; minmax(0,200px) on the column lets the cell
|
|
|
|
|
- shrink/wrap on narrow viewports without pushing the
|
|
|
|
|
- Actions cell off-screen. */}
|
|
|
|
|
|
|
+ filter; minmax(96px,200px) on the column lets the cell
|
|
|
|
|
+ shrink/wrap on narrow viewports, and the 96px floor
|
|
|
|
|
+ keeps chips readable once the wrapper scrolls (#3105). */}
|
|
|
<div className="min-w-0" {...stopRowActivation}>
|
|
<div className="min-w-0" {...stopRowActivation}>
|
|
|
{!file.tags || file.tags.length === 0 ? (
|
|
{!file.tags || file.tags.length === 0 ? (
|
|
|
<span className="text-xs text-bambu-gray/50">-</span>
|
|
<span className="text-xs text-bambu-gray/50">-</span>
|