Skip to content

fix(explore): enable free-text entry for temporal D3 format selector in Table chart#41194

Open
yousoph wants to merge 1 commit into
apache:masterfrom
preset-io:fix-temporal-d3-freetext
Open

fix(explore): enable free-text entry for temporal D3 format selector in Table chart#41194
yousoph wants to merge 1 commit into
apache:masterfrom
preset-io:fix-temporal-d3-freetext

Conversation

@yousoph

@yousoph yousoph commented Jun 18, 2026

Copy link
Copy Markdown
Member

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: d3TimeFormat in ColumnConfigControl/constants.tsx was missing allowNewOptions: true. This prop is what enables free-text entry on the Select component from @superset-ui/core/components. The creatable: true already present on d3TimeFormat is passed to a different Select component and has no effect here.

The fix mirrors the existing d3NumberFormat behavior, which already has allowNewOptions: true and correctly accepts free-text format strings.

Changes

  • superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx: add allowNewOptions: true to d3TimeFormat

Before / 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

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>
@bito-code-review

bito-code-review Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #a8bbad

Actionable Suggestions - 0
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx - 1
    • Property order inconsistency in related APIs · Line 65-65
Review Details
  • Files reviewed - 1 · Commit Range: 68e9c45..68e9c45
    • superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added explore Namespace | Anything related to Explore viz:charts:table Related to the Table chart labels Jun 18, 2026
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.32%. Comparing base (c218dc4) to head (68e9c45).

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              
Flag Coverage Δ
javascript 68.48% <ø> (-0.01%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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: true to the d3TimeFormat Select control spec to permit user-entered format strings.

Comment on lines 63 to 66
const d3TimeFormat: ControlFormItemSpec<'Select'> = {
controlType: 'Select',
allowNewOptions: true,
label: t('D3 format'),
@bito-code-review

Copy link
Copy Markdown
Contributor

The suggestion to add unit test coverage for d3TimeFormat.allowNewOptions is appropriate. Since this configuration change enables free-text entry, verifying its state in ColumnConfigConstants.test.tsx ensures the expected behavior is maintained and helps prevent future regressions, consistent with existing tests for d3NumberFormat.

superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx

const d3TimeFormat: ControlFormItemSpec<'Select'> = {
  controlType: 'Select',
+  allowNewOptions: true,
  label: t('D3 format'),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

explore Namespace | Anything related to Explore size/XS viz:charts:table Related to the Table chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants