fix(hub): tests follow requirement 030 and the line comments, dead ask answer path removed
🧪 Test / 🧪 Lock + lint (push) Waiting to run
🧪 Test / 🧪 Lock + lint (push) Waiting to run
Requirement 030 answers a permission ask with Grant and Deny only, so the ask branch of choiceOf, answerAsk, askDialog, ALLOW and TELL had no caller left; they are removed. test_ask_answers_e2e now denies one ask with Deny and one through Deny via with a typed reason, both by post to the requester; test_stream_keeps_typing_e2e types into a named-option decision while an ask keeps its diff scroll. The grant-mode and inbox-gone harnesses load page-diff.js (and page-deny.js) instead of missing lineNotes, the slash marker test names the new Comment field, and the line-comment e2e expect the requester and radio commands the hub really sends. The help line no longer reads as an agent calling an agent and uses an ASCII minus for the zoom keys. Evidence: tests/e2e 146 OK, make test 2123 OK with ruff, shellcheck and markdownlint clean, MEDUSA 100 % over 624729d..this tree. 🎯 Fix: 96 % 💥 Break: 2 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 94 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2722cda1b5
commit
d3bc54f401
11 files changed
+45
-44
No files matched your search
@@ -75,7 +75,7 @@
|
||||
direct: [[740, 0, 0.2]],
|
||||
radio: [[520, 0, 0.07]],
|
||||
};
|
||||
const KEYS = [["Ctrl+K", "Commands, views, agents and AI command"], ["Right-click", "Context menu: the element's commands, then the tab's, then the general ones"], ["Shift+right-click", "The browser's own context menu"], ["Menu key · Shift+F10", "Context menu of the focused element: ↑ / ↓ move, Enter runs, Esc closes"], ["1 · 2 · 3 · 4", "Stream · Agents · Artifacts · Tasks"], ["j / k", "Waits on Operator: next / previous entry"], ["x", "Waits on Operator: select entry"], ["a", "Waits on Operator: grant entry (3 s to undo)"], ["Enter", "Waits on Operator: open entry"], ["f", "Comment on the selected lines of a diff or a command: it goes with Deny as a call, or after Grant as a post"], ["→ · ← · ↑", "Match: accept · reject with feedback · later"],["/", "Search the stream"], ["h", "Look at the sky: drag turns the view, wheel or two fingers zoom, Esc ends"], ["Arrows · + / − · 0", "Sky (focused): turn · zoom · reset"], ["Drag · wheel", "3D: turn, right drag pans, wheel zooms"], ["+ / − · 0 · Ctrl+wheel", "Home tile (focused): zoom its content in · out · reset"],["🎙 hold", "Voice input into the agent field or the command line, never sent automatically"], ["?", "This help"], ["Esc", "Close"]];
|
||||
const KEYS = [["Ctrl+K", "Commands, views, agents and AI command"], ["Right-click", "Context menu: the element's commands, then the tab's, then the general ones"], ["Shift+right-click", "The browser's own context menu"], ["Menu key · Shift+F10", "Context menu of the focused element: ↑ / ↓ move, Enter runs, Esc closes"], ["1 · 2 · 3 · 4", "Stream · Agents · Artifacts · Tasks"], ["j / k", "Waits on Operator: next / previous entry"], ["x", "Waits on Operator: select entry"], ["a", "Waits on Operator: grant entry (3 s to undo)"], ["Enter", "Waits on Operator: open entry"], ["f", "Comment on the selected lines of a diff or a command; Deny or Grant sends the comments"], ["→ · ← · ↑", "Match: accept · reject with feedback · later"],["/", "Search the stream"], ["h", "Look at the sky: drag turns the view, wheel or two fingers zoom, Esc ends"], ["Arrows · + / - · 0", "Sky (focused): turn · zoom · reset"], ["Drag · wheel", "3D: turn, right drag pans, wheel zooms"], ["+ / - · 0 · Ctrl+wheel", "Home tile (focused): zoom its content in · out · reset"],["🎙 hold", "Voice input into the agent field or the command line, never sent automatically"], ["?", "This help"], ["Esc", "Close"]];
|
||||
const calm = window.matchMedia("(prefers-reduced-motion: reduce)");
|
||||
const relative = new Intl.RelativeTimeFormat("en", {numeric: "auto"});
|
||||
const absolute = new Intl.DateTimeFormat("en-GB", {dateStyle: "medium", timeStyle: "short"});
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
const OTHER_PROMPT = "Other: type your own answer …";
|
||||
const ALLOW = "Yes";
|
||||
const TELL = "Tell Claude what to do instead";
|
||||
const askDialog = (id) => ({id, options: [{label: ALLOW, description: "allow this one call"}, {label: "No", description: "deny it"}], recommended: "", multi: false});
|
||||
const drafts = new Map();
|
||||
const forgetDraft = (id) => drafts.delete(id);
|
||||
|
||||
|
||||
@@ -154,13 +154,6 @@
|
||||
|
||||
const signsFor = (item) => `${item.agent} gets this answer as a call once your passkey signs it`;
|
||||
|
||||
/**
|
||||
* @param {Object} item a permission ask.
|
||||
* @param {string} answer the picked label, or the typed text.
|
||||
* @param {boolean} typed whether answer is typed text, which always denies with it as the reason.
|
||||
*/
|
||||
const answerAsk = (item, answer, typed) => (!typed && answer === ALLOW ? approveOne(item) : denyNow(item, lineNotes(keyOf(item)) ? "call" : "post", withNotes(item, typed ? answer : ""), item.to));
|
||||
|
||||
/**
|
||||
* @param {Object} item an inbox item.
|
||||
* @param {Function} after called before a picked answer is sent.
|
||||
@@ -174,9 +167,6 @@
|
||||
if (item.kind === "decision") {
|
||||
return choiceDialog(item, {pick: (label) => { after(); chooseOne(item, label); }, toggled: new Set(), chosen: ui.selected.has(keyOf(item)) ? grantLabel(item) : "", locked: item.held, hint: signsFor(item), group: "", other: OTHER_PROMPT});
|
||||
}
|
||||
if (item.kind === "ask") {
|
||||
return choiceDialog(askDialog(item.id), {pick: (answer, typed) => { after(); answerAsk(item, answer, typed); }, toggled: new Set(), chosen: ui.selected.has(keyOf(item)) ? ALLOW : "", locked: item.held, hint: `the answer goes to ${item.to || "its session"} once your passkey signs it`, group: "", other: TELL});
|
||||
}
|
||||
const shown = ui.selected.has(keyOf(item)) ? grantLabel(item) : "";
|
||||
return asked(item) ? [answerTo(item), choiceDialog(item, {pick: (label) => { after(); answerPick(item, label); }, toggled: new Set(), chosen: shown, locked: item.held, hint: signsFor(item), group: "", other: OTHER_PROMPT})] : null;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user