feat: dark theme#1001
Merged
carlosthe19916 merged 1 commit intoguacsec:mainfrom Apr 16, 2026
Merged
Conversation
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Contributor
Reviewer's GuideImplements a theme system by integrating tsd-ui’s ThemeProvider with persisted theme mode, exposing a ThemeSelector in the header, and updating chart link styling to use theme-aware PatternFly tokens, along with dependency and asset updates. Sequence diagram for updating theme mode and persisting preferencesequenceDiagram
actor User
participant HeaderApp
participant ThemeSelector
participant ThemeProvider
participant useLocalStorage
participant LocalStorage
User->>HeaderApp: Open_header
HeaderApp->>ThemeSelector: Render_theme_selector
ThemeSelector->>ThemeProvider: setMode(newMode)
ThemeProvider->>useLocalStorage: updateMode(newMode)
useLocalStorage->>LocalStorage: setItem(theme-preference, newMode)
LocalStorage-->>useLocalStorage: confirm_write
useLocalStorage-->>ThemeProvider: mode_updated
ThemeProvider-->>HeaderApp: provide_updated_theme
HeaderApp-->>User: UI_re_rendered_with_new_theme
Class diagram for updated theming structure with ThemeProvider and ThemeSelectorclassDiagram
class App {
+string STORAGE_KEY
+ReactNode children
+render(): ReactElement
}
class ThemeProvider {
+ThemeMode mode
+function setMode(mode)
}
class useLocalStorage {
+function useLocalStorage(key, defaultValue)
}
class HeaderApp {
+render(): ReactElement
}
class ThemeSelector {
+render(): ReactElement
}
class MonitoringSection {
+render(): ReactElement
}
App --> ThemeProvider : wraps_with
App --> useLocalStorage : uses
HeaderApp --> ThemeSelector : renders
ThemeProvider <.. ThemeSelector : consumes_context
MonitoringSection --> ThemeProvider : uses_theme_tokens
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
ThemeSelectoris duplicated in both the desktop and mobileToolbarGroups; consider rendering it once and controlling its visibility via PatternFly breakpoint/visibility props to avoid divergence between the two instances. - The
STORAGE_KEYfor theme preference is exported fromApp.tsx; if it’s intended for reuse in multiple places, consider moving it to a dedicated config/constants module to avoid coupling unrelated components toApp.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `ThemeSelector` is duplicated in both the desktop and mobile `ToolbarGroup`s; consider rendering it once and controlling its visibility via PatternFly breakpoint/visibility props to avoid divergence between the two instances.
- The `STORAGE_KEY` for theme preference is exported from `App.tsx`; if it’s intended for reuse in multiple places, consider moving it to a dedicated config/constants module to avoid coupling unrelated components to `App`.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1001 +/- ##
==========================================
+ Coverage 66.92% 68.55% +1.63%
==========================================
Files 222 222
Lines 3891 3893 +2
Branches 904 904
==========================================
+ Hits 2604 2669 +65
+ Misses 946 879 -67
- Partials 341 345 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Theme selector
Summary by Sourcery
Introduce a configurable application theme with persisted user preference and integrate it into the global layout.
New Features:
Enhancements:
Build: