Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 41 additions & 17 deletions app/src/main/assets/generator/generator.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@
margin-top: 14px;
background: var(--surface);
border-radius: var(--radius);
padding: 20px;
padding: 20px 20px 32px; /* extra bottom clears tick labels */
border: none;
overflow: visible; /* never clip tick labels at card edges */
box-shadow: 0 1px 4px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.14);
animation: slideUp 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
Expand All @@ -136,6 +137,9 @@
.opt-common {
margin-top: 16px;
padding-top: 16px;
/* Increased from 8px → 20px so the tick labels below the slider
are never clipped by the card bottom edge on any screen size. */
padding-bottom: 20px;
box-shadow: inset 0 1px 0 var(--divider);
}

Expand Down Expand Up @@ -230,27 +234,25 @@
.gen-slider-wrap {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 6px;
}

.gen-slider-edge {
font-size: 11px;
color: var(--text3);
font-weight: 600;
flex-shrink: 0;
width: 18px;
text-align: center;
/* Increased from 6px → 10px for a little extra breathing room
between the slider thumb and the tick labels below it. */
margin-bottom: 10px;
}

/* Native range input — themed for Material You dark */
.gen-slider {
flex: 1;
width: 100%; /* ensure full-width within flex container */
-webkit-appearance: none;
appearance: none;
height: 4px;
border-radius: 2px;
background: var(--md-outline-variant);
/* Base track colour — ONLY the ::webkit-slider-runnable-track pseudo
gets the filled gradient (via --slider-pct). Do NOT set a
background shorthand here: it would override the track pseudo rule
in some Android WebView versions and cause the filled portion to
render in a different coordinate space from the thumb. */
background: transparent;
outline: none;
cursor: pointer;
position: relative;
Expand Down Expand Up @@ -302,20 +304,42 @@
cursor: pointer;
}

/* Tick labels below slider */
/* Tick labels below slider
*
* KEY ALIGNMENT FIX:
* Each <span> has width:0 so space-between distributes them by
* their zero-width points, not their text boxes. The first span
* is placed at the left padding edge (= thumb-radius = 11px) and
* the last at the right padding edge, matching EXACTLY where the
* browser positions the thumb at min and max values.
* text-align:center + overflow:visible lets the label text float
* symmetrically on both sides of the tick point, so "15" reads
* centred under the thumb at value 15, with zero left/right drift.
*/
.gen-slider-ticks {
display: flex;
justify-content: space-between;
padding: 0 14px;
/* padding-left/right = thumb-radius (22px ÷ 2 = 11px) so the
first and last tick points sit directly under the min/max
thumb stop, matching the exact coordinates the browser uses. */
padding: 0 11px;
padding-bottom: 24px; /* extra room so "5"/"35" are never clipped */
margin-top: 2px;
margin-bottom: 4px;
margin-bottom: 0;
overflow: visible; /* never clip tick text against parent edges */
}
.gen-slider-ticks span {
font-size: 10px;
color: var(--text3);
font-weight: 500;
width: 20px;
/* width:0 — tick point has no physical width so space-between
places centers at perfectly equal intervals that match the
slider thumb's horizontal travel. Text overflows visually
via overflow:visible + white-space:nowrap. */
width: 0;
text-align: center;
overflow: visible;
white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
Expand Down
8 changes: 3 additions & 5 deletions app/src/main/assets/generator/generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</div>
<div class="gen-mode-text">
<div class="gen-mode-name">My Mix</div>
<div class="gen-mode-desc">Smart blend of top, recent &amp; similar</div>
<div class="gen-mode-desc">Smart blend of top, recent & similar</div>
</div>
<span class="material-symbols-rounded gen-mode-chevron">chevron_right</span>
</div>
Expand Down Expand Up @@ -174,15 +174,15 @@
<button class="chip" onclick="setTag('metal')">metal</button>
<button class="chip" onclick="setTag('indie')">indie</button>
<button class="chip" onclick="setTag('classical')">classical</button>
<button class="chip" onclick="setTag('r&b')">r&amp;b</button>
<button class="chip" onclick="setTag('r&b')">r&b</button>
<button class="chip" onclick="setTag('ambient')">ambient</button>
<button class="chip" onclick="setTag('punk')">punk</button>
</div>
</div>

<!-- Mix options — count handled by shared slider below -->
<div id="opts-mix" class="opt-section hidden">
<div class="opt-label" style="color:var(--text2);font-size:11px">Mix includes: top tracks, recent plays &amp; similar artists' tracks.</div>
<div class="opt-label" style="color:var(--text2);font-size:11px">Mix includes: top tracks, recent plays & similar artists' tracks.</div>
</div>

<!-- Recommendations options — count handled by shared slider below -->
Expand All @@ -209,7 +209,6 @@
Track Count: <span id="genSliderValue">25</span>
</div>
<div class="gen-slider-wrap">
<span class="gen-slider-edge">5</span>
<input
type="range"
id="genTrackSlider"
Expand All @@ -218,7 +217,6 @@
oninput="selectSliderCount(this.value)"
aria-label="Track count"
/>
<span class="gen-slider-edge">35</span>
</div>
<div class="gen-slider-ticks" aria-hidden="true">
<span>5</span><span>10</span><span>15</span><span>20</span><span>25</span><span>30</span><span>35</span>
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/assets/generator/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ function selectChip(el, group) {
// ── Unified track count slider ────────────────────────────────
function selectSliderCount(val) {
const n = Math.max(5, Math.min(35, parseInt(val) || 25));
// pct drives ONLY the CSS custom property used by the ::webkit-slider-runnable-track
// rule in generator.css. We must NOT also set slider.style.background inline —
// that paints the element box (which ignores thumb margin-top) and creates a
// visible offset between the filled portion and the thumb position.
const pct = ((n - 5) / 30 * 100).toFixed(1) + '%';
state.chipSelections.count = String(n);
state.chipSelections.limit = String(n);
Expand All @@ -102,9 +106,13 @@ function selectSliderCount(val) {
if (label) label.textContent = n;
if (slider) {
if (slider.value !== String(n)) slider.value = n;
// Drive the track-fill via CSS custom property so the gradient
// is painted on the ::webkit-slider-runnable-track, which shares
// the same coordinate space as the thumb — zero alignment drift.
slider.style.setProperty('--slider-pct', pct);
slider.style.background =
`linear-gradient(to right,var(--md-primary) 0%,var(--md-primary) ${pct},var(--md-outline-variant) ${pct},var(--md-outline-variant) 100%)`;
// Clear any stale inline background that may have been written by
// an older version of this function (prevents override of the CSS rule).
slider.style.background = '';
}
}

Expand Down
36 changes: 34 additions & 2 deletions app/src/main/assets/playlist/playlist.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,35 @@
}

.pl-card-actions {
display: flex; gap: 10px; padding: 10px 16px 14px;
box-shadow: inset 0 1px 0 var(--divider); flex-wrap: wrap;
display: none; /* hidden by default — shown only when expanded */
gap: 8px;
padding: 10px 12px 14px; /* top padding creates visual separation from track list */
box-shadow: inset 0 1px 0 var(--divider);
flex-wrap: nowrap; /* all buttons stay in ONE horizontal row — no wrapping */
align-items: center;
/* ── Horizontal scroll: user swipes to reach all 4 buttons ── */
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch; /* smooth momentum scroll in Android WebView */
scrollbar-width: none; /* hide scrollbar (Firefox) */
}

/* Hide webkit scrollbar — keep the row visually clean */
.pl-card-actions::-webkit-scrollbar {
display: none;
}

/* Reveal when the card is expanded (Issue 5 — hidden by default) */
.pl-card.expanded .pl-card-actions {
display: flex;
}

/* Buttons: natural (auto) width so long labels like "Generate Similar" don't break */
.pl-card.expanded .pl-card-actions .pl-card-action-btn {
flex: 0 0 auto; /* do NOT grow/shrink — stay at natural content width */
justify-content: center;
padding: 9px 14px;
font-size: 13px;
}
.pl-card-action-btn {
display: inline-flex; align-items: center; gap: 7px;
Expand All @@ -170,6 +197,11 @@
background: var(--accent-dim); color: var(--accent); border: none;
}
.pl-card-action-btn.regen:active { background: var(--accent-tonal); }
.pl-card-action-btn.similar {
background: var(--accent-dim); color: var(--accent);
border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.pl-card-action-btn.similar:active { background: var(--accent-tonal); }

/* ── Track list — smooth height animation ─────────────────── */
/* Uses grid-template-rows trick: reliable on Android WebView,
Expand Down
Loading
Loading