Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/dashboard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ describe("getDashboardHtml", () => {
assert.ok(html.includes("claude-waiting-"));
});

it("only notifies for interactive tools, not Bash", () => {
assert.ok(html.includes("NOTIFY_TOOLS"));
assert.ok(html.includes("NOTIFY_TOOLS[s.lastEvent]"));
assert.ok(html.includes("AskUserQuestion"));
it("notifies for all waiting status transitions", () => {
assert.ok(html.includes("s.status === 'waiting'"));
assert.ok(html.includes("previousStatuses[s.sessionId] !== 'waiting'"));
assert.ok(!html.includes("NOTIFY_TOOLS"));
});

it("contains Stop and Restart buttons", () => {
Expand Down
4 changes: 1 addition & 3 deletions src/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ export function getDashboardHtml(): string {

var STATUS_LABELS = { running: 'Running', waiting: 'Waiting for input', done: 'Done' };
var STATUS_ORDER = { running: 0, waiting: 1, done: 2 };
var NOTIFY_TOOLS = { ExitPlanMode: 1, AskUserQuestion: 1, Write: 1, Edit: 1, NotebookEdit: 1 };

function timeAgo(ts) {
var diff = Math.floor((Date.now() - ts) / 1000);
if (diff < 5) return 'just now';
Expand Down Expand Up @@ -583,7 +581,7 @@ export function getDashboardHtml(): string {
}
if (notificationsEnabled && 'Notification' in window && Notification.permission === 'granted') {
newSessions.forEach(function(s) {
if (s.status === 'waiting' && previousStatuses[s.sessionId] !== 'waiting' && NOTIFY_TOOLS[s.lastEvent]) {
if (s.status === 'waiting' && previousStatuses[s.sessionId] !== 'waiting') {
new Notification('Claude Code - Waiting for input', {
body: folderName(s.cwd),
tag: 'claude-waiting-' + s.sessionId
Expand Down