Skip to content

Commit 97d570f

Browse files
masonwyatt23claude
andcommitted
fix: remove dead ExportEpubPayload + wire profile buttons to MCP pre-focus
Adversarial-review fixes (fix-then-ship): - Delete unused ExportEpubPayload interface (dead duplicate of ExportPayload) and its now-unused import in bridge.ts. - Add data-format={notion-html,slack-html,email-html} to the three export-profile buttons so the dialog's MCP auto-focus effect can target them. - Extend uiStore exportFormat union to ExportFormatHint (core formats + ExportProfileId) so profile pre-selection is type-representable. Whole-repo green: tsc --noEmit clean, vite build ok, 2512/2512 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b6ff3b2 commit 97d570f

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

src/components/export/ExportDialog.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ export function ExportDialog() {
350350
<button
351351
type="button"
352352
className="export-format-btn"
353+
data-format="notion-html"
353354
disabled={busy}
354355
onClick={() => run("Notion HTML", () => exportWithProfile("notion-html", title))}
355356
>
@@ -367,6 +368,7 @@ export function ExportDialog() {
367368
<button
368369
type="button"
369370
className="export-format-btn"
371+
data-format="slack-html"
370372
disabled={busy}
371373
onClick={() => run("Slack (.txt)", () => exportWithProfile("slack-html", title))}
372374
>
@@ -384,6 +386,7 @@ export function ExportDialog() {
384386
<button
385387
type="button"
386388
className="export-format-btn"
389+
data-format="email-html"
387390
disabled={busy}
388391
onClick={() => run("Email HTML", () => exportWithProfile("email-html", title))}
389392
>

src/mcp/bridge.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export type {
9494
BatchExportProfileResult,
9595
BatchReadFileResult,
9696
BatchEditOpResult,
97-
ExportEpubPayload,
9897
StreamEditPayload,
9998
StreamEditApplyPayload,
10099
StreamEditCandidateResult,

src/mcp/handlers/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ export interface ExportPayload {
6060
outputPath?: string | null;
6161
}
6262

63-
export interface ExportEpubPayload {
64-
format: "epub";
65-
outputPath?: string | null;
66-
}
67-
6863
export interface MarkdownArchivePayload {
6964
outputPath?: string | null;
7065
includeAssets?: boolean;

src/store/uiStore.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
import { create } from "zustand";
22
import type { DocType } from "../lib/docClassifier";
3+
import type { ExportProfileId } from "../lib/exportTemplates";
4+
5+
/**
6+
* Format hint the export dialog can pre-focus on. Covers the four core
7+
* formats plus every export-profile id, so an MCP request (or command) that
8+
* targets a profile button (e.g. "notion-html") pre-selects it too.
9+
*/
10+
export type ExportFormatHint = "pdf" | "docx" | "html" | "epub" | ExportProfileId;
311

412
interface UiState {
513
exportOpen: boolean;
614
/** Format hint set by an MCP export request so the dialog pre-selects it. */
7-
exportFormat: "pdf" | "docx" | "html" | "epub" | null;
8-
openExport: (format?: "pdf" | "docx" | "html" | "epub" | null) => void;
15+
exportFormat: ExportFormatHint | null;
16+
openExport: (format?: ExportFormatHint | null) => void;
917
closeExport: () => void;
1018
settingsOpen: boolean;
1119
openSettings: () => void;
@@ -61,7 +69,7 @@ interface UiState {
6169
export const useUiStore = create<UiState>((set) => ({
6270
exportOpen: false,
6371
exportFormat: null,
64-
openExport: (format?: "pdf" | "docx" | "html" | "epub" | null) =>
72+
openExport: (format?: ExportFormatHint | null) =>
6573
set({ exportOpen: true, exportFormat: format ?? null }),
6674
closeExport: () => set({ exportOpen: false, exportFormat: null }),
6775
settingsOpen: false,

0 commit comments

Comments
 (0)