fix(dashboard): adapt trace colors to theme - #9688
Merged
Merged
Conversation
C10H14N2O5
marked this pull request as ready for review
August 14, 2026 14:22
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider extracting the
rgba(var(--v-theme-on-surface), …)opacity levels into CSS variables or utility classes to avoid repetition and make it easier to adjust the visual hierarchy in one place later. - Where elements are meant to share the same visual weight (e.g.,
.trace-record-content,.event-sub,.trace-content pre), you might rely more on inheritance and fewer explicitcoloroverrides to keep the styling simpler and reduce maintenance overhead.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the `rgba(var(--v-theme-on-surface), …)` opacity levels into CSS variables or utility classes to avoid repetition and make it easier to adjust the visual hierarchy in one place later.
- Where elements are meant to share the same visual weight (e.g., `.trace-record-content`, `.event-sub`, `.trace-content pre`), you might rely more on inheritance and fewer explicit `color` overrides to keep the styling simpler and reduce maintenance overhead.
## Individual Comments
### Comment 1
<location path="dashboard/src/components/shared/TraceDisplayer.vue" line_range="377-381" />
<code_context>
font-weight: 600;
- color: #6b7280;
- border-bottom: 1px solid rgba(15, 23, 42, 0.12);
+ color: rgba(var(--v-theme-on-surface), 0.62);
+ border-bottom: 1px solid rgba(var(--v-theme-on-surface), 0.12);
padding-bottom: 10px;
</code_context>
<issue_to_address>
**suggestion:** Centralizing the commonly used opacities (0.62, 0.72, 0.88) into variables or utility classes would improve consistency and maintenance.
Several elements now use `rgba(var(--v-theme-on-surface), 0.62/0.72/0.88)` for different text levels. If these map to design-system roles (e.g., primary, secondary, muted), consider introducing named CSS variables or utility classes for each role so you can adjust hierarchy and accessibility centrally and avoid small value drift over time.
Suggested implementation:
```
:root {
/* Centralized text role opacities for trace-related UI */
--trace-text-primary: rgba(var(--v-theme-on-surface), 0.88);
--trace-text-secondary: rgba(var(--v-theme-on-surface), 0.62);
--trace-text-muted: rgba(var(--v-theme-on-surface), 0.72);
}
.trace-header {
font-weight: 600;
color: var(--trace-text-secondary);
border-bottom: 1px solid rgba(var(--v-theme-on-surface), 0.12);
padding-bottom: 10px;
}
```
```
.event-title {
font-weight: 600;
color: var(--trace-text-primary);
}
```
1. If this component uses 0.72 opacity for any text (for example, in `.event-meta` or other selectors not shown here), replace `rgba(var(--v-theme-on-surface), 0.72)` with `var(--trace-text-muted)`.
2. Consider moving the `:root { --trace-text-* }` variables into a global stylesheet or a higher-level layout component if these roles are shared across multiple components, so they truly act as design-system tokens.
3. Search the rest of the codebase for `rgba(var(--v-theme-on-surface), 0.62)`, `0.72`, and `0.88` and replace them with the corresponding variables to maintain consistency.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Soulter
approved these changes
Aug 15, 2026
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.
TL;DR
on-surfaceopacitiesBackground
Fixes #9683
TraceDisplayer.vuecurrently uses several hard-coded text colors such as#1f2937,#4b5563, and#6b7280, together with divider colors based onrgba(15, 23, 42, ...).These colors work as intended on the light theme, but do not adapt when the dashboard switches to the dark theme. On the dark theme's
#1a1a1a/#242424background and surface colors, some Trace text therefore has very low contrast and becomes difficult to read.This PR replaces the affected fixed colors with Vuetify's semantic
--v-theme-on-surfacecolor while preserving the original information hierarchy through opacity.The implementation follows the same theme-aware approach used by the recently merged PR #9643 for similar dark-theme contrast issues.
Modifications / 改动点
Only
dashboard/src/components/shared/TraceDisplayer.vueis modified.The affected colors are mapped to theme-aware semantic colors as follows:
rgba(var(--v-theme-on-surface), 0.88)rgba(var(--v-theme-on-surface), 0.72)rgba(var(--v-theme-on-surface), 0.62)rgba(var(--v-theme-on-surface), 0.08 / 0.12)This keeps the existing primary / content / metadata visual hierarchy rather than making all Trace text use the same foreground intensity.
No additional dark-theme CSS branch or
useTheme()logic is introduced. The component now inherits the active Vuetify theme through semantic CSS variables.Colors unrelated to #9683, such as the Agent status dot and Trace highlight background, are intentionally left unchanged.
Screenshots or Test Results / 运行截图或测试结果
Before
After — Dark Theme
The affected Trace text now follows the dark theme's
--v-theme-on-surfacevalue and remains readable while preserving the visual hierarchy between primary information, normal content, and metadata.After — Light Theme
The same Trace view was also verified under the light theme to ensure that replacing the fixed colors does not cause a visual regression.
End-to-End Verification
The fix was tested against a running AstrBot WebUI using the production dashboard build.
Verified in both light and dark themes:
The effective theme variables were also checked in the browser:
Build and Validation
Validation was performed in the
dashboarddirectory using the pnpm version aligned with the repository CI:Dependency verification completed successfully without modifying the lockfile.
The dashboard production build was then executed with:
The build completed successfully with exit code 0, including:
This confirms that the dashboard passes TypeScript checking and the production Vite build after the change.
A whitespace check was also performed:
Result:
The dependency check and build process did not introduce any unrelated tracked file changes.
Manual regression testing was also completed on the Trace page in both light and dark themes. Text hierarchy, divider visibility, expanded Action / Fields content, and overall readability all matched expectations.
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Adapt TraceDisplayer styling to use Vuetify theme semantic colors for better readability across light and dark dashboard themes.
Bug Fixes:
Enhancements:
Summary by Sourcery
Adapt TraceDisplayer styling to use Vuetify theme semantic colors for consistent readability across light and dark dashboard themes.
Bug Fixes:
Enhancements: