Skip to content
Closed
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
7 changes: 7 additions & 0 deletions apps/desktop/e2e/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,10 @@ test('remote access prioritizes a configured channel that needs attention', asyn
const recentFailure = settings.getByRole('alert').filter({ hasText: '最近一次失败' });
await expect(recentFailure).toContainText(runtimeError);
});

test('the platform settings shortcut opens settings', async ({ window: page }) => {
await page.keyboard.press(process.platform === 'darwin' ? 'Meta+,' : 'Control+,');
await expect(page.getByLabel('设置内容')).toBeVisible();
await page.keyboard.press('Escape');
await expect(page.getByLabel('设置内容')).toBeHidden();
});
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ type RendererMakaStub = {
projectGit: { isGitRepo: boolean };
}>;
};
appWindow: {
subscribeOpenSettings(callback: () => void): () => void;
};
connections: {
subscribeEvents(callback: (event: ConnectionEvent) => void): () => void;
};
Expand Down Expand Up @@ -920,9 +917,6 @@ function installFakeMaka(captured: CapturedSubscriptions): void {
projectGit: { isGitRepo: false },
}),
},
appWindow: {
subscribeOpenSettings: () => noop,
},
connections: {
subscribeEvents(callback: (event: ConnectionEvent) => void) {
captured.connectionSubscribeCount += 1;
Expand Down
3 changes: 0 additions & 3 deletions apps/desktop/src/main/daily-review-ipc-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ export function registerDailyReviewIpc(deps: DailyReviewIpcDeps): void {
ipcMain.handle('daily-review:get', (_event, archiveId: string) =>
deps.dailyReviewArchiveStore.getArchive(archiveId),
);
ipcMain.handle('daily-review:delete', async (_event, archiveId: string) => {
await deps.dailyReviewArchiveStore.deleteArchive(archiveId);
});
ipcMain.handle(
'daily-review:saveMarkdownToFile',
(_event, input: { markdown?: unknown; defaultName?: unknown } | undefined) =>
Expand Down
5 changes: 0 additions & 5 deletions apps/desktop/src/preload/bridge-contract.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,12 +609,8 @@ export interface MakaBridge {
getConfig?(): Promise<DailyReviewConfig>;
setConfig?(patch: Partial<DailyReviewConfig>): Promise<DailyReviewConfig>;
runOnce?(input: { range: DailyReviewRange; offsetDays?: number; modelKey?: string }): Promise<{ archiveId: string }>;
list?(): Promise<DailyReviewArchiveSummary[]>;
get?(archiveId: string): Promise<DailyReviewArchive | null>;
delete?(archiveId: string): Promise<void>;
listArchives?(): Promise<DailyReviewArchiveSummary[]>;
getArchive?(archiveId: string): Promise<DailyReviewArchive | null>;
deleteArchive?(archiveId: string): Promise<void>;
saveMarkdownToFile(input: {
markdown: string;
defaultName: string;
Expand All @@ -630,7 +626,6 @@ export interface MakaBridge {
*/
};
appWindow: {
subscribeOpenSettings(handler: () => void): () => void;
setTitlebarControlsVisible(visible: boolean): Promise<void>;
setThemeSource(themePref: ThemePreference): Promise<void>;
// PR-WINDOW-TITLEBAR-0: re-sync the native Windows titleBarOverlay
Expand Down
17 changes: 0 additions & 17 deletions apps/desktop/src/preload/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -942,24 +942,12 @@ const makaBridge = {
runOnce(input: { range: DailyReviewRange; offsetDays?: number; modelKey?: string }): Promise<{ archiveId: string }> {
return ipcRenderer.invoke('daily-review:runOnce', input);
},
list(): Promise<DailyReviewArchiveSummary[]> {
return ipcRenderer.invoke('daily-review:list');
},
listArchives(): Promise<DailyReviewArchiveSummary[]> {
return ipcRenderer.invoke('daily-review:list');
},
get(archiveId: string): Promise<DailyReviewArchive | null> {
return ipcRenderer.invoke('daily-review:get', archiveId);
},
getArchive(archiveId: string): Promise<DailyReviewArchive | null> {
return ipcRenderer.invoke('daily-review:get', archiveId);
},
delete(archiveId: string): Promise<void> {
return ipcRenderer.invoke('daily-review:delete', archiveId);
},
deleteArchive(archiveId: string): Promise<void> {
return ipcRenderer.invoke('daily-review:delete', archiveId);
},
/**
* PR-DAILY-REVIEW-EXPORT-FILE-0: render the markdown in the renderer
* (where the human-readable title context lives) and ship the bytes
Expand Down Expand Up @@ -989,11 +977,6 @@ const makaBridge = {
},
},
appWindow: {
subscribeOpenSettings(handler: () => void): () => void {
const listener = () => handler();
ipcRenderer.on('window:openSettings', listener);
return () => ipcRenderer.off('window:openSettings', listener);
},
setTitlebarControlsVisible(visible: boolean): Promise<void> {
return ipcRenderer.invoke('window:setTitlebarControlsVisible', visible);
},
Expand Down
5 changes: 0 additions & 5 deletions apps/desktop/src/renderer/app-shell-effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,6 @@ export function useAppShellBootstrapSubscriptions(options: {
}
},
);
const handleOpenSettings = useEffectEvent(() => {
options.openSettings();
});
const handlePlanChange = useEffectEvent(() => {
void options.refreshPlanReminders();
});
Expand Down Expand Up @@ -337,7 +334,6 @@ export function useAppShellBootstrapSubscriptions(options: {
void options.refreshConnections();
});
const unsubscribeSessionChanges = window.maka.sessions.subscribeChanges(handleSessionChange);
const unsubscribeOpenSettings = window.maka.appWindow.subscribeOpenSettings(handleOpenSettings);
const unsubscribePlanChanges = window.maka.plans.subscribeChanges(handlePlanChange);
const unsubscribePlanDue = window.maka.plans.subscribeDue(handlePlanDue);
markRendererMounted();
Expand All @@ -347,7 +343,6 @@ export function useAppShellBootstrapSubscriptions(options: {
unsubscribeConnections();
unsubscribeSettingsExternal();
unsubscribeSessionChanges();
unsubscribeOpenSettings();
unsubscribePlanChanges();
unsubscribePlanDue();
window.removeEventListener('keydown', handleKeyDown);
Expand Down
Loading