fix(dataset-editor): fix SQL expression editor extra spaces and height expansion#39248
Conversation
|
Yes, the suggestion is valid — the current diff uses |
60eb309 to
8299462
Compare
There was a problem hiding this comment.
Code Review Agent Run #1d55ee
Actionable Suggestions - 1
-
superset-frontend/src/explore/components/controls/TextAreaControl.tsx - 1
- Incorrect controlled component handling · Line 211-211
Additional Suggestions - 1
-
superset-frontend/src/explore/components/controls/TextAreaControl.tsx - 1
-
Redundant CSS property · Line 180-180Textarea elements have 'overflow: auto' by default, so explicitly setting it when resize is enabled is unnecessary.
-
Review Details
-
Files reviewed - 2 · Commit Range:
60eb309..60eb309- superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx
- superset-frontend/src/explore/components/controls/TextAreaControl.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
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #39248 +/- ##
=======================================
Coverage 64.37% 64.38%
=======================================
Files 2550 2550
Lines 132180 132183 +3
Branches 30661 30660 -1
=======================================
+ Hits 85096 85104 +8
+ Misses 45599 45594 -5
Partials 1485 1485
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8299462 to
2d789d1
Compare
…t expansion Prevent the `value` prop from leaking through to ReactAce via rest spread, which caused the editor to operate in controlled mode and produce extra spaces on input. Also increase maxLines from 10 to 25 for both computed column and metric expression editors so the editor auto-expands with content, and add overflow:auto when resize is enabled so the CSS resize handle works properly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2d789d1 to
099fa5f
Compare
There was a problem hiding this comment.
Code Review Agent Run #b11494
Actionable Suggestions - 1
-
superset-frontend/src/explore/components/controls/TextAreaControl.tsx - 1
- Inconsistent prop handling between textarea implementations · Line 159-165
Review Details
-
Files reviewed - 3 · Commit Range:
099fa5f..099fa5f- superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx
- superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx
- superset-frontend/src/explore/components/controls/TextAreaControl.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
|
Acknowledged — this is an intentional design choice. See replies on the inline review comments for the full rationale. In short: controlled mode (passing |
aminghadersohi
left a comment
There was a problem hiding this comment.
LGTM — a couple of notes for awareness:
-
showLoadingForImportdefault change (false→trueinAsyncEsmComponent) — this is a global behavioral change affecting all async-loaded components, not just the SQL expression editor. Worth keeping an eye on whether unexpected spinners pop up elsewhere. If they do, might be better to pass the prop explicitly where needed instead of changing the default. -
cancel()→flush()on unmount — makes sense here to persist pending debounced edits when collapsing a row, but note this changes behavior for allTextAreaControlunmount paths. -
Metrics expression move to expand form,
maxLinesbump, debounce, and thevaluedestructuring fix all look good.
…t expansion (apache#39248) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
SUMMARY
Fixes multiple UX issues with the SQL expression editor in the dataset editor:
Extra spaces on input: The
valueprop from theField/Fieldsetcomponent chain was leaking through...editorPropsspread into ReactAce, causing it to operate in controlled mode. This produced extra spaces, cursor jumping, and sluggish input. Fixed by destructuringvalueout of the rest props and using it only as a fallback fordefaultValue.Height expansion:
maxLinesdefaulted to 10 for both computed column and metric expression editors, severely limiting the editor height. Increased to 25 so the editor auto-expands with content.Sluggish input: Added
debounceDelay={300}to both expression editors to prevent full component tree re-renders on every keystroke.Metrics expression moved to expand form: The inline expression editor in the metrics table was cramped (240px wide). Replaced it with a read-only
Typography.Text code ellipsispreview in the table cell, and added a full-width editable expression editor to the expanded form. Hovering the preview shows an "Expand row to edit" tooltip.Lock icon spacing: Added vertical padding to the
EditLockContainerso the lock icon/text has proper spacing from the tab bar divider.Debounce flush on unmount: Changed
componentWillUnmountfromcancel()toflush()so pending debounced edits are persisted when the editor unmounts (e.g., collapsing an expanded row).AsyncEsmComponent loading spinner: Decoupled the loading spinner from requiring a
heightprop. TheshowLoadingForImportplaceholder prop now defaults totrueand uses a small spinner size, so async-loaded editors (like SQL expression) show a loading indicator while importing.initialValue default fix: Removed
initialValue: ''fromTextAreaControl.defaultPropsso theinitialValue ?? valuefallback correctly usesvaluefrom the Field/Fieldset chain when no explicitinitialValueis passed.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - UI changes are self-evident when testing
TESTING INSTRUCTIONS
codestyleADDITIONAL INFORMATION
🤖 Generated with Claude Code