Lock the right pane while focused, add project focus, quiet lead
This commit is contained in:
Vendored
+11
-5
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user