[codex] Fix Markdown default app registration#133
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
flashtype-website | 7e1255c | Commit Preview URL Branch Preview URL |
Jun 17 2026, 06:56 PM |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 553412f. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 553412f6ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export const REPLACEABLE_MARKDOWN_HANDLER_BUNDLE_IDS = new Set([ | ||
| APP_BUNDLE_ID, | ||
| "com.apple.dt.Xcode", | ||
| ]); |
There was a problem hiding this comment.
Treat TextEdit fallback as replaceable
When the existing Markdown default is macOS's TextEdit fallback (com.apple.TextEdit), this replacement allowlist treats it like a user-selected third-party Markdown editor, so getMarkdownContentTypesToRegister() returns nothing and the packaged /Applications/Flashtype.app never becomes the default. That regresses the previous first-run registration path for users whose .md files still open in TextEdit, while the preservation logic was meant for explicit third-party handlers such as VS Code or Obsidian.
Useful? React with 👍 / 👎.

Summary
Fix macOS Markdown default-app registration so Flashtype does not let old DMGs or local release builds compete with the installed app.
/Applications/Flashtype.appmay register Markdown defaultscom.flashtype.appregistrations before refreshing the installed appOwnertoAlternateRoot Cause
LaunchServices stores default document handlers by bundle id, not by app path. Multiple Flashtype bundles used
com.flashtype.appand claimed Markdown ownership, so macOS could resolve.mdopens to an old mounted DMG or local release build instead of the installed 0.2.x app.Validation
pnpm vitest run electron/markdown-default-handler.test.tspnpm oxlint --tsconfig ./tsconfig.json --ignore-path .gitignore electron/main.mjs electron/markdown-default-handler.mjs electron/markdown-default-handler.test.tspnpm typecheckgit diff --checkNote
Medium Risk
Startup code mutates system LaunchServices defaults and unregisters bundles; mistakes could affect which app opens Markdown or leave stale registrations, though scope is limited to darwin packaged installs and replaceable handlers.
Overview
Fixes macOS Markdown default-app behavior so multiple
com.flashtype.appbundles (DMGs, local builds) no longer steal.mdopens from the installed app.Markdown registration moves from inline logic in
electron/main.mjsintoelectron/markdown-default-handler.mjs. On startup, only/Applications/Flashtype.appmay register defaults: it unregisters stale non-canonical Flashtype bundles vialsregister, refreshes the canonical bundle, reads current editor handlers, and callsLSSetDefaultRoleHandlerForContentTypeonly for content types whose current handler is missing, Xcode, TextEdit, or Flashtype—third-party choices (e.g. VS Code, Obsidian) are left alone. Packagedelectron-builder.ymlchanges Markdown documentLSHandlerRankfromOwnertoAlternate. Vitest coverage documents the policy and full workflow.Reviewed by Cursor Bugbot for commit 7e1255c. Bugbot is set up for automated code reviews on this repo. Configure here.