Skip to content

Better Quick Look color scheme updating#1494

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Jun 17, 2026
Merged

Better Quick Look color scheme updating#1494
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.

Pull request overview

This PR improves Quick Look (PreviewExtension) theme syncing by driving the lightweight editor’s theme from the system/forced color scheme, and by updating the WKWebView/AppKit appearance together so the web content reacts to appearance changes more reliably.

Changes:

  • Replace the preview extension’s manual JS theme switching with a prefers-color-scheme-driven theme inside CoreEditor/src/@light.
  • Add a shared app-group UserDefaults.forcedColorScheme override so the host app can communicate light/dark forcing to the preview extension.
  • Consolidate preview appearance updates into updateAppearance() (background + webView.appearance) and simplify preview EditorConfig creation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
PreviewExtension/PreviewViewController+UI.swift Adds updateAppearance() and uses app-group forced color scheme to compute dark mode.
PreviewExtension/PreviewViewController.swift Switches from background/theme updates to a single updateAppearance() call; removes passing theme into preview config.
PreviewExtension/PreviewViewConfig.swift Removes theme parameter from previewConfig; hardcodes a placeholder theme string for @light.
MarkEditMac/Sources/Main/AppDocumentController.swift Writes forcedColorScheme during open panel lifetime to keep preview extension in sync with app appearance setting.
MarkEditCore/Sources/Extensions/UserDefaults+Extension.swift Introduces shared app-group forcedColorScheme storage API.
CoreEditor/src/@light/index.ts Derives theme from matchMedia('(prefers-color-scheme: dark)') and updates on changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread MarkEditMac/Sources/Main/AppDocumentController.swift
@cyanzhong cyanzhong merged commit 0178c79 into main Jun 17, 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