Skip to content

Add selection-aware custom menu items#11

Merged
gtokman merged 1 commit into
mainfrom
codex/selection-aware-menu-items
Jul 12, 2026
Merged

Add selection-aware custom menu items#11
gtokman merged 1 commit into
mainfrom
codex/selection-aware-menu-items

Conversation

@gtokman

@gtokman gtokman commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an isAvailable predicate to LTXCustomMenuItem
  • reevaluate custom actions as the selected range changes, including handle drags
  • expose MarkdownTextView.selectionChangeHandler
  • apply the same availability behavior on iOS, Mac Catalyst, and macOS

Why

Consumers need mutually exclusive selection commands such as Highlight and Unhighlight. Previously the menu was rendered before the selection-change delegate callback, so the visible action lagged behind the current dragged range.

Validation

  • swift build
  • swift test --filter SelectionMenuTests (2 tests passed)
  • full swift test runs 134 tests; the two existing grammar-trait-dependent tests fail because the default package traits do not enable Python or Swift grammars

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
markdown-view Ready Ready Preview, Comment, Open in v0 Jul 12, 2026 4:44pm

Request Review

@gtokman
gtokman marked this pull request as ready for review July 12, 2026 16:46
@gtokman
gtokman merged commit 0250d3a into main Jul 12, 2026
5 of 6 checks passed
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