Skip to content

[codex] Guard markdown widget file handling#98

Merged
samuelstroschein merged 1 commit into
mainfrom
codex/guard-markdown-widget-files
Jun 12, 2026
Merged

[codex] Guard markdown widget file handling#98
samuelstroschein merged 1 commit into
mainfrom
codex/guard-markdown-widget-files

Conversation

@samuelstroschein

@samuelstroschein samuelstroschein commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

  • prevent non-markdown files from mounting the markdown editor
  • show an unsupported-file placeholder that asks users to open an issue on GitHub
  • fail closed when syncing the active markdown file id if a file widget lacks a markdown path
  • add focused coverage for markdown path detection, unsupported files, and file widget opening behavior

Validation

  • pnpm vitest run src/widget-runtime/widget-instance-helpers.test.ts
  • pnpm exec prettier --check src/lib/path.ts src/widget-runtime/widget-instance-helpers.ts src/widget-runtime/widget-instance-helpers.test.ts src/widgets/markdown/index.tsx src/shell/layout-shell.tsx src/widgets/files/index.tsx src/widgets/markdown/index.test.tsx src/widgets/files/index.test.tsx

Notes

  • The broader widget test suite and typecheck are blocked in this worktree by missing generated/submodule artifacts and SDK dependencies, including @markdown-wc/wasm and Lix SDK packages.

Note

Low Risk
Defensive UI and key-value sync changes with fail-closed behavior; low risk aside from users no longer having non-markdown files treated as the active markdown document.

Overview
Adds shared isMarkdownFilePath detection and uses it so only markdown paths get the TipTap editor and flashtype_active_file_id updates.

Non-markdown file tabs still open in the central panel but show an unsupported-file placeholder (no editor mount, no raw content shown) so binary/CSV formatting is not corrupted. The shell derives the active markdown file via activeMarkdownFileIdFromWidgetInstance, which requires a markdown filePath and ignores other file widgets. Files drag-and-drop and copy now reuse the same path check; GitHub issue links point at the general issues page.

Tests cover path helpers, placeholder/sync behavior, and opening CSV as a file widget tab.

Reviewed by Cursor Bugbot for commit fd1ddda. Bugbot is set up for automated code reviews on this repo. Configure here.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
flashtype-website fd1ddda Commit Preview URL

Branch Preview URL
Jun 12 2026, 01:14 AM

@samuelstroschein samuelstroschein marked this pull request as ready for review June 12, 2026 17:26
@samuelstroschein samuelstroschein merged commit 4f0252d into main Jun 12, 2026
3 checks passed
@samuelstroschein samuelstroschein deleted the codex/guard-markdown-widget-files branch June 12, 2026 17:26
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.

1 participant