fix(explore): enable free-text entry for temporal D3 format selector in Table chart#41194
fix(explore): enable free-text entry for temporal D3 format selector in Table chart#41194yousoph wants to merge 1 commit into
Conversation
Add allowNewOptions: true to d3TimeFormat so users can type custom D3 format strings in the Table chart's Customized columns panel, matching the existing behavior of d3NumberFormat. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code Review Agent Run #a8bbadActionable Suggestions - 0Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41194 +/- ##
==========================================
- Coverage 64.33% 64.32% -0.01%
==========================================
Files 2651 2651
Lines 144766 144766
Branches 33401 33401
==========================================
- Hits 93131 93125 -6
- Misses 49965 49971 +6
Partials 1670 1670
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Enables free-text/custom D3 time format strings in the Table chart “Customized columns” panel by aligning the temporal format selector behavior with the numeric format selector.
Changes:
- Add
allowNewOptions: trueto thed3TimeFormatSelectcontrol spec to permit user-entered format strings.
| const d3TimeFormat: ControlFormItemSpec<'Select'> = { | ||
| controlType: 'Select', | ||
| allowNewOptions: true, | ||
| label: t('D3 format'), |
|
The suggestion to add unit test coverage for superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx |
Summary
In the Table chart's Customized columns panel, the D3 format selector for temporal columns did not allow users to type a custom format string — they were restricted to the predefined dropdown options only.
The root cause:
d3TimeFormatinColumnConfigControl/constants.tsxwas missingallowNewOptions: true. This prop is what enables free-text entry on theSelectcomponent from@superset-ui/core/components. Thecreatable: truealready present ond3TimeFormatis passed to a different Select component and has no effect here.The fix mirrors the existing
d3NumberFormatbehavior, which already hasallowNewOptions: trueand correctly accepts free-text format strings.Changes
superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx: addallowNewOptions: truetod3TimeFormatBefore / After
Before: Typing a custom D3 time format string (e.g.
%Y/%m/%d) in the temporal column format field does nothing — only predefined options are selectable.After: Users can type any valid D3 time format string and it will be applied to the column.
🤖 Generated with Claude Code