feat: update Makelore modules and conversations
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-07-31 10:08:41 +08:00
parent b8ca3f8eea
commit 80e8386fa6
175 changed files with 8036 additions and 10581 deletions

View File

@@ -1,6 +1,6 @@
import { fireEvent, render, screen } from '@testing-library/react';
import { describe, expect, it, vi } from 'vitest';
import { ExecutionGraphCard } from '@/pages/Chat/ExecutionGraphCard';
import { ExecutionGraphCard, formatExecutionDuration } from '@/pages/Chat/ExecutionGraphCard';
import { getToolVisibilityId } from '@/pages/Chat/chat-transcript';
import type { TaskStep } from '@/pages/Chat/task-visualization';
@@ -15,6 +15,50 @@ vi.mock('react-i18next', async (importOriginal) => {
});
describe('ExecutionGraphCard', () => {
it('shows only duration units that have elapsed', () => {
expect(formatExecutionDuration(2_500)).toBe('2s');
expect(formatExecutionDuration(62_500)).toBe('1m 2s');
expect(formatExecutionDuration(3_661_500)).toBe('1h 1m 1s');
expect(formatExecutionDuration(undefined)).toBe('—');
});
it('uses muted styling for the collapsed duration summary', () => {
render(
<ExecutionGraphCard
agentLabel="Makelore"
steps={[]}
active={false}
durationMs={2_500}
/>,
);
const summary = screen
.getByTestId('chat-execution-graph-expand')
.querySelector('span.truncate');
expect(summary).not.toBeNull();
expect(summary).toHaveClass('text-muted-foreground/70');
expect(summary).not.toHaveClass('text-foreground');
});
it('shows the current process summary while the graph is active', () => {
render(
<ExecutionGraphCard
agentLabel="Makelore"
steps={[{
id: 'tool-fetch',
label: 'web_fetch',
status: 'running',
kind: 'tool',
depth: 1,
}]}
active
expanded
/>,
);
expect(screen.getByTestId('chat-execution-graph-collapse')).toHaveTextContent('web_fetch');
});
it('drives the real graph step detail from the shared visibility set', () => {
const visibilityId = getToolVisibilityId('msg_assistant', 'tool-read', 0);
const onStepExpandedChange = vi.fn();
@@ -73,6 +117,12 @@ describe('ExecutionGraphCard', () => {
onExpandedChange={onExpandedChange}
/>,
);
expect(screen.getByTestId('chat-execution-graph')).toHaveAttribute(
'data-collapsed',
'true',
);
fireEvent.click(screen.getByTestId('chat-execution-graph-expand'));
expect(screen.getByTestId('chat-execution-graph')).toHaveAttribute(
'data-collapsed',
'false',