Skip to content

[VW-0] Dark Mode Fixes for Workflow Editor, Asset / Vuln Dashboard#139

Merged
markglose-bc merged 3 commits into
mainfrom
dark-mode-fixes
May 22, 2026
Merged

[VW-0] Dark Mode Fixes for Workflow Editor, Asset / Vuln Dashboard#139
markglose-bc merged 3 commits into
mainfrom
dark-mode-fixes

Conversation

@markglose-bc
Copy link
Copy Markdown
Contributor

@markglose-bc markglose-bc commented May 22, 2026

Minor UI fixes for dark mode components, particularly in the Workflow Editor, Asset Dashboard and Vulnerability Dashboard

Workflow Editor

Before

Workflow Dark no fix

After

Background, controls and minimap are the main changes. Background turned charcoal grey as that's the default react-flow color, can make it more in line with other colors if needed

Workflow Dark fix

Asset Dashboard

Remediation Badges are the main change

Asset Dark

Vulnerability Dashboard

Badges & Alert Banner are the main changes here

Vuln Dark

Summary by CodeRabbit

  • Style
    • Enhanced dark mode support across badge, editor, and vulnerability components with theme-aware styling.
    • Updated destructive badge variant with improved design tokens.
    • Implemented theme-based color configuration for the editor UI elements including minimap and background.
    • Expanded vulnerability priority styling with dark mode variants for better visual consistency.

Review Change Stack

@markglose-bc markglose-bc self-assigned this May 22, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
viper Ignored Ignored May 22, 2026 4:21pm
viper-demo Ignored Ignored May 22, 2026 4:21pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

📝 Walkthrough

Walkthrough

This PR updates three UI components across the application with dark-mode and semantic theming support. Badge destructive styling switches to semantic design tokens. Editor configures React Flow UI with theme-aware colors and styles derived from next-themes. Vulnerabilities component extends priority styling with dark-mode variants and alert-specific CSS classes.

Changes

Theme-aware styling enhancements

Layer / File(s) Summary
Badge destructive variant semantic tokens
src/components/ui/badge.tsx
Badge destructive variant styling is replaced from hardcoded red color values to semantic destructive design tokens, with updated hover and focus-visible states.
Editor theme-aware React Flow UI configuration
src/features/editor/components/editor.tsx
Editor derives colorMode from next-themes and uses it to configure theme-dependent styling for React Flow background, controls, and minimap components with explicit CSS variables and computed colors.
Vulnerabilities dark-mode priority alert styling
src/features/vulnerabilities/components/vulnerabilities.tsx
Vulnerabilities component expands PrioritiesExplained configuration with dark-mode class variants for colors and new alertClass fields for Critical/High/Monitor/Defer priorities, then updates Alert rendering to use alertClass instead of colorBg.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • timrcm
  • 0xcad
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: dark mode fixes across the Workflow Editor, Asset Dashboard, and Vulnerability Dashboard components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dark-mode-fixes

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/features/editor/components/editor.tsx (1)

43-48: 💤 Low value

Consider consistent color approach for light and dark modes.

Light mode uses a hardcoded RGB color rgb(100 116 139 / 0.55) for background dots while dark mode uses the CSS variable var(--border). While the comment mentions this is a workaround, this inconsistency could make theme maintenance harder.

Consider defining a CSS variable for the light mode dot color as well, or document why the hardcoded value is necessary for light mode visibility.

♻️ Alternative approach using CSS variables

If your theme system supports it, define semantic variables:

  const backgroundDotColor =
-   colorMode === "dark" ? "var(--border)" : "rgb(100 116 139 / 0.55)";
+   colorMode === "dark" ? "var(--border)" : "var(--border-light, rgb(100 116 139 / 0.55))";

This allows theme-level control while keeping the fallback.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/editor/components/editor.tsx` around lines 43 - 48, The
backgroundDotColor uses a hardcoded RGB for light mode while dark mode uses
var(--border); change backgroundDotColor to read a semantic CSS variable (e.g.,
var(--background-dot, rgb(100 116 139 / 0.55))) and update the comment to
explain the fallback, so both colorMode branches reference a CSS variable for
consistency (adjust miniMapMaskColor only if needed) and ensure the variable
name aligns with your theme tokens; if a theme variable cannot be added,
explicitly document in the comment why the hardcoded RGB is required.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/features/editor/components/editor.tsx`:
- Around line 39-42: resolvedTheme from useTheme can be undefined on initial
render causing colorMode to default to "light" incorrectly; update the logic
around resolvedTheme in the component (where useTheme(), resolvedTheme,
setEditor and editorAtom are used and colorMode is computed) to explicitly
handle undefined by using a fallback (e.g., use theme || 'system' or check
resolvedTheme !== undefined before deriving colorMode) or delay setting the
editor state until resolvedTheme is available (e.g., guard in an effect or
conditional render) so dark-mode users don't see a flash and the editorAtom
receives the correct "dark" or "light" value.

---

Nitpick comments:
In `@src/features/editor/components/editor.tsx`:
- Around line 43-48: The backgroundDotColor uses a hardcoded RGB for light mode
while dark mode uses var(--border); change backgroundDotColor to read a semantic
CSS variable (e.g., var(--background-dot, rgb(100 116 139 / 0.55))) and update
the comment to explain the fallback, so both colorMode branches reference a CSS
variable for consistency (adjust miniMapMaskColor only if needed) and ensure the
variable name aligns with your theme tokens; if a theme variable cannot be
added, explicitly document in the comment why the hardcoded RGB is required.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73f54cac-4356-4d8d-9da7-459f20e933a9

📥 Commits

Reviewing files that changed from the base of the PR and between d1d9da0 and 9830507.

📒 Files selected for processing (3)
  • src/components/ui/badge.tsx
  • src/features/editor/components/editor.tsx
  • src/features/vulnerabilities/components/vulnerabilities.tsx

Comment on lines +39 to +42
const { resolvedTheme } = useTheme();

const setEditor = useSetAtom(editorAtom);
const colorMode = resolvedTheme === "dark" ? "dark" : "light";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Handle undefined resolvedTheme during initial render.

resolvedTheme from next-themes can be undefined during the initial render before the theme is resolved, which will default colorMode to "light". This may cause a brief flash or incorrect initial rendering in dark mode.

Consider using theme with a fallback or handling the undefined case explicitly:

💡 Proposed fix to handle undefined theme
- const { resolvedTheme } = useTheme();
+ const { resolvedTheme = "light" } = useTheme();

Or handle it more explicitly:

  const { resolvedTheme } = useTheme();
- const colorMode = resolvedTheme === "dark" ? "dark" : "light";
+ const colorMode = resolvedTheme === "dark" ? "dark" : resolvedTheme === "light" ? "light" : "light";

Alternatively, consider using the theme prop with system as a fallback if you want to respect system preferences during the initial render.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { resolvedTheme } = useTheme();
const setEditor = useSetAtom(editorAtom);
const colorMode = resolvedTheme === "dark" ? "dark" : "light";
const { resolvedTheme = "light" } = useTheme();
const setEditor = useSetAtom(editorAtom);
const colorMode = resolvedTheme === "dark" ? "dark" : "light";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/editor/components/editor.tsx` around lines 39 - 42,
resolvedTheme from useTheme can be undefined on initial render causing colorMode
to default to "light" incorrectly; update the logic around resolvedTheme in the
component (where useTheme(), resolvedTheme, setEditor and editorAtom are used
and colorMode is computed) to explicitly handle undefined by using a fallback
(e.g., use theme || 'system' or check resolvedTheme !== undefined before
deriving colorMode) or delay setting the editor state until resolvedTheme is
available (e.g., guard in an effect or conditional render) so dark-mode users
don't see a flash and the editorAtom receives the correct "dark" or "light"
value.

@markglose-bc markglose-bc merged commit d65be63 into main May 22, 2026
13 checks passed
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