fix: resolve 12 critical runtime failures, security issue, and dead code

CRITICAL fixes:
- GitStatusPanel: use ipc.file.gitStage/gitCommit instead of non-existent top-level methods
- HeaderFooterDialog: use send/on channels instead of non-existent headerFooter namespace
- CodeMirrorEditor: use invoke('save-pasted-image') instead of non-existent savePastedImage
- ipc.ts: map to correct preload namespaces (git.status, git.stage, git.commit)
- Add pick-folder/pick-file to ALLOWED_SEND_CHANNELS whitelist
- Add git convenience namespace to preload (git.status/stage/commit/log/diff)

HIGH fixes:
- FindReplaceBar: replace broken match count stub with regex-based counter
- PDF export window: disable nodeIntegration, enable contextIsolation + sandbox
- Git handler: accept rootPath argument from renderer
- Add git-diff IPC handler + GitOperations.diff()

MEDIUM fixes:
- Remove 4 dead functions: checkPandocAvailable, safeExecFile, runPandoc, openPDFFile, exportWithPandocPDF
- Remove stale ODT header/footer console.log stub
- Rewrite electron.d.ts to match actual preload API shape
This commit is contained in:
2026-06-13 19:52:51 +05:30
parent f2398e6e1a
commit 21a00a53a4
15 changed files with 306 additions and 262 deletions
@@ -124,7 +124,11 @@ export function ExportHtmlDialog({ sourcePath }: { sourcePath: string }) {
</Select>
</div>
<div className="flex items-center gap-3">
<Switch checked={selfContained} onCheckedChange={setSelfContained} id="html-self-contained" />
<Switch
checked={selfContained}
onCheckedChange={setSelfContained}
id="html-self-contained"
/>
<Label htmlFor="html-self-contained">Self-contained (embed all CSS inline)</Label>
</div>
<label className="flex items-center gap-2">
@@ -155,7 +159,11 @@ export function ExportHtmlDialog({ sourcePath }: { sourcePath: string }) {
</div>
)}
<div className="flex items-center gap-3">
<Switch checked={numberSections} onCheckedChange={setNumberSections} id="html-number-sections" />
<Switch
checked={numberSections}
onCheckedChange={setNumberSections}
id="html-number-sections"
/>
<Label htmlFor="html-number-sections">Number sections</Label>
</div>
<div>