fix: wire orphaned IPC channels, fix data-loss bug, print preview events, sidebar navigation

- Fix file.clearRecent sending IPC to main process instead of clearing openTabs
- Wire show-batch-converter, show-document-compare, open-header-footer-dialog IPC channels
- Add print preview event listeners (mc:print-preview, mc:print-preview-styled) in App.tsx
- Fix sidebar hidden bridge buttons toggling sidebar closed after scroll
- Update sidebar menu labels to match actual sections (Files, Outline, Git)
- Fix ipc.print to be an object with show/doPrint methods (was bare function)
- Update callers: ExportPdfDialog, pdf-export, PrintPreview
- Add 7 regression tests for all fixes
- Clean 2 obsolete snapshots
- Build Linux packages (deb, AppImage, snap) — 549 tests passing
This commit is contained in:
2026-06-11 07:15:33 +05:30
parent e25a5e1d75
commit cf6b6817b9
11 changed files with 179 additions and 24 deletions
@@ -27,7 +27,10 @@ vi.mock('@/lib/ipc', () => ({
pickFile: vi.fn(),
onChange: vi.fn(),
},
print: vi.fn().mockResolvedValue({ ok: true }),
print: {
show: vi.fn().mockResolvedValue({ ok: true }),
doPrint: vi.fn().mockResolvedValue({ ok: true }),
},
menu: {
on: vi.fn(() => () => {}),
},
@@ -93,7 +96,7 @@ describe('Phase 8 toasts integration', () => {
});
it('exporting a file calls toast.success on success', async () => {
(ipc.print as any).mockResolvedValue({ ok: true });
(ipc.print.show as any).mockResolvedValue({ ok: true });
registerMenuCommands();
render(<App />);
@@ -107,7 +110,7 @@ describe('Phase 8 toasts integration', () => {
// The PDF flow hands the rendered HTML to the main process for print.
await waitFor(() => {
expect(ipc.print).toHaveBeenCalledTimes(1);
expect(ipc.print.show).toHaveBeenCalledTimes(1);
});
expect(toast.success).toHaveBeenCalledWith(expect.stringContaining('Sent test.md'));
});