fix(browser): align list columns via subgrid and fix icon sizing
Lint & Test / test (push) Successful in 10s
Lint & Test / test (push) Successful in 10s
- Switch .browser-list to CSS grid + subgrid so header and rows share the same column track widths, eliminating misaligned columns when content widths differ between rows. - Apply matching responsive column overrides at the parent grid level. - Override root-folder SVG sizing (hardcoded 24x24 in browser.js) so it fills the 56px icon box instead of rendering at ~43%. - Make compact grid icon fill its thumb wrapper so the emoji centers instead of being stranded in the top-left corner. - Remove premature isConnected bail in loadThumbnail; the img element is intentionally detached when called from renderBrowserGrid/List. Post-await checks already handle navigation-away correctly.
This commit is contained in:
@@ -3077,19 +3077,25 @@ button.primary svg {
|
|||||||
|
|
||||||
/* Browser List View */
|
/* Browser List View */
|
||||||
.browser-list {
|
.browser-list {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-direction: column;
|
grid-template-columns: 40px 1fr auto auto auto auto;
|
||||||
gap: 1px;
|
column-gap: 1.25rem;
|
||||||
|
row-gap: 1px;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.browser-list > .browser-empty,
|
||||||
|
.browser-list > .browser-loading {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* List view column header */
|
/* List view column header */
|
||||||
.browser-list-header {
|
.browser-list-header {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 40px 1fr auto auto auto auto;
|
grid-template-columns: subgrid;
|
||||||
|
grid-column: 1 / -1;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.75rem;
|
|
||||||
padding: 0.4rem 0.75rem;
|
padding: 0.4rem 0.75rem;
|
||||||
font-size: 0.688rem;
|
font-size: 0.688rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -3107,9 +3113,9 @@ button.primary svg {
|
|||||||
|
|
||||||
.browser-list-item {
|
.browser-list-item {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 40px 1fr auto auto auto auto;
|
grid-template-columns: subgrid;
|
||||||
|
grid-column: 1 / -1;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.75rem;
|
|
||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
@@ -3303,6 +3309,13 @@ button.primary svg {
|
|||||||
transition: all 0.25s;
|
transition: all 0.25s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Root folder SVG ships with hardcoded width=24 height=24 (browser.js folderSvg),
|
||||||
|
which renders at ~43% of the 56px icon box. Override to fill it properly. */
|
||||||
|
.browser-item.browser-root-folder .browser-icon > svg {
|
||||||
|
width: 60%;
|
||||||
|
height: 60%;
|
||||||
|
}
|
||||||
|
|
||||||
.browser-item.browser-root-folder:hover .browser-icon {
|
.browser-item.browser-root-folder:hover .browser-icon {
|
||||||
background: rgba(var(--copper-rgb), 0.18);
|
background: rgba(var(--copper-rgb), 0.18);
|
||||||
border-color: rgba(var(--copper-rgb), 0.3);
|
border-color: rgba(var(--copper-rgb), 0.3);
|
||||||
@@ -3650,9 +3663,12 @@ button.primary svg {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.browser-list-header {
|
.browser-list {
|
||||||
grid-template-columns: 32px 1fr auto auto;
|
grid-template-columns: 32px 1fr auto auto;
|
||||||
gap: 0.5rem;
|
column-gap: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.browser-list-header {
|
||||||
padding: 0.35rem 0.5rem;
|
padding: 0.35rem 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3661,8 +3677,6 @@ button.primary svg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.browser-list-item {
|
.browser-list-item {
|
||||||
grid-template-columns: 32px 1fr auto auto;
|
|
||||||
gap: 0.5rem;
|
|
||||||
padding: 0.4rem 0.5rem;
|
padding: 0.4rem 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3732,17 +3746,13 @@ button.primary svg {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.browser-list-header {
|
.browser-list {
|
||||||
grid-template-columns: 40px 1fr auto auto auto;
|
grid-template-columns: 40px 1fr auto auto auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.browser-list-header span:nth-child(3) {
|
.browser-list-header span:nth-child(3) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.browser-list-item {
|
|
||||||
grid-template-columns: 40px 1fr auto auto auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update Banner */
|
/* Update Banner */
|
||||||
@@ -7405,9 +7415,15 @@ select option {
|
|||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
letter-spacing: 0.1em;
|
letter-spacing: 0.1em;
|
||||||
}
|
}
|
||||||
|
/* Let the compact icon fill its thumb-wrapper (matches grid view behaviour).
|
||||||
|
The previous 28x28 size left the icon stranded at the wrapper's top-left
|
||||||
|
because .browser-thumb-wrapper is not a flex container. The wrapper square
|
||||||
|
is sized by the grid; the emoji inside .browser-icon centers via the base
|
||||||
|
flex rules. */
|
||||||
.browser-container .browser-grid-compact .browser-icon {
|
.browser-container .browser-grid-compact .browser-icon {
|
||||||
width: 28px;
|
width: 100%;
|
||||||
height: 28px;
|
height: 100%;
|
||||||
|
font-size: 2.25rem;
|
||||||
}
|
}
|
||||||
.browser-container .browser-item {
|
.browser-container .browser-item {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
|
|||||||
@@ -537,9 +537,10 @@ async function loadThumbnail(imgElement, fileName) {
|
|||||||
const cacheKey = `${folderId}|${relPath}`;
|
const cacheKey = `${folderId}|${relPath}`;
|
||||||
try {
|
try {
|
||||||
if (!hasCredentials()) return;
|
if (!hasCredentials()) return;
|
||||||
// If the user navigates away before this fetch resolves, the imgElement
|
// Note: the imgElement is intentionally NOT in the DOM yet when
|
||||||
// may already be detached. Bail in that case.
|
// renderBrowserGrid/renderBrowserList call us — it's still inside a
|
||||||
if (!imgElement.isConnected) return;
|
// detached wrapper. Don't bail on isConnected here; rely on the
|
||||||
|
// post-await checks below, which correctly catch navigation away.
|
||||||
|
|
||||||
// Check cache first
|
// Check cache first
|
||||||
if (thumbnailCache.has(cacheKey)) {
|
if (thumbnailCache.has(cacheKey)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user