feat(profile): keep_screen_awake user preference (default on)

New users column surfaced as an On/Off dropdown in the profile form.
The form and API carry "true"/"false" strings with the theme-style
""-guard, so JSON clients that omit the field can't clobber it;
anything else is rejected. GET/PUT /api/auth/profile expose
keep_screen_awake alongside the other profile fields, and the reader
route threads the preference into its template metadata.

Integration tests pin the schema default, both values, omission
semantics, and rejection — dedicated test user, never testuser.
This commit is contained in:
John O'Keefe committed 2026-10-26 13:59:32 -04:00
1 parent bdb9132b85
commit c645b8e207
12 files changed
+244 -67

No files matched your search

+5
View File
@@ -20,6 +20,8 @@ type User struct {
// User-level default audiobook playback speed (plan §8); 0 means
// "unset" and renders as the 1× option.
DefaultAudioSpeed float64
// Whether the web reader/player should hold a Screen Wake Lock.
KeepScreenAwake bool
}
// SpeedOption is one entry of the default-playback-speed select — the
@@ -289,6 +291,9 @@ type ReaderMetadata struct {
// TreatAsComic: fixed-layout item in a comics/manga library gets
// comic reader treatment (bookmarks only — no highlights, no search).
TreatAsComic bool `json:"treat_as_comic"`
// KeepScreenAwake: user preference — the reader holds a Screen Wake
// Lock while open when true.
KeepScreenAwake bool `json:"keep_screen_awake"`
}
type ReadingProgress struct {