Skip to content

feat: add export and import actions to slash command menu (#1165)#1168

Merged
sw-factory-automations merged 1 commit into
mainfrom
feat/1165-slash-command-export-import
May 21, 2026
Merged

feat: add export and import actions to slash command menu (#1165)#1168
sw-factory-automations merged 1 commit into
mainfrom
feat/1165-slash-command-export-import

Conversation

@sw-factory-automations
Copy link
Copy Markdown
Collaborator

Closes #1165

What

Adds "Export as Markdown" and "Import Markdown" options to the editor's slash command menu (/ typeahead), improving discoverability of these low-usage features.

How

  • Added optional onExport and onImport callback props to SlashCommandPlugin. When provided, the menu shows "Export as Markdown" (Download icon) and "Import Markdown" (Upload icon) at the bottom of the options list, after existing block insertion commands.
  • Wired the callbacks in PageViewClient:
    • Export reuses exportEditorToMarkdown + downloadMarkdown from markdown-utils.ts (same flow as the page menu).
    • Import reuses the useMarkdownImport hook (same file picker flow as the page menu), with a hidden <input type="file"> rendered alongside the editor.
  • Both options are filterable by typing (e.g., /export, /import).
  • The Editor component threads the callbacks via onSlashExport/onSlashImport props. Callers that don't provide them (database view, preview mode) simply don't show the options.
  • Page menu keyboard shortcuts (⌘⇧E for export) continue to work independently.

Testing

  • pnpm lint — 0 errors
  • pnpm typecheck — passes
  • pnpm test — 144 files, 1975 tests passed
  • Storybook: added FilteredExportImport story showing the two new options filtered by search
  • Visual regression: new baseline committed, all stories pass
  • E2E: demo editor tests pass (11/11). Authenticated E2E tests have pre-existing auth fixture failures unrelated to this change.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Building Building Preview, Comment May 21, 2026 2:59pm

Request Review

@sw-factory-automations sw-factory-automations merged commit 37e0392 into main May 21, 2026
9 checks passed
@sw-factory-automations sw-factory-automations deleted the feat/1165-slash-command-export-import branch May 21, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add export and import actions to the slash command menu

2 participants