Let task links open a tab, and link the lead to inboxes for review
This commit is contained in:
+1
-1
@@ -132,7 +132,7 @@ Messages byre itself sends an agent (actor `byre`: the restart notice, Sync and
|
|||||||
|
|
||||||
The task switcher (⌘K, or the project ▸ task picker at the right end of the right pane's tab strip) lists active tasks with their session state and open inbox item count, and **merge held** on a task with `merge_queued_at`, live while it is open. Tasks with inbox items come first; within each group, the task least recently visited in this browser comes first (never-visited tasks before all others, ties in the server's order: projects by name, tasks newest first). Visit times are kept in the browser's localStorage under `byre.visits`, stamped when a task is selected and again when it is left. After the tasks come the projects, one row each; picking one points the right pane at the project with no task, on the Project tab. Typing filters both and adds a last row that creates a task with the typed text as its title, in the right pane's project (the first project when there is none); Enter picks the highlighted row. Picking a task points the right pane at it on the Transcript tab (see "Lead agent").
|
The task switcher (⌘K, or the project ▸ task picker at the right end of the right pane's tab strip) lists active tasks with their session state and open inbox item count, and **merge held** on a task with `merge_queued_at`, live while it is open. Tasks with inbox items come first; within each group, the task least recently visited in this browser comes first (never-visited tasks before all others, ties in the server's order: projects by name, tasks newest first). Visit times are kept in the browser's localStorage under `byre.visits`, stamped when a task is selected and again when it is left. After the tasks come the projects, one row each; picking one points the right pane at the project with no task, on the Project tab. Typing filters both and adds a last row that creates a task with the typed text as its title, in the right pane's project (the first project when there is none); Enter picks the highlighted row. Picking a task points the right pane at it on the Transcript tab (see "Lead agent").
|
||||||
|
|
||||||
**Task colours.** Each task has a colour, `tasks.color` (`color` in the API), an index into the palette of `--task-0` … `--task-N` custom properties at the top of `web/style.css`, one set for light and one for dark, all at least 4.5:1 against the backgrounds so they work as text. `CreateTask` assigns it in the same transaction as the task's row: of the `store.TaskColors` colours, one no active task holds, and among those the one given out longest ago (the lowest `max(rowid)` of tasks with that colour, never-used first), so a new task doesn't take the colour of one just closed. Active tasks have distinct colours until more than `TaskColors` are active at once. `TaskColors` must match the number of palette entries. An element styled with `taskStyle(id)` (`web/src/taskcolor.ts`) sets `--task` for itself and its children from the task's `color`; `--task` defaults to the accent, which is also what a task the page doesn't know gets. The right pane sets it for the selected task, which tints its tab strip, colours the task picker's text, the selected tab's underline, the composer's border and the running border and spinner. Everywhere a task is named it shows in its colour: task titles in the switcher, the Project tab and the Status modal (`.task-name`), and task links (`a.task-link`), including any Markdown link to `#/task/<id>`. The lead's guidance tells it to link every task it names that way, and clicking one points the right pane at the task.
|
**Task colours.** Each task has a colour, `tasks.color` (`color` in the API), an index into the palette of `--task-0` … `--task-N` custom properties at the top of `web/style.css`, one set for light and one for dark, all at least 4.5:1 against the backgrounds so they work as text. `CreateTask` assigns it in the same transaction as the task's row: of the `store.TaskColors` colours, one no active task holds, and among those the one given out longest ago (the lowest `max(rowid)` of tasks with that colour, never-used first), so a new task doesn't take the colour of one just closed. Active tasks have distinct colours until more than `TaskColors` are active at once. `TaskColors` must match the number of palette entries. An element styled with `taskStyle(id)` (`web/src/taskcolor.ts`) sets `--task` for itself and its children from the task's `color`; `--task` defaults to the accent, which is also what a task the page doesn't know gets. The right pane sets it for the selected task, which tints its tab strip, colours the task picker's text, the selected tab's underline, the composer's border and the running border and spinner. Everywhere a task is named it shows in its colour: task titles in the switcher, the Project tab and the Status modal (`.task-name`), and task links (`a.task-link`), including any Markdown link to `#/task/<id>` or `#/task/<id>/<tab>`. The lead's guidance tells it to link every task it names that way, using `#/task/<id>/inbox` when it points the human at the task's inbox, and clicking one points the right pane at the task, selecting the named tab if there is one.
|
||||||
|
|
||||||
## Lead agent
|
## Lead agent
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const leadGuidance = `You are the human's lead agent in byre, shown in the left
|
|||||||
- Reviews: after each new snapshot of a task, a reviewer agent from the other vendor reviews the change. The results are on the task's reviews tab, read_transcript shows each review's findings, and a question shows the review of the turn that asked it. They are for the human to look at when they want; mention one only when its findings matter to what the human is deciding.
|
- Reviews: after each new snapshot of a task, a reviewer agent from the other vendor reviews the change. The results are on the task's reviews tab, read_transcript shows each review's findings, and a question shows the review of the turn that asked it. They are for the human to look at when they want; mention one only when its findings matter to what the human is deciding.
|
||||||
- Dig into context with list_tasks, read_transcript and read_inbox, and with your own Read, Grep and Bash on a task's worktree path (from list_tasks). Don't edit files in task worktrees; ask the task's agent with send_message.
|
- Dig into context with list_tasks, read_transcript and read_inbox, and with your own Read, Grep and Bash on a task's worktree path (from list_tasks). Don't edit files in task worktrees; ask the task's agent with send_message.
|
||||||
- You can create tasks, start TODO items, message, interrupt and compact task agents, and merge or discard tasks. Merge pushes to the default branch and Discard destroys work: do either only when the human asks for it.
|
- You can create tasks, start TODO items, message, interrupt and compact task agents, and merge or discard tasks. Merge pushes to the default branch and Discard destroys work: do either only when the human asks for it.
|
||||||
- Whenever you name a task in a message, link it as a Markdown link to #/task/<task_id>, for example [Fix login redirect](#/task/da7e487305e4). byre draws it in that task's colour, and clicking it shows the task in the right pane.
|
- Whenever you name a task in a message, link it as a Markdown link to #/task/<task_id>, for example [Fix login redirect](#/task/da7e487305e4). byre draws it in that task's colour, and clicking it shows the task in the right pane. To open a specific tab, append it: #/task/<task_id>/<tab>. When you point the human at something to review or answer in a task's inbox, link to #/task/<task_id>/inbox, never its transcript.
|
||||||
- Keep messages short; the human reads them in half the screen. Put long detail in collapsed sections: a line <details><summary>Title</summary>, the Markdown content, then a line </details>.
|
- Keep messages short; the human reads them in half the screen. Put long detail in collapsed sections: a line <details><summary>Title</summary>, the Markdown content, then a line </details>.
|
||||||
- You are long-running. Your context window is large. Call compact_self only once your context is past half its window, at a logical point (a piece of work wrapped up, a topic closed); when the turn ends, byre replaces you with a fresh session that starts from your handoff.
|
- You are long-running. Your context window is large. Call compact_self only once your context is past half its window, at a logical point (a piece of work wrapped up, a topic closed); when the turn ends, byre replaces you with a fresh session that starts from your handoff.
|
||||||
- Don't commit, push, or touch git branches yourself.`
|
- Don't commit, push, or touch git branches yourself.`
|
||||||
|
|||||||
Vendored
+6
-5
@@ -2,7 +2,7 @@ import { get, put, subscribe } from "./api.js";
|
|||||||
import { errorText, h, replace, showAlert } from "./dom.js";
|
import { errorText, h, replace, showAlert } from "./dom.js";
|
||||||
import { mountNavbar } from "./navbar.js";
|
import { mountNavbar } from "./navbar.js";
|
||||||
import { leadPane, taskPane } from "./panes.js";
|
import { leadPane, taskPane } from "./panes.js";
|
||||||
import { handleEvent, loadFocus, loadInbox, loadLeadSessions, loadMe, loadProjects, notify, on, selectTask, setFocus, startLeadStream, state } from "./state.js";
|
import { handleEvent, loadFocus, loadInbox, loadLeadSessions, loadMe, loadProjects, notify, on, selectTask, setFocus, startLeadStream, state, tabs } from "./state.js";
|
||||||
function identityBanner(root) {
|
function identityBanner(root) {
|
||||||
const render = () => {
|
const render = () => {
|
||||||
const me = state.me;
|
const me = state.me;
|
||||||
@@ -31,12 +31,13 @@ function identityBanner(root) {
|
|||||||
render();
|
render();
|
||||||
}
|
}
|
||||||
function route() {
|
function route() {
|
||||||
const match = /^#\/(task|project)\/(\w+)$/.exec(location.hash);
|
const match = /^#\/(task|project)\/(\w+)(?:\/(\w+))?$/.exec(location.hash);
|
||||||
const taskId = match?.[1] === "task" ? match[2] : undefined;
|
const taskId = match?.[1] === "task" ? match[2] : undefined;
|
||||||
const projectId = match?.[1] === "project" ? match[2] : undefined;
|
const projectId = match?.[1] === "project" ? match[2] : undefined;
|
||||||
|
const tab = tabs.find((t) => t === match?.[3]);
|
||||||
if (taskId) {
|
if (taskId) {
|
||||||
if (taskId !== state.focus.task_id) {
|
if (taskId !== state.focus.task_id || (tab && tab !== state.focus.tab)) {
|
||||||
setFocus({ task_id: taskId }).catch((err) => console.error("set focus", err));
|
setFocus({ task_id: taskId, tab }).catch((err) => console.error("set focus", err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (state.focus.task_id || projectId !== state.focus.project_id) {
|
else if (state.focus.task_id || projectId !== state.focus.project_id) {
|
||||||
@@ -53,7 +54,7 @@ async function main() {
|
|||||||
await Promise.all([loadMe(), loadProjects(), loadInbox(), loadLeadSessions()]);
|
await Promise.all([loadMe(), loadProjects(), loadInbox(), loadLeadSessions()]);
|
||||||
const linked = location.hash;
|
const linked = location.hash;
|
||||||
await loadFocus();
|
await loadFocus();
|
||||||
if (/^#\/(task|project)\/\w+$/.test(linked)) {
|
if (/^#\/(task|project)\/\w+(\/\w+)?$/.test(linked)) {
|
||||||
location.hash = linked;
|
location.hash = linked;
|
||||||
}
|
}
|
||||||
startLeadStream();
|
startLeadStream();
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjK,SAAS,cAAc,CAAC,IAAiB;IACvC,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;YACzC,OAAO,CAAC,IAAI,CAAC,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,OAAO;QACT,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,EAAE,QAA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,CAAC,EACD,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB,CAAC;IAEF,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,SAAS,EAAE,EAAE;QAC9D,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;QAC5B,MAAM,CAAC,YAAY,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,gBAAgB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACtC,KAAK,EAAE,CAAC;AACV,CAAC;AAED,KAAK,UAAU,KAAK;IAClB,IAAI,eAAe,IAAI,SAAS,EAAE,CAAC;QACjC,KAAK,MAAM,GAAG,IAAI,MAAM,SAAS,CAAC,aAAa,CAAC,gBAAgB,EAAE,EAAE,CAAC;YACnE,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;QACzB,CAAC;QACD,IAAI,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;YACvC,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;IACH,CAAC;IACD,MAAM,IAAI,EAAE,CAAC;AACf,CAAC;AAED,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,yBAAyB,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAClG,CAAC,CAAC,CAAC"}
|
||||||
Vendored
+1
-1
@@ -271,7 +271,7 @@ function link(href, children) {
|
|||||||
if (/^https?:\/\//i.test(href)) {
|
if (/^https?:\/\//i.test(href)) {
|
||||||
return h("a", { href, target: "_blank", rel: "noopener noreferrer" }, ...children);
|
return h("a", { href, target: "_blank", rel: "noopener noreferrer" }, ...children);
|
||||||
}
|
}
|
||||||
const task = /^#\/task\/(\w+)$/.exec(href);
|
const task = /^#\/task\/(\w+)(\/\w+)?$/.exec(href);
|
||||||
if (task) {
|
if (task) {
|
||||||
return h("a", { href, class: "task-link", style: taskStyle(task[1]) }, ...children);
|
return h("a", { href, class: "task-link", style: taskStyle(task[1]) }, ...children);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+6
-5
@@ -2,7 +2,7 @@ import { get, put, subscribe } from "./api.js";
|
|||||||
import { errorText, h, replace, showAlert } from "./dom.js";
|
import { errorText, h, replace, showAlert } from "./dom.js";
|
||||||
import { mountNavbar } from "./navbar.js";
|
import { mountNavbar } from "./navbar.js";
|
||||||
import { leadPane, taskPane } from "./panes.js";
|
import { leadPane, taskPane } from "./panes.js";
|
||||||
import { handleEvent, loadFocus, loadInbox, loadLeadSessions, loadMe, loadProjects, notify, on, selectTask, setFocus, startLeadStream, state } from "./state.js";
|
import { handleEvent, loadFocus, loadInbox, loadLeadSessions, loadMe, loadProjects, notify, on, selectTask, setFocus, startLeadStream, state, tabs } from "./state.js";
|
||||||
|
|
||||||
function identityBanner(root: HTMLElement): void {
|
function identityBanner(root: HTMLElement): void {
|
||||||
const render = () => {
|
const render = () => {
|
||||||
@@ -32,12 +32,13 @@ function identityBanner(root: HTMLElement): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function route(): void {
|
function route(): void {
|
||||||
const match = /^#\/(task|project)\/(\w+)$/.exec(location.hash);
|
const match = /^#\/(task|project)\/(\w+)(?:\/(\w+))?$/.exec(location.hash);
|
||||||
const taskId = match?.[1] === "task" ? match[2] : undefined;
|
const taskId = match?.[1] === "task" ? match[2] : undefined;
|
||||||
const projectId = match?.[1] === "project" ? match[2] : undefined;
|
const projectId = match?.[1] === "project" ? match[2] : undefined;
|
||||||
|
const tab = tabs.find((t) => t === match?.[3]);
|
||||||
if (taskId) {
|
if (taskId) {
|
||||||
if (taskId !== state.focus.task_id) {
|
if (taskId !== state.focus.task_id || (tab && tab !== state.focus.tab)) {
|
||||||
setFocus({ task_id: taskId }).catch((err: unknown) => console.error("set focus", err));
|
setFocus({ task_id: taskId, tab }).catch((err: unknown) => console.error("set focus", err));
|
||||||
}
|
}
|
||||||
} else if (state.focus.task_id || projectId !== state.focus.project_id) {
|
} else if (state.focus.task_id || projectId !== state.focus.project_id) {
|
||||||
setFocus({ task_id: null, project_id: projectId ?? null }).catch((err: unknown) => console.error("set focus", err));
|
setFocus({ task_id: null, project_id: projectId ?? null }).catch((err: unknown) => console.error("set focus", err));
|
||||||
@@ -55,7 +56,7 @@ async function main(): Promise<void> {
|
|||||||
await Promise.all([loadMe(), loadProjects(), loadInbox(), loadLeadSessions()]);
|
await Promise.all([loadMe(), loadProjects(), loadInbox(), loadLeadSessions()]);
|
||||||
const linked = location.hash;
|
const linked = location.hash;
|
||||||
await loadFocus();
|
await loadFocus();
|
||||||
if (/^#\/(task|project)\/\w+$/.test(linked)) {
|
if (/^#\/(task|project)\/\w+(\/\w+)?$/.test(linked)) {
|
||||||
location.hash = linked;
|
location.hash = linked;
|
||||||
}
|
}
|
||||||
startLeadStream();
|
startLeadStream();
|
||||||
|
|||||||
+1
-1
@@ -311,7 +311,7 @@ function link(href: string, children: Node[]): Node {
|
|||||||
if (/^https?:\/\//i.test(href)) {
|
if (/^https?:\/\//i.test(href)) {
|
||||||
return h("a", { href, target: "_blank", rel: "noopener noreferrer" }, ...children);
|
return h("a", { href, target: "_blank", rel: "noopener noreferrer" }, ...children);
|
||||||
}
|
}
|
||||||
const task = /^#\/task\/(\w+)$/.exec(href);
|
const task = /^#\/task\/(\w+)(\/\w+)?$/.exec(href);
|
||||||
if (task) {
|
if (task) {
|
||||||
return h("a", { href, class: "task-link", style: taskStyle(task[1]!) }, ...children);
|
return h("a", { href, class: "task-link", style: taskStyle(task[1]!) }, ...children);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user