mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-08 20:58:45 +02:00
refactor: wire normalized intent into activity UI
- ChatPane header now prefers session.currentIntent over the activity- derived label from summarizeSessionActivity for the busy status display - TurnActivityPanel receives currentIntent via props and prefers it over extractLatestIntent (report_intent tool-call scanning) when the panel is active; falls back to tool-call scan for completed/inactive runs - This replaces the report_intent-as-status inference pattern with the normalized assistant-intent event data from the backend Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -530,7 +530,7 @@ export function ChatPane({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{isSessionBusy && !pendingApproval && !pendingUserInput && (() => {
|
{isSessionBusy && !pendingApproval && !pendingUserInput && (() => {
|
||||||
const label = summarizeSessionActivity(sessionActivity);
|
const label = session.currentIntent ?? summarizeSessionActivity(sessionActivity);
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-1.5 text-[12px] text-[var(--color-accent-sky)]">
|
<div className="flex items-center gap-1.5 text-[12px] text-[var(--color-accent-sky)]">
|
||||||
<span className="size-2 animate-pulse rounded-full bg-[var(--color-accent-sky)]" />
|
<span className="size-2 animate-pulse rounded-full bg-[var(--color-accent-sky)]" />
|
||||||
@@ -593,6 +593,7 @@ export function ChatPane({
|
|||||||
isActive={isTurnActive(item, itemIndex)}
|
isActive={isTurnActive(item, itemIndex)}
|
||||||
turnStartedAt={item.turnStartedAt}
|
turnStartedAt={item.turnStartedAt}
|
||||||
sessionId={session.id}
|
sessionId={session.id}
|
||||||
|
currentIntent={session.currentIntent}
|
||||||
agentNames={item.agentNames}
|
agentNames={item.agentNames}
|
||||||
isLastRunPanel={item.isLastRunPanel}
|
isLastRunPanel={item.isLastRunPanel}
|
||||||
onDiscard={onDiscardRunChanges}
|
onDiscard={onDiscardRunChanges}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ export interface TurnActivityPanelProps {
|
|||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
turnStartedAt?: string;
|
turnStartedAt?: string;
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
|
currentIntent?: string;
|
||||||
agentNames?: ReadonlySet<string>;
|
agentNames?: ReadonlySet<string>;
|
||||||
isLastRunPanel?: boolean;
|
isLastRunPanel?: boolean;
|
||||||
onDiscard?: (sessionId: string, runId: string, files?: ProjectGitFileReference[]) => Promise<unknown>;
|
onDiscard?: (sessionId: string, runId: string, files?: ProjectGitFileReference[]) => Promise<unknown>;
|
||||||
@@ -418,6 +419,7 @@ export function TurnActivityPanel({
|
|||||||
isActive,
|
isActive,
|
||||||
turnStartedAt,
|
turnStartedAt,
|
||||||
sessionId,
|
sessionId,
|
||||||
|
currentIntent,
|
||||||
agentNames,
|
agentNames,
|
||||||
isLastRunPanel,
|
isLastRunPanel,
|
||||||
onDiscard,
|
onDiscard,
|
||||||
@@ -471,8 +473,12 @@ export function TurnActivityPanel({
|
|||||||
return groupActivityStream(stream);
|
return groupActivityStream(stream);
|
||||||
}, [thinkingMessages, scopedEvents]);
|
}, [thinkingMessages, scopedEvents]);
|
||||||
|
|
||||||
// Extract intent text for the header
|
// Prefer the session-level normalized intent when active; fall back to
|
||||||
const intentText = useMemo(() => extractLatestIntent(scopedEvents), [scopedEvents]);
|
// scanning run timeline for report_intent tool calls (backward compat).
|
||||||
|
const intentText = useMemo(
|
||||||
|
() => (isActive ? currentIntent : undefined) ?? extractLatestIntent(scopedEvents),
|
||||||
|
[isActive, currentIntent, scopedEvents],
|
||||||
|
);
|
||||||
const fallbackSummary = useMemo(
|
const fallbackSummary = useMemo(
|
||||||
() => !intentText ? generateActivitySummary(scopedEvents) : undefined,
|
() => !intentText ? generateActivitySummary(scopedEvents) : undefined,
|
||||||
[intentText, scopedEvents],
|
[intentText, scopedEvents],
|
||||||
|
|||||||
Reference in New Issue
Block a user