fix: detail view layout — gap at top and scroll cutoff at bottom

Three changes:

1. Added box-sizing: border-box to :host of explore-artist-details,
   explore-album-details, and artist-details. The light DOM rule
   .main-panel > * sets this but shadow DOM may not inherit it.

2. Changed .main-panel to display: flex; flex-direction: column.
   In block layout, a height:0 hidden view could affect the
   position of the detail view below it. In flex column layout,
   the hidden view (flex:0) collapses completely and the active
   view (flex:1) fills the remaining space.

3. Changed .main-panel > * from height:100% to flex:1; min-height:0.
   In a flex column, flex:1 correctly fills available space while
   min-height:0 allows the content to shrink below its intrinsic
   size (needed for overflow:hidden to work).
This commit is contained in:
2026-03-30 03:56:13 -04:00
parent 76c8aee1dd
commit c7b859507d
4 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -142,13 +142,16 @@ body div.sidebar {
.main-panel {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
background-color: var(--yj-bg-surface, #212529);
overflow: hidden;
contain: layout style paint;
}
.main-panel > * {
height: 100%;
flex: 1;
min-height: 0;
box-sizing: border-box;
contain: layout style paint;
}
@@ -158,6 +161,7 @@ body div.sidebar {
display:none discards scroll state in WebKitGTK. */
.main-panel > .view-hidden {
visibility: hidden !important;
flex: 0 !important;
height: 0 !important;
overflow: hidden !important;
pointer-events: none !important;
@@ -42,6 +42,7 @@ export class ArtistDetails extends LitElement {
flex-direction: column;
overflow: hidden;
height: 100%;
box-sizing: border-box;
}
/* ====================================
@@ -90,6 +90,7 @@ export class ExploreAlbumDetails extends LitElement {
flex-direction: column;
overflow: hidden;
height: 100%;
box-sizing: border-box;
}
/* ── Header ── */
@@ -111,6 +111,7 @@ export class ExploreArtistDetails extends LitElement {
flex-direction: column;
overflow: hidden;
height: 100%;
box-sizing: border-box;
}
/* ── Header ── */