fix(studio): mouse wheel scroll in column type selector#42126
fix(studio): mouse wheel scroll in column type selector#421267ttp wants to merge 1 commit intosupabase:masterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@7ttp is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
WalkthroughReworks the column type Popover by removing the outer ScrollArea, adding conditional ScrollAreas for primary options and enumTypes, relocating the "type not found" message, updating option rendering and selection indicators, and normalizing enum selection values for camelCase public schema. Changes
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a3a5688 to
23dfa93
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In
`@apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx`:
- Around line 189-274: The file ColumnType.tsx is failing Prettier; run Prettier
(or your editor's format command) on this file to correct JSX/JS formatting
around the Command_Shadcn_, CommandList_Shadcn_, CommandItem_Shadcn_, ScrollArea
and the enumTypes/POSTGRES_DATA_TYPE_OPTIONS mapping blocks; ensure consistent
indentation, trailing commas, and wrapped JSX props so the map callbacks and
onSelect handlers (referenced in CommandItem_Shadcn_ and the enumTypes map) are
formatted correctly and the file passes CI.
- Around line 228-265: The selection highlight/checkmark is out-of-sync because
onSelect strips quotes but the comparisons use the original option.format; fix
by normalizing option.format once (e.g., const normalized = option.schema ===
'public' ? option.format.replaceAll('"','') : option.format) inside the
enumTypes.map callback and then use that normalized value for
CommandItem_Shadcn_ value prop, the onSelect/onOptionSelect call, the displayed
text, and the equality check against value; update references to option.format
in this block (display, comparison, and value) to use the normalized variable
and keep setOpen behavior the same.
- Around line 223-227: The "Other types" label is currently rendered as a
selectable/focusable item via CommandItem_Shadcn_, causing
accessibility/keyboard confusion; replace that header by passing the string
"Other types" to the heading prop of CommandGroup_Shadcn_ and remove the
CommandItem_Shadcn_ wrapper so the group header is non-selectable (preserve the
existing ScrollArea and conditional enumTypes.length check around the group).
apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx
Show resolved
Hide resolved
apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx
Show resolved
Hide resolved
apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx
Outdated
Show resolved
Hide resolved
|
@ivasilov @joshenlim (sorry for the ping!) |
|
hey there @7ttp! thanks so much for this - i'm just checking the preview but i don't think the fix you've done addresses the issue, am still not able to scroll via mouse wheel in the column type selector |
## Context Was informed of this UI bug through this PR [here](#42126) - apart from shifting the ScrollArea component, there's also known issue with ScrollArea and Popover which we need to set `modal` to `true` for the `Popover` ## To test - [ ] Verify that you can scroll via mouse wheel on the ColumnType component (Table Editor -> new table -> column type) <img width="698" height="471" alt="image" src="https://github.com/user-attachments/assets/b24af3f9-80f6-4dfc-9fa2-1492fe597598" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Popover in column editor now supports modal rendering mode with enhanced scrolling behavior. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
We've got a fix through here! 🙏 Closing this PR in favor of that but thank you so much nonetheless for informing us about this issue! We really appreciate it! 🙇 |
Problem
Mouse wheel scrolling does not work in the column type selector dropdown when creating or editing table columns.
Solution
Restructured the scroll container hierarchy to match the pattern used in other similar components (SchemaComboBox, DatabaseSelector, FunctionSelector):
ScrollAreainsideCommandGroupinstead of wrapping the entireCommandcomponenth-[250px](smaller than CommandList's defaultmax-h-[300px])Related
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.