Skip to content

Implement showContextMenu options - #1816

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Oct 15, 2026
Merged

cyanzhong merged 1 commit into
mainfrom
develop

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Invalid numeric indices prevent menu presentation instead of using the documented no-highlight fallback.

1 open finding
What changed in this PR

Adds context-menu presentation options across the JavaScript API, Swift bridge, and macOS editor.

Changes:

  • Passes highlightedIndex through to native menu presentation.
  • Checks item eligibility and JavaScript state before highlighting.
  • Updates the API dependency and adds regression tests.
File Description
MarkEditMac/​Tests/​ContextMenuTests.swift Tests native highlighting and item state.
MarkEditMac/​Sources/​Editor/​Controllers/​EditorViewController+UI.swift Implements initial menu highlighting.
MarkEditMac/​Sources/​Editor/​Controllers/​EditorViewController+Delegate.swift Forwards the requested index.
MarkEditMac/​Modules/​Tests/​FileVersionTests.swift Updates the delegate stub.
MarkEditKit/​Tests/​MoveFileTests.swift Updates the delegate stub.
MarkEditKit/​Sources/​Bridge/​Native/​Modules/​EditorModuleAPI.swift Extends native API forwarding.
MarkEditKit/​Sources/​Bridge/​Native/​Generated/​NativeModuleAPI.swift Decodes the optional index.
MarkEdit.xcodeproj/​project.pbxproj Registers context-menu tests and reorders entries.
CoreEditor/​yarn.lock Locks the updated API dependency.
CoreEditor/​test/​nestedEditors.test.ts Tests options, geometry, and index validation.
CoreEditor/​src/​bridge/​native/​api.ts Extends the bridge interface.
CoreEditor/​src/​api/​ui.ts Accepts, validates, and forwards options.
CoreEditor/​package.json Updates markedit-api to v0.38.0.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CoreEditor/src/api/ui.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Seven new test cases expect exceptions instead of the implemented and documented unhighlighted-menu fallback.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Comment thread CoreEditor/test/nestedEditors.test.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review identified no blocking issues in validation, bridge propagation, or native highlighting; tests were not executed.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@cyanzhong
cyanzhong merged commit 7a309f2 into main Oct 15, 2026
2 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.

3 participants