feat: conditional formatting for pivot tables#9668
Conversation
Add conditional formatting support to pivot tables in both Explore and Canvas dashboards, letting users color cells based on measure value rules.
|
@codex: review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f28923fcf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
did an experience pass and it looks great. Thanks @djbarnwal for tuning this further. |
|
@codex: review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26e52bb8c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| td.cell.has-conditional-format { | ||
| background: var(--cf-bg); | ||
| color: var(--cf-color); |
There was a problem hiding this comment.
Let selection backgrounds override formatted cells
When a formatted cell has a dark heatmap fill and then enters an active/selected row state, this selector still wins over later rules such as .active-cell.cell and .selected-row .cell because td.cell.has-conditional-format has higher specificity. The text reset below then forces text-fg-primary while the dark conditional background remains, making selected or active values hard to read instead of showing the intended light selection background.
Useful? React with 👍 / 👎.
|
@codex: review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26e52bb8c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| specs: PivotConditionalFormatSpec[] | undefined, | ||
| ): Record<string, PivotMeasureFormatting> { | ||
| const measureFormatting: Record<string, PivotMeasureFormatting> = {}; | ||
| for (const spec of specs ?? []) { |
There was a problem hiding this comment.
Guard untyped conditional_format before iterating
When a canvas YAML is hand-edited or loaded with conditional_format set to a non-array value (or with a null entry), this loop throws before rendering because renderer props are untyped and the runtime canvas validators do not validate this new field. That means one malformed formatting block can crash the canvas/inspector instead of being skipped as the comment promises. Please validate the field or guard with Array.isArray and object checks before iterating.
Useful? React with 👍 / 👎.
…erride formatted cells
PivotToolbar/PivotFormattingPicker) and Canvas (inspectorPivotConditionalFormatInput) dashboards.dashboard.proto,fromProto/toProto) and are applied during column definition rendering.pivot-conditional-formatting.spec.ts.Checklist:
Developed in collaboration with Claude Code