improvements

This commit is contained in:
2026-07-29 14:17:56 +02:00
parent 03e16d49a1
commit daf8945da7
9 changed files with 204 additions and 29 deletions

View File

@@ -36,6 +36,10 @@ const api = {
reveal: (path: string): void => { ipcRenderer.invoke('shell:reveal', path) },
},
notes: {
read: (): Promise<string> => ipcRenderer.invoke('notes:read'),
write: (text: string): Promise<void> => ipcRenderer.invoke('notes:write', text),
},
git: {
load: () => ipcRenderer.invoke('git:load'),
stage: (paths: string[]) => ipcRenderer.invoke('git:stage', paths),
@@ -110,6 +114,13 @@ const api = {
return () => ipcRenderer.removeListener('config:changed', handler)
},
/** Subscribe to the window entering/leaving fullscreen. Returns an unsubscribe. */
onFullscreen: (cb: (on: boolean) => void): (() => void) => {
const handler = (_e: unknown, on: boolean): void => cb(on)
ipcRenderer.on('window:fullscreen', handler)
return () => ipcRenderer.removeListener('window:fullscreen', handler)
},
/** Subscribe to explicit ⌘R refresh requests (git + tree + viewer). Returns an unsubscribe. */
onRefresh: (cb: () => void): (() => void) => {
const handler = (): void => cb()