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

@@ -50,7 +50,6 @@ function renderCommandHook(
const actions = {
rename: vi.fn<ChatCommandActions['rename']>().mockResolvedValue(undefined),
timeline: vi.fn<ChatCommandActions['timeline']>(),
fork: vi.fn<ChatCommandActions['fork']>().mockResolvedValue(undefined),
compact: vi.fn<ChatCommandActions['compact']>().mockResolvedValue(undefined),
share: vi.fn<ChatCommandActions['share']>().mockImplementation(async () => {
context.shared = true;
@@ -63,6 +62,7 @@ function renderCommandHook(
toggleTimestamps:
vi.fn<ChatCommandActions['toggleTimestamps']>(),
toggleThinking: vi.fn<ChatCommandActions['toggleThinking']>(),
toggleProcess: vi.fn<ChatCommandActions['toggleProcess']>(),
copy: vi.fn<ChatCommandActions['copy']>().mockResolvedValue(undefined),
export: vi.fn<ChatCommandActions['export']>().mockResolvedValue(undefined),
project: vi.fn<ChatCommandActions['project']>().mockResolvedValue({
@@ -239,13 +239,6 @@ describe('useChatCommands', () => {
});
fixture.result.current.cancelDialog();
await fixture.run('/fork');
expect(fixture.result.current.dialog).toEqual({
kind: 'fork',
originatingDraft: '/fork',
});
fixture.result.current.cancelDialog();
await fixture.run('/compact');
expect(fixture.actions.compact).toHaveBeenCalledOnce();
@@ -275,6 +268,9 @@ describe('useChatCommands', () => {
await fixture.run('/thinking');
expect(fixture.actions.toggleThinking).toHaveBeenCalledOnce();
await fixture.run('/process');
expect(fixture.actions.toggleProcess).toHaveBeenCalledOnce();
await fixture.run('/copy');
expect(fixture.actions.copy).toHaveBeenCalledOnce();
@@ -343,26 +339,6 @@ describe('useChatCommands', () => {
expect(fixture.actions.undo).not.toHaveBeenCalled();
});
it('runs a fork selection as a single flight', async () => {
const deferred = Promise.withResolvers<void>();
const fixture = renderCommandHook('/fork');
fixture.actions.fork.mockReturnValue(deferred.promise);
await act(async () => fixture.result.current.tryExecuteDraft());
let first!: Promise<void>;
let second!: Promise<void>;
act(() => {
first = fixture.result.current.selectTimelineMessage('msg-user');
second = fixture.result.current.selectTimelineMessage('msg-user');
});
expect(fixture.actions.fork).toHaveBeenCalledOnce();
deferred.resolve();
await act(async () => {
await Promise.all([first, second]);
});
});
it('does not clear an identical current draft when a project command is cancelled', async () => {
const fixture = renderCommandHook('/Review same text');
fixture.actions.project.mockResolvedValueOnce({ status: 'cancelled' });