feat: add view mode and scope selectors to Display settings tab
Task: task-14 Settings dialog — view mode selector and scope toggle
This commit is contained in:
@@ -1332,6 +1332,10 @@ function openSettings() {
|
||||
if (hoverDelayEl) hoverDelayEl.value = String(settings.hoverPreviewDelay);
|
||||
const gridColumnsEl = $('setting-grid-columns');
|
||||
if (gridColumnsEl) gridColumnsEl.value = String(settings.gridColumns);
|
||||
const viewModeEl = $('setting-view-mode');
|
||||
if (viewModeEl) viewModeEl.value = loadGridViewMode();
|
||||
const viewScopeEl = $('setting-view-scope');
|
||||
if (viewScopeEl) viewScopeEl.value = settings.viewPreferenceScope || 'local';
|
||||
|
||||
// Populate Notifications tab from display settings
|
||||
const bellSoundEl = $('setting-bell-sound');
|
||||
@@ -1784,6 +1788,24 @@ function bindStaticEventListeners() {
|
||||
on($('setting-font-size'), 'change', onDisplaySettingChange);
|
||||
on($('setting-hover-delay'), 'change', onDisplaySettingChange);
|
||||
on($('setting-grid-columns'), 'change', onDisplaySettingChange);
|
||||
on($('setting-view-mode'), 'change', function() {
|
||||
var el = $('setting-view-mode');
|
||||
if (el) {
|
||||
saveGridViewMode(el.value);
|
||||
renderGrid(_currentSessions || []);
|
||||
}
|
||||
});
|
||||
on($('setting-view-scope'), 'change', function() {
|
||||
var el = $('setting-view-scope');
|
||||
if (!el) return;
|
||||
var newScope = el.value;
|
||||
var currentMode = _gridViewMode;
|
||||
var ds = loadDisplaySettings();
|
||||
ds.viewPreferenceScope = newScope;
|
||||
saveDisplaySettings(ds);
|
||||
// Migrate current mode to new scope
|
||||
saveGridViewMode(currentMode);
|
||||
});
|
||||
|
||||
// Sessions settings — bind change events for server-side persistence
|
||||
on($('setting-default-session'), 'change', function() {
|
||||
|
||||
@@ -121,6 +121,21 @@
|
||||
<option value="4">4</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="settings-field">
|
||||
<label class="settings-label" for="setting-view-mode">View Mode</label>
|
||||
<select id="setting-view-mode" class="settings-select">
|
||||
<option value="flat">Flat</option>
|
||||
<option value="grouped">Grouped</option>
|
||||
<option value="filtered">Filtered</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="settings-field">
|
||||
<label class="settings-label" for="setting-view-scope">View Scope</label>
|
||||
<select id="setting-view-scope" class="settings-select">
|
||||
<option value="local">Local</option>
|
||||
<option value="server">Server</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-panel hidden" data-tab="sessions">
|
||||
<div class="settings-field">
|
||||
|
||||
Reference in New Issue
Block a user