Skip to content

fix(viewer): keep the dark palette to the viewer's own parts - #125

Merged
skjnldsv merged 2 commits into
mainfrom
fix/dark-palette-chrome-only
Oct 7, 2026
Merged

skjnldsv merged 2 commits into
mainfrom
fix/dark-palette-chrome-only

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

The viewer set its dark palette (--color-main-text and friends) on the whole modal, so it reached into what a handler shows. Under a light theme, a document in Text came out white on #171717 below Text's light menu bar, and printed in grey: Text's print snapshot test on nextcloud/text#9235 fails on it.

The palette now only applies to the viewer's own parts on the dark backdrop: the header, the previous and next arrows, the close button, and the loading and error states. A handler's content keeps the theme's colours, which is what the old viewer did for theme: 'default'. Pictures and videos look the same.

The existing contrast test for the header still passes; a new one checks a handler's element keeps the theme's text colour, and fails on main. Built into Text locally, a document shows white with #222 text under the light theme, below the dark header.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

It was set on the whole modal and reached into what a handler shows: under a light theme a document in Text came out white on black below its light menu bar, and printed grey. The header, arrows, close button, loading and error states keep it.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv skjnldsv added this to the 2.0.0 milestone Oct 6, 2026
@skjnldsv skjnldsv added type: bug 🐛 Something isn't working AI assisted 3. to review labels Oct 6, 2026
@skjnldsv skjnldsv self-assigned this Oct 6, 2026
@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.33%. Comparing base (d3cf437) to head (6ff19d5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #125      +/-   ##
==========================================
+ Coverage   91.31%   91.33%   +0.01%     
==========================================
  Files          41       41              
  Lines        3524     3532       +8     
  Branches      815      816       +1     
==========================================
+ Hits         3218     3226       +8     
  Misses        287      287              
  Partials       19       19              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The viewer app gave a handler asking for the 'default' theme the user's own
theme: backdrop and header in the theme's colours, light or dark. The
library treated 'default' as dark, so Text opened as a light document in a
dark frame under a light theme. Port that back, with the same
--background-invert-if-dark check. A handler with no theme stays dark, as
every built-in one does.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv
skjnldsv merged commit a7f2467 into main Oct 7, 2026
21 checks passed
@skjnldsv
skjnldsv deleted the fix/dark-palette-chrome-only branch October 7, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted type: bug 🐛 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant