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
3 changes: 3 additions & 0 deletions app/routers/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
logger = logging.getLogger(__name__)
router = APIRouter(prefix="/api/settings", tags=["settings"])

# Every key in this list must also appear in the `sf` object in static/js/app.js,
# and every key in `sf` that needs server persistence must appear here.
# Mismatch = silent data loss: server drops unknown keys on PATCH and never returns them on GET.
EXPOSED_KEYS = [
"pushover_user_key",
"pushover_app_token",
Expand Down
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ <h3>No ratings yet</h3>
<div class="flex gap-2 mt-3">
<button class="btn btn-primary btn-sm" @click="saveSettings()">💾 Save</button>
</div>
<div class="text-xs text-muted mt-2">Changes apply immediately. Save to persist across sessions.</div>
<div class="text-xs text-muted mt-2">Changes apply and save immediately.</div>
</div>


Expand Down
7 changes: 7 additions & 0 deletions static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ function app() {
this.$watch('ratingsStatusFilter', val => { localStorage.setItem('ratings_status_filter', val); });
this.$watch('viewMode', val => { this.sf.default_view_mode = val; this.saveSettingsSilent(); });
this.$watch('feedGrouped', val => { this.sf.default_feed_grouped = val ? 'true' : 'false'; this.saveSettingsSilent(); });
this.$watch('sf.accent_color', () => this.saveSettingsSilent());
this.$watch('sf.font_scale', () => this.saveSettingsSilent());
this.$watch('sf.card_radius', () => this.saveSettingsSilent());
this.$watch('sf.sidebar_width', () => {
clearTimeout(this._sidebarSaveTimer);
this._sidebarSaveTimer = setTimeout(() => this.saveSettingsSilent(), 500);
});
window.addEventListener('hashchange', () => {
const p = location.hash.slice(1);
if (validPages.includes(p) && p !== this.page) this.page = p;
Expand Down
Loading