fix: Default view dropdown settings — 5 vues + style + persistence
- Select remplacé: class sort-select (mal stylé) → settings-select (adapté) - 5 vues: Tree, List, Details, Cards, Content (plus seulement 3) - x-model="defaultView" + @change="saveDefaultView()" - Sauvegarde localStorage 'fd_default_view' - workspace page lit localStorage pour viewMode initial - Settings → Default view persiste entre sessions et s'applique au workspace
This commit is contained in:
@@ -900,7 +900,7 @@ document.addEventListener('alpine:init', function() {
|
||||
|
||||
// Sort
|
||||
sortBy: '',
|
||||
viewMode: 'tree',
|
||||
viewMode: localStorage.getItem('fd_default_view') || 'tree',
|
||||
viewMenuOpen: false,
|
||||
viewIcons: {tree:'🌳',list:'📋',details:'📊',title:'🏷️',content:'📝'},
|
||||
viewLabels: {tree:'Tree',list:'List',details:'Details',title:'Cards',content:'Content'},
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
/* Close button */
|
||||
.settings-close{position:absolute;top:12px;right:12px;width:32px;height:32px;background:none;border:none;color:var(--text-dim);font-size:20px;cursor:pointer;border-radius:6px;display:flex;align-items:center;justify-content:center;}
|
||||
.settings-close:hover{background:var(--bg-hover);color:var(--text);}
|
||||
.settings-select{background:var(--bg-tertiary);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:6px 10px;font-size:13px;outline:none;cursor:pointer;min-width:140px;}
|
||||
.settings-select:focus{border-color:var(--accent);}
|
||||
</style>
|
||||
|
||||
<div class="settings-overlay" x-data="settingsInit()" @keydown.escape="window.history.back()">
|
||||
@@ -170,8 +172,12 @@
|
||||
<div class="setting-desc">Choose the default view for new pages</div>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<select class="sort-select">
|
||||
<option>Tree</option><option>List</option><option>Details</option>
|
||||
<select class="settings-select" x-model="defaultView" @change="saveDefaultView()">
|
||||
<option value="tree">🌳 Tree</option>
|
||||
<option value="list">📋 List</option>
|
||||
<option value="details">📊 Details</option>
|
||||
<option value="title">🏷️ Cards</option>
|
||||
<option value="content">📝 Content</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -265,6 +271,7 @@ document.addEventListener('alpine:init', function() {
|
||||
avatarUrl: '{{ avatar_url or "" }}',
|
||||
avatarColor: '{{ avatar_color or "#3A3A3A" }}',
|
||||
avatarColors: ['#E03E3E','#D9730D','#DFAB01','#0F7B6C','#0B6E99','#6940A5','#AD1A72','#E16259','#448361','#337EA9','#9065B0','#C94D8B','#787774','#3A3A3A'],
|
||||
defaultView: localStorage.getItem('fd_default_view') || 'tree',
|
||||
userInfo: {full_name: '{{ user.full_name or "" }}', login: '{{ user.login or "" }}', email: '{{ user.email or "" }}'},
|
||||
|
||||
async init() {
|
||||
@@ -323,6 +330,10 @@ document.addEventListener('alpine:init', function() {
|
||||
body: JSON.stringify({color: color})
|
||||
});
|
||||
if (r.ok) { this.avatarUrl = ''; }
|
||||
},
|
||||
|
||||
saveDefaultView() {
|
||||
localStorage.setItem('fd_default_view', this.defaultView);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user