perf: optimize app startup and background lifecycles

This commit is contained in:
inman committed 2026-08-19 00:56:15 +08:00
1 parent 31332f6d76
commit 927e13349b
121 files changed
+4359 -1400

No files matched your search

+6 -6
View File
@@ -1411,8 +1411,8 @@ describe('ImageCanvas Workspace-first design experience', () => {
} satisfies DesignAssistantDeltaEvent);
});
expect(screen.getByTestId('image-workspace-conversation'))
.toHaveTextContent('可以先增加');
await waitFor(() => expect(screen.getByTestId('image-workspace-conversation'))
.toHaveTextContent('可以先增加'));
expect(screen.getByTestId('image-workspace-conversation'))
.not.toHaveTextContent('留白和水流节奏');
@@ -1429,8 +1429,8 @@ describe('ImageCanvas Workspace-first design experience', () => {
} satisfies DesignAssistantDeltaEvent);
});
expect(screen.getByTestId('image-workspace-conversation'))
.toHaveTextContent('可以先增加留白和水流节奏。');
await waitFor(() => expect(screen.getByTestId('image-workspace-conversation'))
.toHaveTextContent('可以先增加留白和水流节奏。'));
act(() => response.resolve({
...conversationFixture(),
turnRevision: 2,
@@ -1475,8 +1475,8 @@ describe('ImageCanvas Workspace-first design experience', () => {
expect(await screen.findByText('继续优化海报')).toBeInTheDocument();
expect(await screen.findByText('已完成最新方向整理。')).toBeInTheDocument();
expect(openImageWorkspaceTaskEventsMock).toHaveBeenCalledOnce();
expect(taskEventSource.close).not.toHaveBeenCalled();
expect(openImageWorkspaceTaskEventsMock).toHaveBeenCalledTimes(2);
expect(taskEventSource.close).toHaveBeenCalledOnce();
await act(async () => {
response.resolve(canonical);