diff --git a/index.html b/index.html index 9e51921..bad515e 100644 --- a/index.html +++ b/index.html @@ -908,7 +908,8 @@ function hasNext(tasks) { return tasks.some(t => t.status === 'next'); } // ── Sidebar nav ──────────────────────────────────────────────────────────────── function renderAppNav() { const q = appSearch.toLowerCase(); - const allApps = [...data.apps, { id: 'global', tasks: data.global || [] }]; + const globalEntry = { id: 'global', tasks: data.global || [] }; + const allApps = [globalEntry, ...data.apps]; const filtered = q ? allApps.filter(a => a.id.toLowerCase().includes(q)) : allApps; // Update total open count @@ -922,23 +923,40 @@ function renderAppNav() { const upd = document.getElementById('sidebarUpdatedLabel'); if (upd && data.updated) upd.textContent = `更新: ${data.updated}`; - let html = ''; - for (const app of filtered) { + // Sort: global first, then active apps (next > any open > done-only), then inactive apps (alpha) + const globalList = filtered.filter(a => a.id === 'global'); + const active = filtered.filter(a => a.id !== 'global' && openCount(a.tasks) > 0) + .sort((a, b) => (hasNext(b.tasks) ? 1 : 0) - (hasNext(a.tasks) ? 1 : 0)); + const inactive = filtered.filter(a => a.id !== 'global' && openCount(a.tasks) === 0) + .sort((a, b) => a.id.localeCompare(b.id)); + + function navItem(app) { const open = openCount(app.tasks); const hn = hasNext(app.tasks); const isActive = currentView === 'app' && currentApp === app.id; const countHtml = open > 0 ? `${open}` : ''; - html += ` + return ` ${shortName(app.id)} ${countHtml} `; } + + let html = ''; if (!filtered.length) { html = '
該当なし
'; + } else { + globalList.forEach(a => { html += navItem(a); }); + active.forEach(a => { html += navItem(a); }); + if (inactive.length) { + if (active.length || globalList.length) { + html += `
全アプリ
`; + } + inactive.forEach(a => { html += navItem(a); }); + } } document.getElementById('appNavList').innerHTML = html; diff --git a/roadmap.json b/roadmap.json index 7904068..0b1e5a7 100644 --- a/roadmap.json +++ b/roadmap.json @@ -207,7 +207,24 @@ "done_at": null } ] - } + }, + { "id": "posimai-dashboard", "tasks": [] }, + { "id": "posimai-brain", "tasks": [] }, + { "id": "posimai-daily", "tasks": [] }, + { "id": "posimai-reader", "tasks": [] }, + { "id": "posimai-journal", "tasks": [] }, + { "id": "posimai-site", "tasks": [] }, + { "id": "posimai-events", "tasks": [] }, + { "id": "posimai-maps", "tasks": [] }, + { "id": "posimai-ambient", "tasks": [] }, + { "id": "posimai-timer", "tasks": [] }, + { "id": "posimai-pulse", "tasks": [] }, + { "id": "posimai-lens", "tasks": [] }, + { "id": "posimai-diff", "tasks": [] }, + { "id": "posimai-clean", "tasks": [] }, + { "id": "posimai-digest", "tasks": [] }, + { "id": "posimai-think", "tasks": [] }, + { "id": "posimai-tech-events","tasks": [] } ], "global": [ {