You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug with constantly reverting back to light mode quicklook, even though OSX is in dark #309
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.
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.
Reacted by Alejandro Volkova, Lobay, Tangent and Chris Grieser
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.
This is the quicklook view I get when I switch to the HTML engine
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.
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)
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?
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.
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.
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...
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.
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,
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.
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
Activity
AWH1122 commentedon Apr 24, 2025
I seem to be having the same issue too.
sbarex commentedon Apr 24, 2025
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.
seaders commentedon Apr 24, 2025
This is the quicklook view I get when I switch to the HTML engine
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.
sbarex commentedon Apr 24, 2025
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)
seaders commentedon Apr 24, 2025
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?
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.
sbarex commentedon Apr 24, 2025
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
Highlightengine, 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:
seaders commentedon Jun 19, 2025
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...
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.
AWH1122 commentedon Jun 19, 2025
When doing this do you know what theme is actually being used to provide the colours for the highlighting?
seaders commentedon Jun 19, 2025
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,
AWH1122 commentedon Jun 19, 2025
No worries! seems to get the job done, nice to have a way to use RTF over HTML in dark mode.
smthpickboy commentedon Feb 17, 2026
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.
7anooch commentedon Oct 7, 2026
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