Keyboard shortcut overlay
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
|
||||
- Drafts survive reload
|
||||
Composer text drafts and inbox answer drafts (checked choices and free text) are mirrored into localStorage, keyed by user plus the existing composer key or inbox item id, with a debounced save and a flush when leaving the composer. A draft is cleared only after a successful send; a failed send keeps it. Drafts for closed tasks and vanished items are pruned. Storage that throws or holds malformed data falls back to the in-memory drafts. Pending images are not restored; the composer says how many need re-attaching instead of dropping them silently.
|
||||
- Keyboard shortcut overlay
|
||||
⌘/ opens an overlay listing every keyboard shortcut.
|
||||
- Pick project and model when creating a task
|
||||
The switcher's task creation lets a `proj:` prefix narrow to project rows instead of always using the focused or first project, and the "New task in X" row shows the model that will run.
|
||||
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ Each user has one long-running lead agent, shown in the left pane. It is not tie
|
||||
- **Compaction.** The pane's **Compact** button asks the lead for a handoff (`leadHandoffPrompt`). The lead can't see its own context size, so the first time one of its turns ends (other than a handoff or a `compact_self` turn) with the latest `session.context` `used` at half its `window` or more, byre holds a signal for it giving the percentage and asking it to call `compact_self` at the next logical point (`warnLeadContext` in `internal/agents/lead.go`); it is sent once per live process, so a byre restart can send it again once the window is known. The lead calls `compact_self`; when that turn ends normally, byre sends the same request. The handoff turn ends the session, and a new lead session starts from `leadHandoffPreamble` plus the handoff; held input follows once that turn ends.
|
||||
- **Restarts.** On shutdown, byre marks each running lead session idle with "byre stopped mid-turn" and holds a restart notice for it, so a lead is never left `running` for a build without lead support to find. After a crash, startup resumes a running lead like a task session. Startup then delivers any held input.
|
||||
|
||||
The UI is two panes filling the window, with no navbar. The left has three tabs: Lead, the lead's transcript and composer (the same view as a task transcript, with only the Compact button in its header), Status and Settings, and at the end of its tab strip the connection dot and the user's name. Which left tab is selected is kept only in the page; the Lead view stays mounted while another tab shows, and Status or Settings mounts each time its tab is selected. The right shows the focused task, or project with no task: a top row holding the task picker, centred, and the task's preview links at its right end (see "Previews"), then the tab strip, then the selected tab's view with its own header. The tabs are Transcript, Changes, Files, Terminal, Inbox, Reviews and Project, the lead's `tabs` first. Reviews shows only once it has a `review.*` event, and Inbox only while the task has open items; the selected tab always shows. Tabs that don't fit in the strip move, from the end, into a **More ▾** menu (`web/src/panes.ts`); the selected tab never moves there, and More carries the Inbox highlight and count when Inbox is in it. ⌘P (Ctrl+P elsewhere) selects the Project tab, keeping the right pane's task, and replaces the browser's print shortcut. ⌘L (Ctrl+L elsewhere) selects the Lead tab and puts the cursor in the lead's composer, and replaces the browser's address bar shortcut. ⌘S (Ctrl+S elsewhere) opens the right pane's task's Merge confirmation, from any tab, when the Merge button would be enabled, and replaces the browser's save shortcut.
|
||||
The UI is two panes filling the window, with no navbar. The left has three tabs: Lead, the lead's transcript and composer (the same view as a task transcript, with only the Compact button in its header), Status and Settings, and at the end of its tab strip the connection dot and the user's name. Which left tab is selected is kept only in the page; the Lead view stays mounted while another tab shows, and Status or Settings mounts each time its tab is selected. The right shows the focused task, or project with no task: a top row holding the task picker, centred, and the task's preview links at its right end (see "Previews"), then the tab strip, then the selected tab's view with its own header. The tabs are Transcript, Changes, Files, Terminal, Inbox, Reviews and Project, the lead's `tabs` first. Reviews shows only once it has a `review.*` event, and Inbox only while the task has open items; the selected tab always shows. Tabs that don't fit in the strip move, from the end, into a **More ▾** menu (`web/src/panes.ts`); the selected tab never moves there, and More carries the Inbox highlight and count when Inbox is in it. ⌘P (Ctrl+P elsewhere) selects the Project tab, keeping the right pane's task, and replaces the browser's print shortcut. ⌘L (Ctrl+L elsewhere) selects the Lead tab and puts the cursor in the lead's composer, and replaces the browser's address bar shortcut. ⌘S (Ctrl+S elsewhere) opens the right pane's task's Merge confirmation, from any tab, when the Merge button would be enabled, and replaces the browser's save shortcut. ⌘/ (Ctrl+/ elsewhere) opens a dialog listing every keyboard shortcut; the list is `shortcuts` in `web/src/switcher.ts`, kept in step with the handlers by hand. The ⌘ shortcuts do nothing while a dialog is open.
|
||||
|
||||
## TODO
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -95,8 +95,8 @@ function modal(content, buttons, anchor = null) {
|
||||
actions.at(-1)?.focus();
|
||||
});
|
||||
}
|
||||
export async function showAlert(text) {
|
||||
await modal(text, [{ label: "OK", value: "ok", class: "primary" }]);
|
||||
export async function showAlert(content) {
|
||||
await modal(content, [{ label: "OK", value: "ok", class: "primary" }]);
|
||||
}
|
||||
export async function showConfirm(content, action, danger = false, anchor = null) {
|
||||
const value = await modal(content, [
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,CAAC,CAAwC,GAAM,EAAE,QAAkB,EAAE,EAAE,GAAG,QAAiB;IACzG,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAEzD,IAAI,SAAS,EAAE,CAAC;QACd,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;IAC3B,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;QACtD,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC1B,CAAC;IACD,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAExB,MAAM,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,CAAC;IACxB,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,EAAQ,EAAE,GAAG,QAAiB;IACnD,KAAK,MAAM,KAAK,I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AK,GAAG,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,KAAK,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YAC3D,OAAO;QACT,CAAC;QACD,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAwB;IACtD,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAwB,EAAE,MAAc,EAAE,MAAM,GAAG,KAAK,EAAE,SAAyB,IAAI;IACvH,MAAM,KAAK,GAAG,MAAM,KAAK,CACvB,OAAO,EACP;QACE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;QACpC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,EAAE;KAC7E,EACD,MAAM,CACP,CAAC;IACF,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB,CAAC"}
|
||||
Vendored
+47
@@ -27,8 +27,55 @@ export function bindShortcuts() {
|
||||
void confirmMerge(state.selectedTaskId);
|
||||
}
|
||||
}
|
||||
else if (e.key === "/") {
|
||||
e.preventDefault();
|
||||
showShortcuts();
|
||||
}
|
||||
});
|
||||
}
|
||||
const shortcuts = [
|
||||
[
|
||||
"Anywhere",
|
||||
[
|
||||
["⌘K", "Switch task, or create one"],
|
||||
["⌘P", "Open the Project tab"],
|
||||
["⌘L", "Open the Lead tab and its composer"],
|
||||
["⌘S", "Merge the right pane's task"],
|
||||
["⌘/", "Show these shortcuts"],
|
||||
["Esc", "Close the switcher or a dialog"],
|
||||
],
|
||||
],
|
||||
[
|
||||
"Task switcher",
|
||||
[
|
||||
["↑ ↓", "Move the highlight"],
|
||||
["Enter", "Pick the highlighted row"],
|
||||
],
|
||||
],
|
||||
[
|
||||
"Composer and inbox answers",
|
||||
[
|
||||
["Enter", "Send"],
|
||||
["Shift+Enter", "New line"],
|
||||
["Enter / Space", "Pick the focused choice"],
|
||||
],
|
||||
],
|
||||
[
|
||||
"Dialogs",
|
||||
[["Enter", "Confirm"]],
|
||||
],
|
||||
[
|
||||
"Terminal",
|
||||
[["Ctrl+…", "Goes to the shell, not to byre"]],
|
||||
],
|
||||
];
|
||||
function showShortcuts() {
|
||||
void showAlert([
|
||||
h("h2", { class: "shortcuts-title" }, "Keyboard shortcuts"),
|
||||
...shortcuts.map(([group, rows]) => h("section", { class: "shortcuts-group" }, h("h3", {}, group), h("dl", {}, ...rows.flatMap(([keys, what]) => [h("dt", {}, h("kbd", {}, keys)), h("dd", {}, what)])))),
|
||||
h("p", { class: "hint" }, "Ctrl works in place of ⌘."),
|
||||
]);
|
||||
}
|
||||
export function openSwitcher() {
|
||||
if (document.querySelector(".switcher")) {
|
||||
return;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
@@ -114,8 +114,8 @@ function modal(content: string | Node[], buttons: { label: string; value: string
|
||||
});
|
||||
}
|
||||
|
||||
export async function showAlert(text: string): Promise<void> {
|
||||
await modal(text, [{ label: "OK", value: "ok", class: "primary" }]);
|
||||
export async function showAlert(content: string | Node[]): Promise<void> {
|
||||
await modal(content, [{ label: "OK", value: "ok", class: "primary" }]);
|
||||
}
|
||||
|
||||
export async function showConfirm(content: string | Node[], action: string, danger = false, anchor: Element | null = null): Promise<boolean> {
|
||||
|
||||
@@ -24,10 +24,65 @@ export function bindShortcuts(): void {
|
||||
if (state.selectedTaskId) {
|
||||
void confirmMerge(state.selectedTaskId);
|
||||
}
|
||||
} else if (e.key === "/") {
|
||||
e.preventDefault();
|
||||
showShortcuts();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const shortcuts: [string, [string, string][]][] = [
|
||||
[
|
||||
"Anywhere",
|
||||
[
|
||||
["⌘K", "Switch task, or create one"],
|
||||
["⌘P", "Open the Project tab"],
|
||||
["⌘L", "Open the Lead tab and its composer"],
|
||||
["⌘S", "Merge the right pane's task"],
|
||||
["⌘/", "Show these shortcuts"],
|
||||
["Esc", "Close the switcher or a dialog"],
|
||||
],
|
||||
],
|
||||
[
|
||||
"Task switcher",
|
||||
[
|
||||
["↑ ↓", "Move the highlight"],
|
||||
["Enter", "Pick the highlighted row"],
|
||||
],
|
||||
],
|
||||
[
|
||||
"Composer and inbox answers",
|
||||
[
|
||||
["Enter", "Send"],
|
||||
["Shift+Enter", "New line"],
|
||||
["Enter / Space", "Pick the focused choice"],
|
||||
],
|
||||
],
|
||||
[
|
||||
"Dialogs",
|
||||
[["Enter", "Confirm"]],
|
||||
],
|
||||
[
|
||||
"Terminal",
|
||||
[["Ctrl+…", "Goes to the shell, not to byre"]],
|
||||
],
|
||||
];
|
||||
|
||||
function showShortcuts(): void {
|
||||
void showAlert([
|
||||
h("h2", { class: "shortcuts-title" }, "Keyboard shortcuts"),
|
||||
...shortcuts.map(([group, rows]) =>
|
||||
h(
|
||||
"section",
|
||||
{ class: "shortcuts-group" },
|
||||
h("h3", {}, group),
|
||||
h("dl", {}, ...rows.flatMap(([keys, what]) => [h("dt", {}, h("kbd", {}, keys)), h("dd", {}, what)])),
|
||||
),
|
||||
),
|
||||
h("p", { class: "hint" }, "Ctrl works in place of ⌘."),
|
||||
]);
|
||||
}
|
||||
|
||||
export function openSwitcher(): void {
|
||||
if (document.querySelector(".switcher")) {
|
||||
return;
|
||||
|
||||
@@ -1934,6 +1934,40 @@ pre.diff .mark {
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
|
||||
.shortcuts-title {
|
||||
margin: 0 0 12px;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.shortcuts-group h3 {
|
||||
margin: 0 0 6px;
|
||||
font-size: 0.9em;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.shortcuts-group dl {
|
||||
display: grid;
|
||||
grid-template-columns: max-content 1fr;
|
||||
gap: 4px 16px;
|
||||
margin: 0 0 14px;
|
||||
}
|
||||
|
||||
.shortcuts-group dd {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.shortcuts-group kbd {
|
||||
font: inherit;
|
||||
padding: 0 6px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
.modal .hint {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.modal-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
Reference in New Issue
Block a user