Skip to content

Add editor.writingToolsAffordance to config - #1856

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Nov 3, 2026
Merged

cyanzhong merged 1 commit into
mainfrom
develop

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

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

The window-update observer accesses view.window without first checking isViewLoaded, causing unrelated window updates to initialize an unused preloaded editor’s UI and install event monitors.

1 open issue
What changed in this PR

Adds editor.writingToolsAffordance to the runtime configuration, allowing users to control Writing Tools affordance visibility in the editor.

Changes:

  • Adds system-default, always-hidden, and complete-mode-only options.
  • Applies suppression through window-update notifications.
  • Extends runtime checks for the private window classes used by suppression.
File Description
MarkEditMac/​Sources/​Main/​AppRuntimeConfig.swift Defines affordance options, decoding, and defaults.
MarkEditMac/​Sources/​Editor/​Controllers/​EditorViewController.swift Applies the configured suppression policy.
MarkEditMac/​Modules/​Tests/​RuntimeTests.swift Checks for the targeted Writing Tools window classes.
MarkEditMac/​Modules/​Sources/​AppKitExtensions/​UI/​NSViewController+Extension.swift Adds notification-based affordance hiding.

Review effort: Balanced

@cyanzhong
cyanzhong force-pushed the develop branch 2 times, most recently from 9fd0ef2 to ff4b1db Compare November 3, 2026 06:57
@cyanzhong
cyanzhong requested a balanced review from Copilot November 3, 2026 06:59

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.

🔵 Needs a closer look

Suppression depends on private macOS window classes and notification/parent behavior, but tests only check class existence, leaving affordance hiding and continued manual Writing Tools invocation unverified on macOS 26 and 27.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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.

🔵 Needs a closer look

Suppression relies on undocumented macOS window classes and ordering behavior, requiring native UI validation across supported versions to confirm it hides only the affordance without disrupting Writing Tools.

No open issues 🎉

Review effort: Balanced

@cyanzhong
cyanzhong merged commit 43ecedf into main Nov 3, 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.

2 participants