Lock the right pane while focused, add project focus, quiet lead

This commit is contained in:
Ian Gulliver
2026-10-15 09:59:13 -07:00
parent bdd1ae48f0
commit fdd005b591
32 changed files with 576 additions and 227 deletions
+11 -5
View File
@@ -31,10 +31,16 @@ function identityBanner(root) {
render();
}
function route() {
const match = /^#\/task\/(\w+)$/.exec(location.hash);
const taskId = match?.[1];
if (taskId !== state.focus.task_id) {
setFocus({ task_id: taskId ?? null }).catch((err) => console.error("set focus", err));
const match = /^#\/(task|project)\/(\w+)$/.exec(location.hash);
const taskId = match?.[1] === "task" ? match[2] : undefined;
const projectId = match?.[1] === "project" ? match[2] : undefined;
if (taskId) {
if (taskId !== state.focus.task_id) {
setFocus({ task_id: taskId }).catch((err) => console.error("set focus", err));
}
}
else if (state.focus.task_id || projectId !== state.focus.project_id) {
setFocus({ task_id: null, project_id: projectId ?? null }).catch((err) => console.error("set focus", err));
}
if (taskId !== state.selectedTaskId) {
selectTask(taskId);
@@ -47,7 +53,7 @@ async function main() {
await Promise.all([loadMe(), loadProjects(), loadInbox(), loadLeadSessions()]);
const linked = location.hash;
await loadFocus();
if (/^#\/task\/\w+$/.test(linked)) {
if (/^#\/(task|project)\/\w+$/.test(linked)) {
location.hash = linked;
}
startLeadStream();