Skip to content

fix(styles): make GraphViz graph-level labels readable in dark mode#11697

Draft
jd wants to merge 1 commit into
mainfrom
devs/jd/worktree-caption/make-graphviz-graph-level-labels-readable-dark--861269fc
Draft

fix(styles): make GraphViz graph-level labels readable in dark mode#11697
jd wants to merge 1 commit into
mainfrom
devs/jd/worktree-caption/make-graphviz-graph-level-labels-readable-dark--861269fc

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented Jun 1, 2026

GraphViz diagrams are rendered to static SVG at build time, so a
graph-level label (e.g. "Merge Queue" on the batches page) becomes a
<text> element with no fill attribute and defaults to black. That is
fine on the light page background but invisible in dark mode.

Add a CSS rule that colors the graph-level label with --theme-text so
it adapts to the active theme. The svg.graph > g.graph > text selector
targets only the top-level caption — node labels (g.node > text) and
cluster labels (g.cluster > text, which carry their own colors on
filled backgrounds) are unaffected. This also fixes the same latent
issue on other diagrams with top-level captions (scopes, parallel
scopes, monorepo CI, performance, etc.).

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

GraphViz diagrams are rendered to static SVG at build time, so a
graph-level `label` (e.g. "Merge Queue" on the batches page) becomes a
`<text>` element with no `fill` attribute and defaults to black. That is
fine on the light page background but invisible in dark mode.

Add a CSS rule that colors the graph-level label with `--theme-text` so
it adapts to the active theme. The `svg.graph > g.graph > text` selector
targets only the top-level caption — node labels (`g.node > text`) and
cluster labels (`g.cluster > text`, which carry their own colors on
filled backgrounds) are unaffected. This also fixes the same latent
issue on other diagrams with top-level captions (scopes, parallel
scopes, monorepo CI, performance, etc.).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Change-Id: I861269fc345aff13be984af43b88ab3f37571a89
Copilot AI review requested due to automatic review settings June 1, 2026 15:36
@mergify mergify Bot had a problem deploying to Mergify Merge Protections June 1, 2026 15:36 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jun 1, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.
  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]
    • author = mergify-ci-bot

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success = build
    • check-success = lint
    • check-success = test
    • any of:
      • check-success = test-broken-links
      • label = ignore-broken-links
    • any of:
      • check-success=Cloudflare Pages
      • -head-repo-full-name~=^Mergifyio/

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@mergify mergify Bot requested a review from a team June 1, 2026 15:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an accessibility/legibility issue where GraphViz “graph-level” captions in statically-rendered SVGs default to black text, making them unreadable on dark backgrounds. It does so by applying the site theme’s text color to only the top-level <text> element directly under g.graph, leaving node/cluster labels unchanged.

Changes:

  • Add a CSS rule to set fill: var(--theme-text) for svg.graph > g.graph > text so graph-level labels adapt to light/dark themes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants