Planner: Calendar and Tasks in one menu entry, due tasks shown on the calendar; menu, More sheet and Home tiles grouped by kind

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-22 08:56:31 -04:00
1 parent b305ccac51
commit 8d38584d37
11 files changed
+105 -36

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
'use strict';
// Planner: Calendar and Tasks in one menu entry. Each part keeps its own address (#/calendar, #/tasks) so links and reminders still work.
const PLANNER_PANES = [['calendar', 'Calendar'], ['tasks', 'Tasks']];
function viewPlanner(args = []) {
const ok = PLANNER_PANES.map(p => p[0]).filter(p => allowed(p));
const want = args[0] && ok.includes(args[0]) ? args[0] : store.get('planner_pane', ok[0]);
location.replace('#/' + (ok.includes(want) ? want : ok[0] || 'home'));
}
/** The page heading, with a Calendar | Tasks switch when this person may use both. */
function plannerHead(active) {
try { localStorage.setItem(nk('planner_pane'), JSON.stringify(active)); } catch {}
const panes = PLANNER_PANES.filter(p => allowed(p[0]));
if (panes.length < 2) return `<h1>${esc((PLANNER_PANES.find(p => p[0] === active) || [0, 'Planner'])[1])}</h1>`;
return `<h1>Planner</h1><div class="seg" role="tablist" aria-label="Planner">${panes.map(([k, l]) => `<a href="#/${k}" role="tab" aria-selected="${k === active}" class="${k === active ? 'on' : ''}">${l}</a>`).join('')}</div>`;
}