feat(audio-player): Resume Rewind select in the settings popover
Release / build-and-push (push) Successful in 4m43s
Release / build-and-push (push) Successful in 4m43s
The player window could only change Skip and Speed; resume rewind lived exclusively on the profile page. The user-facing settings now match Speed's precedent — changeable from the player, saved to the account, applied immediately. The select mirrors the default-speed row (CSP-safe @change bound to one Alpine method; templ emits the option list from the shared ResumeRewindOptions allow-list and the :selected expression against the live resumeRewind field). Applying updates the running player's value first — the next open/unpause uses it with no reload — then PUTs audio_resume_rewind_seconds to the profile endpoint as the string wire shape the server binds. normalizeResumeRewind gates the select's value through 0/5/10 before both steps.
This commit is contained in:
1 parent
ef827a3a05
commit
fbdd4ab9f9
4 files changed
+142
-40
No files matched your search
@@ -255,6 +255,25 @@ templ AudioReader(user User, metadata ReaderMetadata) {
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<!-- Resume rewind — player-side control of the
|
||||
account setting (the profile page keeps
|
||||
its select; same PUT, applied live). -->
|
||||
<div class="flex items-center justify-between gap-3 px-1 py-2 rounded-lg">
|
||||
<span class="text-sm" style="color: var(--text-secondary);">Resume rewind</span>
|
||||
<select
|
||||
class="text-xs rounded-md px-1.5 py-1"
|
||||
style="background-color: var(--surface-hover); color: var(--text-primary); border: 1px solid var(--border);"
|
||||
aria-label="Resume rewind"
|
||||
@change="applyResumeRewindFromSelect($event)"
|
||||
>
|
||||
for _, secs := range ResumeRewindOptions {
|
||||
<option
|
||||
value={ fmt.Sprintf("%d", secs) }
|
||||
:selected={ fmt.Sprintf("resumeRewind === %d", secs) }
|
||||
>{ ResumeRewindLabel(secs) }</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
Reference in new issue
Block a user