Skip to content

fix: DH-21616: Databar overrides text color when using format prop#2640

Merged
mofojed merged 9 commits intodeephaven:mainfrom
gzh2003:DH-21616-databar-overrides-text-color-when-using-format-prop
Mar 31, 2026
Merged

fix: DH-21616: Databar overrides text color when using format prop#2640
mofojed merged 9 commits intodeephaven:mainfrom
gzh2003:DH-21616-databar-overrides-text-color-when-using-format-prop

Conversation

@gzh2003
Copy link
Copy Markdown
Contributor

@gzh2003 gzh2003 commented Mar 23, 2026

For DH-21616. Databar cells were using the databar bar color for both the bar and the text, ignoring any explicit text color set via formatting.

Companion PR: deephaven/deephaven-plugins#1323

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.55%. Comparing base (0cab21d) to head (e039cef).
⚠️ Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
packages/grid/src/DataBarCellRenderer.ts 0.00% 5 Missing ⚠️
packages/grid/src/MockDataBarGridModel.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2640      +/-   ##
==========================================
+ Coverage   49.48%   49.55%   +0.07%     
==========================================
  Files         772      774       +2     
  Lines       43738    43871     +133     
  Branches    11066    11295     +229     
==========================================
+ Hits        21643    21740      +97     
- Misses      22077    22085       +8     
- Partials       18       46      +28     
Flag Coverage Δ
unit 49.55% <0.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

The Grid component by design is generally dumb/explicit about what it's rendering; the GridModel is basically explicitly what it's going to render (colorForCell, textForCell, etc). The brains/logic are designed to be in the specific implementations of the GridModel (e.g. IrisGridModel, or UITableModel).
By putting the textColor explicitly in the DataBarOptions, we're keeping that logic of "user explicitly set a format value" in the UITableModel.

@gzh2003 gzh2003 requested a review from mofojed March 25, 2026 20:14
@gzh2003 gzh2003 requested a review from mofojed March 26, 2026 14:07
Comment on lines +38 to +42
/**
* The text color for the cell, resolved from format rules/bar color.
* If the user has explicitly set a text color via formatting, that color is used.
* Otherwise it defaults to the databar's bar color.
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should just be "the text color for the cell". How it is derived is not determined from within this context.
If we took an optional textColor here and fell back to the color, we could say that. But this behaviour documented here is not accurate from this context.
And then the color attribute should have a doc string for "Color of the databar", maybe explain how you can pass a gradient.

@gzh2003 gzh2003 requested a review from mofojed March 30, 2026 13:41
@mofojed mofojed merged commit f5425e9 into deephaven:main Mar 31, 2026
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants