Repository navigation
Agentic Activity and Streaming UX #6901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3349c63
feat(webui): agentic activity & streaming UX — NEAR process indicator…
rdisandro 5877ad9
Merge branch 'main' into feat/agent-activity-streaming-ux
serrrfirat e8a56ea
fix(webui): address CodeRabbit review and CI (#6901)
serrrfirat ab81327
fix(ci): apply Cargo network retries in Docker builds (#6901)
serrrfirat e76efe8
fix(webui): keep run indicator visible
serrrfirat 1e7e077
feat(webui): retain completed run timing
serrrfirat cd981c9
fix(ci): address CodeRabbit review — verify chef ordering (#6901)
serrrfirat 1329aa9
fix(webui): address CodeRabbit activity review (#6901)
serrrfirat 0abbc35
Merge origin/main into feat/agent-activity-streaming-ux
serrrfirat 9af996b
fix(webui): format long run durations
serrrfirat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
crates/ironclaw_webui/frontend/src/pages/chat/components/chat-input.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| // @ts-nocheck | ||
| import assert from "node:assert/strict"; | ||
| import { test } from "vitest"; | ||
| import vm from "node:vm"; | ||
| import { componentSourceForTest } from "../../../lib/vm-component-harness"; | ||
|
|
||
| function chatInputSourceForTest() { | ||
| return componentSourceForTest( | ||
| new URL("./chat-input.tsx", import.meta.url), | ||
| "ChatInput", | ||
| ); | ||
| } | ||
|
|
||
| function renderChatInput({ sendDisabled = true, statusText = "" } = {}) { | ||
| const context = { | ||
| globalThis: {}, | ||
| Icon() {}, | ||
| Button() {}, | ||
| React: { | ||
| useCallback: (callback) => callback, | ||
| useEffect: () => {}, | ||
| useRef: (initial) => ({ current: initial }), | ||
| useState: (initial) => [ | ||
| typeof initial === "function" ? initial() : initial, | ||
| () => {}, | ||
| ], | ||
| }, | ||
| authScope: () => "test-scope", | ||
| commandMenuMatches: () => [], | ||
| commandMenuToken: () => null, | ||
| getDraft: () => "", | ||
| getStagedAttachments: () => [], | ||
| INITIAL_COMMAND_MENU_SELECTION: { index: 0, dismissed: false }, | ||
| NEW_DRAFT_KEY: "new", | ||
| useAttachmentConfig: () => ({ accept: [] }), | ||
| useT: () => (key) => key, | ||
| }; | ||
|
|
||
| vm.runInNewContext(chatInputSourceForTest(), context); | ||
| return context.globalThis.__testExports.ChatInput({ | ||
| onSend: () => {}, | ||
| disabled: false, | ||
| sendDisabled, | ||
| draftKey: "draft-key", | ||
| statusText, | ||
| }); | ||
| } | ||
|
|
||
| function containsScalar(value, expected, seen = new Set()) { | ||
| if (value === expected) return true; | ||
| if (!value || typeof value !== "object" || seen.has(value)) return false; | ||
| seen.add(value); | ||
| return Object.values(value).some((child) => | ||
| Array.isArray(child) | ||
| ? child.some((item) => containsScalar(item, expected, seen)) | ||
| : containsScalar(child, expected, seen) | ||
| ); | ||
| } | ||
|
|
||
| test("ChatInput only shows explicit composer status text while sending is disabled", () => { | ||
| const busyComposer = renderChatInput(); | ||
| assert.equal( | ||
| containsScalar(busyComposer, "chat.statusWorking"), | ||
| false, | ||
| "run progress belongs beside the thread indicator, not in the composer", | ||
| ); | ||
|
|
||
| const gatedComposer = renderChatInput({ statusText: "Approval required" }); | ||
| assert.equal( | ||
| containsScalar(gatedComposer, "Approval required"), | ||
| true, | ||
| "approval and cooldown notices should remain visible in the composer", | ||
| ); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
crates/ironclaw_webui/frontend/src/pages/chat/components/near-process-indicator.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| // @ts-nocheck | ||
| import assert from "node:assert/strict"; | ||
| import { test } from "vitest"; | ||
| import vm from "node:vm"; | ||
| import { componentSourceForTest } from "../../../lib/vm-component-harness"; | ||
| import "../../../test/vm-tsx-setup"; | ||
|
|
||
| const CLIP_ID = "near-clip-test"; | ||
|
|
||
| // Load the presentational component the same way connection-status.test.ts does: | ||
| // strip imports, expose the function, and run it in a VM with a mocked React so | ||
| // `React.useId()` returns a deterministic clipPath id. The vm-tsx-setup shim | ||
| // transpiles the JSX into inspectable `{ type, props, children }` nodes. | ||
| function loadNearProcessIndicator() { | ||
| const context = { | ||
| React: { useId: () => CLIP_ID }, | ||
| globalThis: {}, | ||
| }; | ||
| vm.runInNewContext( | ||
| componentSourceForTest( | ||
| new URL("./near-process-indicator.tsx", import.meta.url), | ||
| "NearProcessIndicator", | ||
| ), | ||
| context, | ||
| ); | ||
| return context.globalThis.__testExports.NearProcessIndicator; | ||
| } | ||
|
|
||
| function findNode(value, predicate, seen = new Set()) { | ||
| if (!value || typeof value !== "object" || seen.has(value)) return null; | ||
| seen.add(value); | ||
| if (Array.isArray(value)) { | ||
| for (const candidate of value) { | ||
| const match = findNode(candidate, predicate, seen); | ||
| if (match) return match; | ||
| } | ||
| return null; | ||
| } | ||
| if (predicate(value)) return value; | ||
| for (const key of ["children", "values"]) { | ||
| const candidates = Array.isArray(value[key]) ? value[key] : []; | ||
| for (const candidate of candidates) { | ||
| const match = findNode(candidate, predicate, seen); | ||
| if (match) return match; | ||
| } | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| const byClass = (name) => (node) => node.props?.className === name; | ||
|
|
||
| test("NearProcessIndicator working state chases the NEAR spine with elapsed time", () => { | ||
| const NearProcessIndicator = loadNearProcessIndicator(); | ||
| const rendered = NearProcessIndicator({ | ||
| state: "working", | ||
| label: "Working…", | ||
| elapsed: "0:03", | ||
| }); | ||
|
|
||
| assert.match(rendered.props.className, /\bnear-process\b/); | ||
| assert.match(rendered.props.className, /\bis-busy\b/); | ||
|
|
||
| // The canonical NEAR glyph is rendered while working; the busy-state class | ||
| // scopes its dimmed presentation in app.css. | ||
| const base = findNode(rendered, byClass("near-base")); | ||
| assert.notEqual(base, null, "base glyph should render"); | ||
| assert.ok(base.props.d.startsWith("M21.443"), "base uses the NEAR mark path"); | ||
|
|
||
| // The comet only exists while working, clipped to the glyph via the useId ref. | ||
| const comet = findNode(rendered, byClass("near-comet")); | ||
| assert.notEqual(comet, null, "comet should render while working"); | ||
| assert.ok(comet.props.d.startsWith("M2.6 22.2"), "comet rides the N spine"); | ||
| const clipGroup = findNode(rendered, (node) => node.props?.clipPath); | ||
| assert.equal(clipGroup.props.clipPath, `url(#${CLIP_ID})`); | ||
|
|
||
| // State-scoped CSS makes the working label strong; elapsed is shown beside it. | ||
| const label = findNode(rendered, byClass("near-process-label")); | ||
| assert.notEqual(label, null, "working label uses the shared label class"); | ||
| assert.equal(label.children[0], "Working…"); | ||
| const elapsed = findNode(rendered, byClass("near-process-elapsed")); | ||
| assert.notEqual(elapsed, null, "elapsed should render while working"); | ||
| assert.equal(elapsed.children[0], "0:03"); | ||
| }); | ||
|
|
||
| test("NearProcessIndicator done state is a solid, static glyph with a muted label", () => { | ||
| const NearProcessIndicator = loadNearProcessIndicator(); | ||
| const rendered = NearProcessIndicator({ state: "done", label: "Done" }); | ||
|
|
||
| assert.match(rendered.props.className, /\bis-done\b/); | ||
|
|
||
| const base = findNode(rendered, byClass("near-base")); | ||
| assert.ok(base.props.d.startsWith("M21.443"), "base uses the NEAR mark path"); | ||
|
|
||
| assert.equal( | ||
| findNode(rendered, byClass("near-comet")), | ||
| null, | ||
| "comet is hidden when done", | ||
| ); | ||
|
|
||
| const label = findNode(rendered, byClass("near-process-label")); | ||
| assert.notEqual(label, null, "done label uses the shared label class"); | ||
| assert.equal(label.children[0], "Done"); | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.