@1agh/maude 2.0.3 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/README.md +6 -5
  2. package/apps/hub/src/project-transactions/kernel.mjs +10 -1
  3. package/apps/studio/access/filters.ts +12 -5
  4. package/apps/studio/access/known-canvases.ts +24 -1
  5. package/apps/studio/access/refused-inputs.ts +89 -0
  6. package/apps/studio/access/request.ts +0 -1
  7. package/apps/studio/acp/adapter-stderr.ts +43 -13
  8. package/apps/studio/acp/background-tasks.ts +155 -0
  9. package/apps/studio/acp/bridge.ts +44 -5
  10. package/apps/studio/acp/connected-fact.ts +15 -4
  11. package/apps/studio/acp/index.ts +14 -5
  12. package/apps/studio/actions/agents.ts +10 -0
  13. package/apps/studio/actions/defs/app.ts +12 -0
  14. package/apps/studio/actions/defs/view.ts +12 -0
  15. package/apps/studio/actions.manifest.json +25 -1
  16. package/apps/studio/actions.parity.json +13 -1
  17. package/apps/studio/annotations/ui/element-node.tsx +139 -54
  18. package/apps/studio/annotations/ui/lod.tsx +1 -1
  19. package/apps/studio/annotations/ui/text-style.ts +1 -1
  20. package/apps/studio/annotations-layer.tsx +0 -12
  21. package/apps/studio/api.ts +73 -24
  22. package/apps/studio/artboard-live-gate.tsx +267 -0
  23. package/apps/studio/artboard-live.ts +336 -0
  24. package/apps/studio/artboard-webgl.ts +668 -0
  25. package/apps/studio/bin/_agent-browser-bin.mjs +8 -0
  26. package/apps/studio/bin/_agent-browser-safe.mjs +2 -1
  27. package/apps/studio/bin/_canvas-reasons.mjs +34 -0
  28. package/apps/studio/bin/_ds-check-live.mjs +37 -0
  29. package/apps/studio/bin/_ds-check.mjs +4 -1
  30. package/apps/studio/bin/_ds-prove-judge.mjs +167 -0
  31. package/apps/studio/bin/_ds-prove-playwright.mjs +183 -105
  32. package/apps/studio/bin/_import-asset.mjs +2 -1
  33. package/apps/studio/bin/_perf-probe.mjs +2 -1
  34. package/apps/studio/bin/_png-playwright.mjs +10 -1
  35. package/apps/studio/bin/_pw-launch.mjs +14 -0
  36. package/apps/studio/bin/_studio-verb.mjs +24 -3
  37. package/apps/studio/bin/_thumb-blank.mjs +70 -0
  38. package/apps/studio/bin/_thumb-cover.mjs +35 -0
  39. package/apps/studio/bin/_thumbs-playwright.mjs +93 -13
  40. package/apps/studio/bin/ds-check.sh +5 -1
  41. package/apps/studio/bin/perf.sh +11 -1
  42. package/apps/studio/bin/server-up.sh +7 -2
  43. package/apps/studio/bin/smoke.sh +19 -0
  44. package/apps/studio/boot-progress.ts +31 -0
  45. package/apps/studio/canvas-build-sandbox.ts +275 -42
  46. package/apps/studio/canvas-build-worker.ts +10 -0
  47. package/apps/studio/canvas-create.ts +24 -0
  48. package/apps/studio/canvas-lib.tsx +131 -12
  49. package/apps/studio/canvas-module-cache.ts +93 -0
  50. package/apps/studio/canvas-source/errors.ts +39 -0
  51. package/apps/studio/canvas-source/waiting.ts +290 -0
  52. package/apps/studio/client/actions/shell-key-handlers.js +5 -0
  53. package/apps/studio/client/app.jsx +19 -9
  54. package/apps/studio/client/canvas-url.js +13 -0
  55. package/apps/studio/client/github.js +23 -3
  56. package/apps/studio/client/home/HomeAccounts.jsx +262 -0
  57. package/apps/studio/client/home/Shelves.jsx +4 -3
  58. package/apps/studio/client/home/home-accounts-model.js +121 -0
  59. package/apps/studio/client/home/home-api.js +36 -19
  60. package/apps/studio/client/home/home-app.jsx +141 -40
  61. package/apps/studio/client/home/home-model.js +172 -6
  62. package/apps/studio/client/home/home.css +169 -5
  63. package/apps/studio/client/home/shell-mode.js +8 -1
  64. package/apps/studio/client/hooks/use-git-actions.jsx +2 -1
  65. package/apps/studio/client/hooks/use-project-data.jsx +2 -0
  66. package/apps/studio/client/hooks/use-shell-core.jsx +3 -0
  67. package/apps/studio/client/hooks/use-tabs.jsx +64 -35
  68. package/apps/studio/client/index-loader.ts +23 -3
  69. package/apps/studio/client/panels/ChatPanel.jsx +49 -57
  70. package/apps/studio/client/panels/CreateProject.jsx +19 -5
  71. package/apps/studio/client/panels/DiffView.jsx +314 -248
  72. package/apps/studio/client/panels/TeamProjects.jsx +119 -69
  73. package/apps/studio/client/panels/acp-runtime.js +25 -0
  74. package/apps/studio/client/panels/caps-cache.js +46 -0
  75. package/apps/studio/client/panels/chat-finish.js +66 -0
  76. package/apps/studio/client/shell/frame-cap.js +53 -0
  77. package/apps/studio/client/shell/viewport.jsx +45 -8
  78. package/apps/studio/client/styles/_index.css +2 -0
  79. package/apps/studio/client/tree/tree.jsx +48 -21
  80. package/apps/studio/client/v2/access/access-client.js +2 -0
  81. package/apps/studio/client/v2/access/access-host.jsx +12 -1
  82. package/apps/studio/client/v2/access/trashed-banner.jsx +6 -3
  83. package/apps/studio/client/v2/ai/Advanced.jsx +12 -0
  84. package/apps/studio/client/v2/ai/BackgroundStrip.jsx +120 -0
  85. package/apps/studio/client/v2/ai/Composer.jsx +27 -10
  86. package/apps/studio/client/v2/ai/StoppedDivider.jsx +2 -1
  87. package/apps/studio/client/v2/ai/ai-run.css +87 -3
  88. package/apps/studio/client/v2/ai/background-model.js +113 -0
  89. package/apps/studio/client/v2/ai/needs-you-store.js +2 -1
  90. package/apps/studio/client/v2/ai/run-api.js +7 -3
  91. package/apps/studio/client/v2/ai/runs-store.js +2 -1
  92. package/apps/studio/client/v2/annotations/vote-store.js +11 -5
  93. package/apps/studio/client/v2/assets/asset-state-lane.js +6 -3
  94. package/apps/studio/client/v2/assets/assets-bus.js +10 -8
  95. package/apps/studio/client/v2/assets/browse-view.jsx +2 -0
  96. package/apps/studio/client/v2/assets/ds-library-view.jsx +47 -0
  97. package/apps/studio/client/v2/assets/spotlight-model.js +75 -0
  98. package/apps/studio/client/v2/assets/spotlight.css +153 -0
  99. package/apps/studio/client/v2/assets/spotlight.jsx +199 -0
  100. package/apps/studio/client/v2/assets/tile-menu.jsx +3 -1
  101. package/apps/studio/client/v2/assets/tile.jsx +3 -0
  102. package/apps/studio/client/v2/assets/use-assets.js +2 -1
  103. package/apps/studio/client/v2/canvases/canvases-panel.jsx +13 -2
  104. package/apps/studio/client/v2/canvases/covers.js +11 -5
  105. package/apps/studio/client/v2/canvases/folder-ask.js +139 -0
  106. package/apps/studio/client/v2/canvases/folder-dialogs.jsx +150 -0
  107. package/apps/studio/client/v2/canvases/trash-canvas.js +10 -2
  108. package/apps/studio/client/v2/canvases/trash-queue.js +152 -0
  109. package/apps/studio/client/v2/canvases/use-canvas-index.js +42 -18
  110. package/apps/studio/client/v2/canvases/use-pins.js +2 -1
  111. package/apps/studio/client/v2/code/canvas-error-card.jsx +70 -5
  112. package/apps/studio/client/v2/code/canvas-imports-card.jsx +15 -14
  113. package/apps/studio/client/v2/code/canvas-imports-words.js +44 -0
  114. package/apps/studio/client/v2/code/canvas-waiting-card.jsx +128 -0
  115. package/apps/studio/client/v2/code/canvas-waiting.js +164 -0
  116. package/apps/studio/client/v2/code/code-bus.js +5 -0
  117. package/apps/studio/client/v2/code/code.css +67 -0
  118. package/apps/studio/client/v2/code/use-canvas-source.js +19 -4
  119. package/apps/studio/client/v2/create/NameDialog.jsx +4 -2
  120. package/apps/studio/client/v2/create/name-dialog.css +10 -0
  121. package/apps/studio/client/v2/ds/advanced-host.jsx +11 -23
  122. package/apps/studio/client/v2/ds/ds-refresh.js +161 -0
  123. package/apps/studio/client/v2/ds/library-host.jsx +45 -45
  124. package/apps/studio/client/v2/ds/make-host.jsx +13 -12
  125. package/apps/studio/client/v2/ds/off-system-host.jsx +18 -16
  126. package/apps/studio/client/v2/ds/review-host.jsx +7 -1
  127. package/apps/studio/client/v2/ds/truth-host.jsx +15 -14
  128. package/apps/studio/client/v2/ds/upgrade-host.jsx +26 -10
  129. package/apps/studio/client/v2/empty/arriving.jsx +29 -12
  130. package/apps/studio/client/v2/empty/empty-host.jsx +8 -2
  131. package/apps/studio/client/v2/empty/not-local.jsx +31 -1
  132. package/apps/studio/client/v2/empty/use-empty-canvas.js +10 -1
  133. package/apps/studio/client/v2/export/last-finished.js +2 -1
  134. package/apps/studio/client/v2/history/branch-actions.js +13 -9
  135. package/apps/studio/client/v2/history/git-advanced.jsx +8 -1
  136. package/apps/studio/client/v2/history/git-model.js +21 -5
  137. package/apps/studio/client/v2/history/git-parts.jsx +76 -43
  138. package/apps/studio/client/v2/history/history.css +6 -0
  139. package/apps/studio/client/v2/left-panel/assets-panel.jsx +87 -10
  140. package/apps/studio/client/v2/left-panel/use-trash.js +2 -1
  141. package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +100 -33
  142. package/apps/studio/client/v2/onboarding/HubSheet.jsx +51 -83
  143. package/apps/studio/client/v2/onboarding/onboarding-model.js +10 -6
  144. package/apps/studio/client/v2/presence/faces.jsx +42 -14
  145. package/apps/studio/client/v2/present/order-notes-artboards.js +2 -1
  146. package/apps/studio/client/v2/search/search-recent.js +3 -1
  147. package/apps/studio/client/v2/search/search-remote.js +6 -4
  148. package/apps/studio/client/v2/settings/connections-model.js +1 -1
  149. package/apps/studio/client/v2/shell/account-card.jsx +10 -4
  150. package/apps/studio/client/v2/shell/canvas-crash-guard.js +137 -0
  151. package/apps/studio/client/v2/shell/github-signin-host.jsx +42 -0
  152. package/apps/studio/client/v2/shell/menu-runner.js +12 -0
  153. package/apps/studio/client/v2/shell/occlusion-insets.js +14 -2
  154. package/apps/studio/client/v2/shell/project-account-card.jsx +203 -0
  155. package/apps/studio/client/v2/shell/project-account-model.js +182 -0
  156. package/apps/studio/client/v2/shell/recovery-store.js +2 -1
  157. package/apps/studio/client/v2/shell/served-routes.js +120 -0
  158. package/apps/studio/client/v2/shell/share-cluster-host.jsx +139 -11
  159. package/apps/studio/client/v2/shell/share-cluster.css +58 -0
  160. package/apps/studio/client/v2/shell/share-cluster.jsx +26 -7
  161. package/apps/studio/client/v2/shell/shell-activity.js +19 -0
  162. package/apps/studio/client/v2/shell/team-switch.js +94 -0
  163. package/apps/studio/client/v2/shell/too-heavy-card.jsx +38 -0
  164. package/apps/studio/client/v2/shell/use-account.js +8 -1
  165. package/apps/studio/client/v2/shell/use-occluded-insets.js +3 -0
  166. package/apps/studio/client/v2/sync-states/conflict-card.jsx +7 -2
  167. package/apps/studio/client/v2/undo/use-undo-projection.jsx +3 -1
  168. package/apps/studio/cloud/endpoints.ts +23 -1
  169. package/apps/studio/collab/persistence.ts +9 -1
  170. package/apps/studio/collab/registry.ts +32 -0
  171. package/apps/studio/collab/room.ts +8 -0
  172. package/apps/studio/config-reload-wire.ts +53 -0
  173. package/apps/studio/dist/client.bundle.js +1098 -1102
  174. package/apps/studio/dist/styles.css +1 -1
  175. package/apps/studio/ds/board/specimen.tsx +12 -1
  176. package/apps/studio/ds/canvas-cli.ts +58 -2
  177. package/apps/studio/ds/check.ts +26 -1
  178. package/apps/studio/ds/cli.ts +7 -3
  179. package/apps/studio/ds/convert.ts +34 -6
  180. package/apps/studio/ds/ds-verb.ts +13 -0
  181. package/apps/studio/ds/post-build.ts +38 -0
  182. package/apps/studio/ds/upgrade-apply.ts +27 -5
  183. package/apps/studio/ds/upgrade-cli.ts +22 -2
  184. package/apps/studio/ds/upgrade-prove.ts +198 -15
  185. package/apps/studio/ds/upgrade-stage.ts +4 -1
  186. package/apps/studio/editing/minimap-context.tsx +3 -3
  187. package/apps/studio/editing/page-activity.ts +251 -0
  188. package/apps/studio/editing/rotate-handle.tsx +9 -5
  189. package/apps/studio/editing/sticky-name.tsx +4 -4
  190. package/apps/studio/history/restore-artboard-action.ts +40 -0
  191. package/apps/studio/history/trash.ts +6 -0
  192. package/apps/studio/home/accounts.ts +87 -0
  193. package/apps/studio/home/hub.ts +77 -175
  194. package/apps/studio/home/index-reader.ts +24 -2
  195. package/apps/studio/home/routes.ts +66 -8
  196. package/apps/studio/http.ts +131 -68
  197. package/apps/studio/index-flight.ts +40 -0
  198. package/apps/studio/managed-projects.ts +52 -24
  199. package/apps/studio/migrate/hub.ts +7 -1
  200. package/apps/studio/routes/canvas-source.ts +44 -2
  201. package/apps/studio/routes/ds-convert.ts +18 -0
  202. package/apps/studio/routes/history.ts +28 -5
  203. package/apps/studio/routes/hub-signin.ts +115 -0
  204. package/apps/studio/routes/index.ts +4 -0
  205. package/apps/studio/routes/table.ts +7 -0
  206. package/apps/studio/routes/trash.ts +19 -1
  207. package/apps/studio/server.ts +19 -10
  208. package/apps/studio/sync/accepted-cold-start.ts +54 -16
  209. package/apps/studio/sync/accepted-link.ts +9 -4
  210. package/apps/studio/sync/asset-push.ts +146 -23
  211. package/apps/studio/sync/asset-state.ts +3 -2
  212. package/apps/studio/sync/code-module-consent.ts +74 -0
  213. package/apps/studio/sync/file-ledger.ts +35 -0
  214. package/apps/studio/sync/file-membership.ts +28 -3
  215. package/apps/studio/sync/file-plane.ts +483 -86
  216. package/apps/studio/sync/file-pull.ts +304 -33
  217. package/apps/studio/sync/hub-browser-signin.ts +377 -0
  218. package/apps/studio/sync/hub-link.ts +1 -2
  219. package/apps/studio/sync/hub-text-undo.ts +30 -10
  220. package/apps/studio/sync/index.ts +381 -161
  221. package/apps/studio/sync/journal-client.ts +94 -5
  222. package/apps/studio/sync/pending-deletes.ts +100 -0
  223. package/apps/studio/sync/projection.ts +121 -14
  224. package/apps/studio/sync/pull-pacer.ts +160 -0
  225. package/apps/studio/sync/pull-priority.ts +119 -0
  226. package/apps/studio/sync/seed-progress.ts +58 -3
  227. package/apps/studio/sync/status.ts +3 -1
  228. package/apps/studio/sync/transaction-client.ts +71 -6
  229. package/apps/studio/sync/workspace-signin.ts +6 -256
  230. package/apps/studio/sync/writer-registry.ts +5 -1
  231. package/apps/studio/thumbs/service.ts +12 -2
  232. package/apps/studio/thumbs/validate.ts +7 -0
  233. package/apps/studio/ui-prefs-migrate.ts +4 -0
  234. package/apps/studio/video-comp.tsx +23 -0
  235. package/apps/studio/video-links-overlay.tsx +3 -2
  236. package/apps/studio/whats-new.json +126 -0
  237. package/cli/lib/bash-guard.mjs +13 -1
  238. package/cli/lib/design-help.gen.mjs +1 -1
  239. package/cli/lib/design-hook.mjs +20 -0
  240. package/cli/lib/studio-locate.mjs +35 -10
  241. package/cli/lib/workspace-plan.mjs +14 -0
  242. package/package.json +8 -8
@@ -44,6 +44,7 @@ import {
44
44
  UserMessage,
45
45
  } from '../v2/ai/Feed.jsx';
46
46
  import { RunSurface } from '../v2/ai/RunSurface.jsx';
47
+ import { BackgroundStrip } from '../v2/ai/BackgroundStrip.jsx';
47
48
  import { useChatRuns } from '../v2/ai/use-chat-runs.js';
48
49
  import { cleanChatTitle, runTitleFor, shownChatTitle } from '../v2/ai/chat-list-model.js';
49
50
  import { useAiRuns } from '../v2/ai/runs-store.js';
@@ -60,6 +61,8 @@ import { WaitingCards } from '../v2/ai/WaitingCard.jsx';
60
61
  import { useAttachments } from '../v2/ai/use-attachments.js';
61
62
  import { notify } from '../../notifications.tsx';
62
63
  import { DEFAULT_TRANSCRIPT_VIEW, TRANSCRIPT_VIEWS } from './transcript-view.js';
64
+ import { createFinishTracker } from './chat-finish.js';
65
+ import { capsKeyFor, isEmptyCaps, loadCachedCaps, saveCachedCaps } from './caps-cache.js';
63
66
 
64
67
  // DDR-185 — shared "did a genuinely new item arrive" check for the
65
68
  // permission/elicitation effects below: both need the identical shape (diff
@@ -191,32 +194,37 @@ function ChatThread({
191
194
  unavailable = false,
192
195
  viewer = false,
193
196
  onConnected,
197
+ projectName = '',
194
198
  }) {
195
199
  // Live session capabilities (feature-acp-panel-dynamic-claude-code-
196
200
  // capabilities) — `caps` is THIS chat's own connection's mode roster +
197
201
  // config-option set, sourced entirely from the ACP session. Never a
198
202
  // hardcoded list; re-renders on every `caps` frame (a model switch can
199
203
  // change which OTHER options — effort, fast — are even offered).
200
- const [caps, setCaps] = useState({ modes: null, configOptions: [] });
201
- useEffect(() => conn.onCaps(setCaps), [conn]);
204
+ //
205
+ // 2.0.5 - nothing starts Claude until the person engages, so a fresh load has no live roster. The last one this
206
+ // project saw is shown straight away (`caps-cache.js`) and the first live frame replaces it. A cached roster is
207
+ // only DRAWN: the one-time reconcile below waits for a live one, so it never sends anything on its own.
208
+ const capsKey = capsKeyFor(projectName || designRel);
209
+ const [caps, setCaps] = useState(
210
+ () => loadCachedCaps(capsKey) ?? { modes: null, configOptions: [] }
211
+ );
212
+ const [capsLive, setCapsLive] = useState(false);
213
+ useEffect(
214
+ () =>
215
+ conn.onCaps((next) => {
216
+ if (isEmptyCaps(next)) return; // the replay of "nothing yet" must not wipe the cached roster
217
+ setCaps(next);
218
+ setCapsLive(true);
219
+ saveCachedCaps(capsKey, next);
220
+ }),
221
+ [conn, capsKey]
222
+ );
202
223
  const parsedOptions = useMemo(() => parseConfigOptions(caps.configOptions), [caps.configOptions]);
203
224
 
204
- // Warm up as soon as this chat becomes the VISIBLE one — the capability bar
205
- // has nothing to show until a live session exists, and deferring the spawn
206
- // to "the user typed a slash command" (the original Composer-only trigger,
207
- // still below) left the model/effort/mode row completely EMPTY until then —
208
- // read as "I lost the picker" in dogfooding, a real regression. Fires once
209
- // per chat; a chat that's opened but never viewed still doesn't spawn
210
- // `claude`, so a background/hidden chat keeps some of DDR-123's "opening
211
- // the panel costs nothing" intent — only the chat actually on screen warms.
212
- const warmedOnVisibleRef = useRef(false);
213
- useEffect(() => {
214
- // S5.13: nothing to warm while Claude Code is not ready; the effect runs again when it is.
215
- if (hidden || unavailable || warmedOnVisibleRef.current) return;
216
- warmedOnVisibleRef.current = true;
217
- const p = picksRef.current;
218
- conn.warm(chatId, p.model, p.effort, p.mode);
219
- }, [hidden, unavailable, conn, chatId, picksRef]);
225
+ // No `warm` here (2.0.5). This effect used to spawn the claude adapter whenever a chat was on screen, so every
226
+ // webview reload started another process. The composer (v2/ai/Composer.jsx) warms it when the person focuses or
227
+ // types in it; a send spawns it itself.
220
228
 
221
229
  // One-time reconciliation: if the user's persisted pick (from a DIFFERENT
222
230
  // chat, or an earlier session) isn't what THIS freshly-established session
@@ -227,7 +235,7 @@ function ChatThread({
227
235
  // it can never loop.
228
236
  const reconciledRef = useRef(false);
229
237
  useEffect(() => {
230
- if (reconciledRef.current) return;
238
+ if (reconciledRef.current || !capsLive) return;
231
239
  const hasModes = (caps.modes?.availableModes?.length ?? 0) > 0;
232
240
  const hasOptions = caps.configOptions.length > 0;
233
241
  if (!hasModes && !hasOptions) return; // nothing to reconcile against yet
@@ -254,7 +262,7 @@ function ChatThread({
254
262
  if (resolved !== caps.modes.currentModeId) conn.setMode(chatId, resolved);
255
263
  }
256
264
  // eslint-disable-next-line react-hooks/exhaustive-deps
257
- }, [caps, parsedOptions]);
265
+ }, [caps, capsLive, parsedOptions]);
258
266
 
259
267
  const onSetMode = useCallback(
260
268
  (modeId) => {
@@ -472,6 +480,8 @@ function ChatThread({
472
480
  <StoppedDivider chatId={chatId} hidden={hidden} />
473
481
  <JumpToLatest hidden={hidden} />
474
482
  </ThreadPrimitive.Viewport>
483
+ {/* Issue #177 — subagents and commands AI left running after its reply, with their time. */}
484
+ <BackgroundStrip conn={conn} />
475
485
  <WaitingCards chatId={chatId} designRel={designRel} />
476
486
  {/* S5.13 — the open question, a failure, or the kept prompt's line (client/v2/ai/NeedsYouSlot.jsx):
477
487
  a permission waits here, inline, never modal. */}
@@ -703,44 +713,25 @@ export default function ChatPanel({
703
713
  // (claude-agent-acp #773). Track live tool activity so the menubar
704
714
  // badge/dot + the "finished" ping reflect TRUE quiescence, not the
705
715
  // premature turn-end. (RCA issue-acp-subagent-activity-invisible.)
706
- let bgActive = false; // a tool (e.g. a subagent) is still running
707
- let busyNow = false; // the prompt turn itself is in flight
708
- let deferredFinish = false; // turn ended while background work continued
709
- const syncAggregate = () => {
710
- const wasAny = [...busyRef.current.values()].some(Boolean);
711
- busyRef.current.set(chatId, busyNow || bgActive);
712
- const nowAny = [...busyRef.current.values()].some(Boolean);
713
- if (wasAny !== nowAny) cbRef.current.onBusyChange?.(nowAny);
714
- };
715
- conn.onActivity((activeTools) => {
716
- bgActive = activeTools.length > 0;
717
- syncAggregate();
718
- if (deferredFinish && !bgActive && !busyNow) {
719
- deferredFinish = false;
720
- setBusyChats((prev) => ({ ...prev, [chatId]: false }));
721
- cbRef.current.onFinished?.();
722
- refreshChats();
723
- }
724
- });
725
- conn.onBusy((busy) => {
726
- busyNow = busy;
727
- syncAggregate();
728
- if (busy) {
729
- deferredFinish = false; // a new turn supersedes any pending drain ping
730
- setBusyChats((prev) => ({ ...prev, [chatId]: true })); // reactive dot
731
- return;
732
- }
733
- // Turn ended. If background work is still draining, keep the dot lit and
734
- // hold the "finished" ping until the activity list empties (onActivity).
735
- if (bgActive) {
736
- deferredFinish = true;
737
- refreshChats();
738
- } else {
739
- setBusyChats((prev) => ({ ...prev, [chatId]: false }));
740
- cbRef.current.onFinished?.();
741
- refreshChats();
742
- }
716
+ // Issue #177 — and the background tasks Claude Code reports (a subagent, a command left
717
+ // running), which outlive even their own tool call: they keep the dot lit and hold the ping too.
718
+ // When the chat counts as finished lives in chat-finish.js: only a busy → not-busy change is
719
+ // the end of a turn (the subscribe-time replay of an idle chat is not), and background work
720
+ // holds the ping until it drains.
721
+ const finish = createFinishTracker({
722
+ aggregate: (busy) => {
723
+ const wasAny = [...busyRef.current.values()].some(Boolean);
724
+ busyRef.current.set(chatId, busy);
725
+ const nowAny = [...busyRef.current.values()].some(Boolean);
726
+ if (wasAny !== nowAny) cbRef.current.onBusyChange?.(nowAny);
727
+ },
728
+ dot: (on) => setBusyChats((prev) => ({ ...prev, [chatId]: on })),
729
+ finished: () => cbRef.current.onFinished?.(),
730
+ refresh: () => refreshChats(),
743
731
  });
732
+ conn.onActivity((activeTools) => finish.activity(activeTools));
733
+ conn.onBackgroundTasks((tasks) => finish.tasks(tasks));
734
+ conn.onBusy((busy) => finish.busy(busy));
744
735
  return conn;
745
736
  },
746
737
  [refreshChats]
@@ -1019,6 +1010,7 @@ export default function ChatPanel({
1019
1010
  chatId={id}
1020
1011
  initialMessages={hydratedRef.current.get(id) || []}
1021
1012
  hidden={id !== activeChatId}
1013
+ projectName={projectName}
1022
1014
  picksRef={picksRef}
1023
1015
  setPick={setPick}
1024
1016
  activeCanvas={activeCanvas}
@@ -23,6 +23,7 @@ import {
23
23
  pickDirectory,
24
24
  } from '../github.js';
25
25
  import { reasonProps } from '../v2/access/disabled-reason.js';
26
+ import { menuRunner } from '../v2/shell/menu-runner.js';
26
27
 
27
28
  function Icon({ name, size = 16 }) {
28
29
  const p = {
@@ -206,11 +207,24 @@ function NewView({ identity, signedIn, onClose }) {
206
207
  </button>
207
208
  </div>
208
209
  <span className="cp-field-help">
209
- {local
210
- ? 'A local git repo on your computer — no GitHub, no remote. You can publish it later.'
211
- : signedIn
212
- ? 'A repo on your GitHub account, cloned to your computer.'
213
- : 'Sign in with GitHub (bottom-left) to publish. For now you can create a local project.'}
210
+ {local ? (
211
+ 'A local git repo on your computer — no GitHub, no remote. You can publish it later.'
212
+ ) : signedIn ? (
213
+ 'A repo on your GitHub account, cloned to your computer.'
214
+ ) : (
215
+ <>
216
+ {/* 2.0.5 W4 — the line is a button (account.github-signin); the rail it pointed at is gone */}
217
+ <button
218
+ type="button"
219
+ className="btn btn--sm"
220
+ data-testid="cp-github-signin"
221
+ onClick={() => menuRunner.run('account.github-signin')}
222
+ >
223
+ Sign in with GitHub…
224
+ </button>{' '}
225
+ to publish. For now you can create a local project.
226
+ </>
227
+ )}
214
228
  </span>
215
229
  </div>
216
230
  <label className="cp-field">