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
5 changes: 4 additions & 1 deletion apps/desktop/src/renderer/styles/chat-message.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@

/* Astryx clips the animated group body with overflow:hidden. `clip` preserves
that visual boundary without becoming a scroll ancestor that captures the
nested sticky row. */
nested sticky row. The inner wrapper is also a grid item: without an explicit
zero minimum its long, nowrap call preview becomes the track's minimum size
and stretches every expanded row past the turn instead of ellipsizing it. */
.maka-turn .maka-tool-activity-card > [role="button"] + div > div {
min-width: 0;
overflow: clip;
}

Expand Down
49 changes: 49 additions & 0 deletions packages/ui/stories/tool-activity.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import { useEffect, useRef } from 'react';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from 'storybook/test';
import { ToolCallDetail, ToolTrow } from '../src/tool-activity.js';
import type { ToolActivityItem } from '../src/materialize.js';
import {
Expand Down Expand Up @@ -231,3 +232,51 @@ export const ContiguousDiffGroup: Story = {
</Board>
),
};

const longIntentItems: ToolActivityItem[] = [
{
toolUseId: 'explore-agent-long-intent',
toolName: 'ExploreAgent',
displayName: '只读探索',
activityKind: 'tool',
status: 'completed',
intent: '审计模型选择、切换、持久化、event log、replay/resume 路径:当前模型事实由谁持有,何时切换,是否已有事件或消息可表达',
args: {},
},
{
toolUseId: 'explore-agent-long-intent-2',
toolName: 'ExploreAgent',
displayName: '只读探索',
activityKind: 'tool',
status: 'completed',
intent: '审计提示词构筑与缓存路径:追踪 durable system prompt、turnTailPrompt、provider-visible messages 与 request shape',
args: {},
},
];

// Regression path: a narrow conversation contains a grouped ExploreAgent run
// whose intent summaries are much wider than the reading column. Expanding the
// group must truncate those rows without widening the turn itself.
export const LongIntentGroupNarrow: Story = {
args: { items: longIntentItems },
render: (args) => (
<div className="maka-turn" data-testid="narrow-turn" style={{ margin: '0 auto', width: 320 }}>
<ToolTrow items={args.items} />
</div>
),
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const turn = canvas.getByTestId('narrow-turn');
const group = turn.querySelector<HTMLElement>('.maka-tool-activity-card');
expect(group).not.toBeNull();
const disclosure = group!.querySelector<HTMLElement>(
':scope > [role="button"][aria-controls]',
);
expect(disclosure).not.toBeNull();
await userEvent.click(disclosure!);
const rows = Array.from(group!.querySelectorAll<HTMLElement>('[role="button"]'));
expect(Math.max(...rows.map((row) => row.getBoundingClientRect().width))).toBeLessThanOrEqual(
turn.clientWidth + 8,
);
},
};