Skip to content

Add theme picker preview window - #1738

Closed
cyanzhong wants to merge 0 commit into
mainfrom
develop
Closed

cyanzhong wants to merge 0 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

The unresolved main-actor isolation issue can prevent the warnings-as-errors build from compiling.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds floating previews for built-in themes in the editor settings menus when hovered.

Changes:

  • Adds palette data for built-in themes.
  • Introduces reusable preview panels.
  • Tracks native menu highlighting and positions previews.

Blocking critical finding: ThemeMenuPreview requires @MainActor isolation, or its controller initialization must move into an isolated initializer, to avoid strict-concurrency build failures.

File summaries
File Summary
MarkEditMac/Sources/Settings/EditorSettingsView.swift Integrates menu tracking and preview positioning.
MarkEditMac/Sources/Main/AppTheme.swift Defines preview palettes for built-in themes.
MarkEditMac/Modules/Sources/SharedUI/ThemePreview.swift Provides configurable floating preview panels.
MarkEditMac/Modules/Sources/SharedUI/MenuHighlightTracker.swift Reports highlighted native menu items.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread MarkEditMac/Sources/Settings/EditorSettingsView.swift 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.

🔵 Needs a closer look

Theme preview positioning has an unresolved coordinate-system issue.

Review details

Suppressed comments (1)

MarkEditMac/Sources/Settings/EditorSettingsView.swift:250

  • accessibilityFrame() uses the accessibility screen coordinate system, whose y-axis is top-down, while NSScreen.frame/visibleFrame and NSWindow.setFrameOrigin use AppKit's bottom-up screen coordinates. Passing this rect through unchanged makes the preview appear at the wrong vertical position (and can choose the wrong display on multi-monitor setups); convert the frame before both the screen lookup and placement.
        rowFrame: item?.accessibilityFrame()
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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

One or more issues must be addressed before approval.

Review details

Suppressed comments (1)

MarkEditMac/Modules/Sources/SharedUI/ThemePreview.swift:70

  • After rootView is replaced, fittingSize is read without forcing the hosting view to lay out. Since the panel is initially built with an empty preview, this can leave the first preview at a stale or zero size; the existing View.measuredSize helper explicitly calls needsLayout and layoutSubtreeIfNeeded() before reading fittingSize (MarkEditMac/Modules/Sources/TextCompletion/Extensions/View+Extension.swift:11-15). Flush the hosting view's layout before sizing the panel.
    panel.setContentSize(previewView.fittingSize)
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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