fix: auto-fit column width in Dashboard Files no longer scales with row count

Double-clicking a column resize handle is meant to fit the column to its
longest cell. The per-row loop did `maxWidth = Math.max(maxWidth + 10, textWidth)`,
which forces `maxWidth` to grow by at least 10px on every row regardless of
content — so a folder with N files produced a column ~10*N px wide and
persisted that runaway width to KV storage.

Compare against the running max only (`Math.max(maxWidth, textWidth)`);
`textWidth` already includes cell padding.
This commit is contained in:
jelveh
2026-07-16 19:50:36 -07:00
parent 6e92f2d3e6
commit 20ad435f62
+3 -3
View File
@@ -1456,7 +1456,7 @@ const TabFiles = {
const fullName = $(this).attr('data-name');
if ( fullName ) {
const textWidth = measureTextWidth(fullName) + padding;
maxWidth = Math.max(maxWidth + 10, textWidth);
maxWidth = Math.max(maxWidth, textWidth);
}
});
} else if ( column === 'size' ) {
@@ -1464,7 +1464,7 @@ const TabFiles = {
const text = $(this).text();
if ( text ) {
const textWidth = measureTextWidth(text) + padding;
maxWidth = Math.max(maxWidth + 10, textWidth);
maxWidth = Math.max(maxWidth, textWidth);
}
});
} else if ( column === 'modified' ) {
@@ -1472,7 +1472,7 @@ const TabFiles = {
const text = $(this).text();
if ( text ) {
const textWidth = measureTextWidth(text) + padding;
maxWidth = Math.max(maxWidth + 10, textWidth);
maxWidth = Math.max(maxWidth, textWidth);
}
});
}