Skip to content

Adjust focus mode dimming for dark mode visibility#29

Merged
kristinaquinones merged 2 commits intomainfrom
copilot/fix-focus-mode-dark-compatibility
Dec 29, 2025
Merged

Adjust focus mode dimming for dark mode visibility#29
kristinaquinones merged 2 commits intomainfrom
copilot/fix-focus-mode-dark-compatibility

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Focus mode dims non-active paragraphs to help writers concentrate. The fixed 30% opacity made defocused text nearly invisible in dark mode.

Changes

  • Detect appearance mode using NSApp.effectiveAppearance
  • Apply adaptive dimming: 50% opacity in dark mode, 30% in light mode
  • Modified applyFocusMode() in EditorView.swift
// Before
textStorage.addAttribute(.foregroundColor, 
    value: NSColor.labelColor.withAlphaComponent(0.3), 
    range: fullRange)

// After
let isDarkMode = appearance.bestMatch(from: [.darkAqua, .aqua]) == .darkAqua
let dimmedAlpha: CGFloat = isDarkMode ? 0.5 : 0.3
textStorage.addAttribute(.foregroundColor, 
    value: NSColor.labelColor.withAlphaComponent(dimmedAlpha), 
    range: fullRange)

The higher opacity in dark mode preserves visibility while maintaining the focus effect.

Original prompt

This section details on the original issue you should resolve

<issue_title>UI/UX problem: Focus mode not fully compatible with Dark mode</issue_title>
<issue_description>Focus mode is not fully compatible with Dark Mode. Defocused sections are barely discernible.

Options:

  • Disable focus mode when Dark Mode is on
  • Adjust defocused content font color for Dark Mode.

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Note

Improves readability of defocused paragraphs in focus mode by adapting dimming to the system appearance.

  • In EditorView.swift applyFocusMode(), detect dark/light mode via NSApp.effectiveAppearance and set dimmedAlpha to 0.5 (dark) or 0.3 (light)
  • Apply NSColor.labelColor.withAlphaComponent(dimmedAlpha) to the full text, then restore full color for the current paragraph

Written by Cursor Bugbot for commit b4f04cd. This will update automatically on new commits. Configure here.

Adjust dimmed text opacity based on appearance mode. In dark mode, use 0.5 alpha instead of 0.3 for better visibility of defocused paragraphs.

Co-authored-by: kristinaquinones <5562083+kristinaquinones@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix focus mode compatibility with dark mode Adjust focus mode dimming for dark mode visibility Dec 29, 2025
@kristinaquinones kristinaquinones marked this pull request as ready for review December 29, 2025 17:49
@kristinaquinones kristinaquinones merged commit 7d8eef9 into main Dec 29, 2025
1 check passed
@kristinaquinones kristinaquinones deleted the copilot/fix-focus-mode-dark-compatibility branch December 29, 2025 17:54
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.

UI/UX problem: Focus mode not fully compatible with Dark mode

2 participants