Skip to content

refactor(shared-notes): drop the DarkReader parts of the diagrams' light card - #26447

Merged
antobinary merged 1 commit into
bigbluebutton:v4.1.x-developfrom
antobinary:refactor-diagram-light-card-darkreader-leftovers-41
Nov 14, 2026
Merged

antobinary merged 1 commit into
bigbluebutton:v4.1.x-developfrom
antobinary:refactor-diagram-light-card-darkreader-leftovers-41

Conversation

@antobinary

Copy link
Copy Markdown
Member

What does this PR do?

Removes the DarkReader leftovers from the light card that shared notes draw behind diagrams. They came to 4.1 with the 4.0.2 merge (#26442):

  • bn-shared-notes/mermaid-on-demand.ts: the class="stylus" on the stylesheet that draws the card, and the comments about DarkReader.
  • sharednotes/blocknote/math-diagram.ts: Diagrams stay light cards in dark mode checked for that class. It now waits for the light card itself.

The card itself stays. 2 files, 6 lines added, 13 removed.

Why

Follow-up to this review comment on #26442.

DarkReader leaves stylesheets with the stylus class alone. On 4.0, where dark mode is DarkReader, the class kept DarkReader from recolouring the card. 4.1 replaced DarkReader with its own dark theme (theme-dark.css), and nothing in the client reads the class, so on 4.1 it does nothing.

The light card is still needed. BlockNote's diagram block cannot redraw a diagram when the theme changes (TypeCellOS/BlockNote#3219), so diagrams are always drawn in Mermaid's light theme, and the card keeps them readable in the dark theme. The comment now says only that.

The test polled until the diagram's SVG had a stylus stylesheet, then read the card's luminance once. It now polls the card's luminance (above 0.9) in both themes, and still checks that boxes stay lighter than their labels.

How was it tested?

  • html5: tsc --noEmit reports 0 errors, and eslint passes on the changed file.
  • Playwright project: format:check, lint and typecheck pass (the commands of the Playwright code check), and --list still lists the 4 tests of math-diagram.spec.ts.
  • After the change, git grep -i -E 'darkreader|stylus' finds nothing in bigbluebutton-html5/imports or bigbluebutton-tests/playwright.

The spec was not run on a server beforehand. It is @ci, so this PR's CI runs it against packages built from this branch.

Not in this PR

4.0 keeps the class and the test's check, because its dark mode is still DarkReader. The two open 4.0 changes to math-diagram.ts, #26410 and #26435, still apply cleanly on top of this, so the next 4.0 to 4.1 merge does not conflict here.

Closes Issue(s)

None.

…ght card

The light card that keeps diagrams readable came from 4.0.2 (bigbluebutton#26221)
with two parts that only matter under DarkReader: the `stylus` class on
the card's stylesheet, which DarkReader skips, and the comments that
explain it. 4.1 has no DarkReader (its dark theme is theme-dark.css,
and the dependency is gone), and nothing else reads the class, so it
does nothing here.

The card stays. The diagram block still cannot redraw a diagram on a
theme switch (TypeCellOS/BlockNote#3219), so
diagrams keep Mermaid's light theme, and the card keeps them readable
in the dark theme. The comment now says only that.

The e2e test checked the class (styleKeptFromDarkReader). It now polls
for the light card itself, and still checks in both themes that the
boxes stay lighter than their labels.
@antobinary antobinary added this to the Release 4.1 milestone Nov 6, 2026
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 4

  • v3.0.x-release
  • v3.0.x-develop
  • v4.0.x-release
  • v4.0.x-develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2d34f4d6-6cd5-4902-a495-92a28cadd9e1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

🚨 Automated tests failed

@germanocaumo germanocaumo 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.

LGTM

@antobinary
antobinary merged commit 09939e6 into bigbluebutton:v4.1.x-develop Nov 14, 2026
53 of 55 checks passed
@antobinary
antobinary deleted the refactor-diagram-light-card-darkreader-leftovers-41 branch November 14, 2026 00:18
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