Skip to content

Bug with constantly reverting back to light mode quicklook, even though OSX is in dark #309

Open

Description

@seaders

I think this bug is best shown with a screenrecord:

darklight.mov.mp4

You can see that it's showing up as very bright light, despite me being in dark mode. When I then change to OSX's light mode, it changes to dark for a second (I think incorrectly?), and then back to light. Then I switch back to dark mode, and it does nothing. Then I go light mode, dark mode again, and it shows as dark mode, properly now, but when I go to another file, it's back in light mode again.

I looked in the code, as per the advice here https://developer.apple.com/documentation/uikit/supporting-dark-mode-in-your-interface which had this snippet

    observation = NSApp.observe(\.effectiveAppearance) { (app, _) in
        app.effectiveAppearance.performAsCurrentDrawingAppearance {
            // Invoke your non-view code that needs to be aware of the
            // change in appearance.
        }
    }

But the only reference to effectiveAppearance in the code is here,

    /// Check if the appearance is Dark
    lazy var isDarkMode: Bool = {
        // fixme: nell'estensione non sempre restituisce il valore aggiornato!
        if let appearance = self.view.effectiveAppearance.bestMatch(from: [.darkAqua, .aqua]) {
            return appearance == .darkAqua
        }
        return false
    }()

Which seems to be where the problem is. The fixme there is translated as

in the extension it does not always return the updated value

But yeah, for my experience, it's not a sometimes issue, this is never right, for me, when in dark mode.

Activity

  1. AWH1122 commented on Apr 24, 2025

    @AWH1122

    I seem to be having the same issue too.

  2. sbarex commented on Apr 24, 2025

    @sbarex
    Owner

    Try using the HTML rendering engine. The RTF on the dark theme has some bugs, macOS automatically changes the background.
    In a future release I think I will remove the choice and leave only the HTML engine.

  3. seaders commented on Apr 24, 2025

    @seaders
    Author

    This is the quicklook view I get when I switch to the HTML engine

    Image

    Which, for browsing through files, I'd absolutely hate to be forced into only having that @sbarex . For quickly scanning through files, the RTF view is essential IMO, even with the light mode issue / other bugs.

  4. sbarex commented on Apr 24, 2025

    @sbarex
    Owner

    this is unfortunately another limitation of macos, in gallery mode the html preview only shows the enlarged icon of the file (while the rtf preview shows the formatted text). Try to see in the quicklook window how it looks (press the space button)

  5. seaders commented on Apr 24, 2025

    @seaders
    Author

    Yeah no, that part is completely fine - including the dark mode issue. The popup view works 100% with HTML, but just checking now and the RTF issue seems to be backwards?

    Image

    Btw, I'm more than happy to spend a bit of time investigating this issue myself, I just wasn't totally sure how I go about installing the service locally from the XCode project. I was in there poking around the other day, but just don't have any of that specific MacOS app dev experience, on the services-ish side of things.

  6. sbarex commented on Apr 24, 2025

    @sbarex
    Owner

    I have not found any Apple documentation regarding RTF codes for managing dark mode. Theoretically it is possible to create RTF files that automatically adapt to the light/dark theme.

    By the way, the creation of the RTF output is managed by the external Highlight engine, so it is not easy to intervene. I remember that even just setting the background color was not a simple thing years ago. However, as long as it is not clear which RTF codes are needed, the problem of how to implement the corrections does not arise.

    Some ideas can be found in:

  7. seaders commented on Jun 19, 2025

    @seaders
    Author

    Okay so, I'm not sure exactly what's happening, but I did notice that, no matter what I did, it wasn't actually showing the light scheme, while I'm in dark mode settings. It was showing kinda an inverse of what I had chosen for the dark view, so... I chose a light view in the dark area and...

    Image

    I now have it working exactly as I want, and am getting more light mode jump scares. I don't REALLY care if this is a bug with this, or OSX, it now is working absolutely perfectly for me.

    If it is a bug, I hope this "solution" (hack) helps get to the cause of it, but yeah, I'm delighted now.

  8. AWH1122 commented on Jun 19, 2025

    @AWH1122

    When doing this do you know what theme is actually being used to provide the colours for the highlighting?

  9. seaders commented on Jun 19, 2025

    @seaders
    Author

    When doing this do you know what theme is actually being used to provide the colours for the highlighting?

    I honestly don't know exactly what's going on, but it's like a "darked" or some ways inverted version of the light mode selected for dark, chosen by checking "Show only light modes" in the dark area,

    Image

  10. AWH1122 commented on Jun 19, 2025

    @AWH1122

    No worries! seems to get the job done, nice to have a way to use RTF over HTML in dark mode.

  11. smthpickboy commented on Feb 17, 2026

    @smthpickboy

    Try using the HTML rendering engine. The RTF on the dark theme has some bugs, macOS automatically changes the background. In a future release I think I will remove the choice and leave only the HTML engine.

    Can we keep RTF engine and fix the theme issue in the future? Because the RTF engine resizes the window based on the actual code, whereas the HTML engine sometimes creates windows that are unnecessarily large.

  12. 7anooch commented on Oct 7, 2026

    @7anooch

    Came here to see if there was an open issue on the problem I was running into (this thread perfectly describes the bug/problem), including same behavior when using the HTML engine, etc. As far as I can tell the problem is that it is actually using the dark mode theme for some colors and reverting to the light mode variant for others, but I haven't done exhaustive testing so I can't tell for sure.

    Same fix also worked for me, using a light mode theme in the dark mode slot takes care of it. I don't ever use light mode so I can't speak to how things behave on that end.

    For reference, I'm using an apple silicon macbook (M4 pro) currently running Sequoia 15.7.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions