Repository navigation
fix: clean up grouped input border rendering - #44690
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughRefined InputGroup error-state and control styling (borders, backgrounds, focus behavior) and adjusted the inline-end addon classes for InputGroupAddon in the DataInputs Input component; no public API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
|
||
| // Error state. | ||
| 'has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40', | ||
| 'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40', |
There was a problem hiding this comment.
🔴 The error-state CSS selectors on InputGroup use Tailwind has-[] (CSS :has()), which only matches descendants, but when FormControl (Radix Slot) wraps InputGroup directly, aria-invalid=true is merged onto the InputGroup <div> itself—not any descendant—so the selectors never fire. The newly added bg-destructive-200 and border-destructive-400 styles from this PR will have no effect for the ~10+ Studio components that use the FormControl → InputGroup → InputGroupInput pattern (IOPSField, ThroughputField, DiskSizeField, AutoScaleFields, SmtpForm, etc.); only the DatabasePasswordInput path (which passes {...props} down through DataInputs/Input) actually works.
Extended reasoning...
The CSS :has() selector vs. self-match problem
CSS :has() only matches if the specified selector matches a descendant of the element, never the element itself. The InputGroup div has both data-slot="input-group" and aria-invalid="true" on itself when FormControl (Radix Slot) wraps it directly, but the selector has-[[data-slot][aria-invalid=true]] applied to that same div looks for a child or descendant matching [data-slot][aria-invalid=true]. Since the element cannot match its own :has() selector, this condition never evaluates to true.
How Radix Slot propagates aria-invalid
FormControl in form.tsx (lines 121–128) renders <Slot aria-invalid={\!\!error}>. Radix Slot merges all props—including aria-invalid—directly onto the single child element it receives. When the usage is FormControl > InputGroup, the Slot merges aria-invalid=true onto InputGroup's root <div data-slot="input-group">. Neither InputGroupAddon (data-slot="input-group-addon") nor InputGroupInput's inner <input data-slot="input-group-control"> ever receive aria-invalid in this pattern.
Why the PR's fix doesn't work for this pattern
The PR adds bg-destructive-200 and changes border-destructive to border-destructive-400 inside the same has-[[data-slot][aria-invalid=true]] selectors. Since those selectors could never fire for the direct FormControl → InputGroup pattern (for the self-match reason above), the new styling is also permanently suppressed. The ring and border selectors pre-existed with the same broken logic; the PR extends them without addressing the root cause.
Concrete proof
- IOPSField (and ~10 similar components):
<FormControl><InputGroup><InputGroupAddon>…</InputGroupAddon><InputGroupInput {...field} /></InputGroup></FormControl> - RHF's
fieldobject does not includearia-invalid;InputGroupInputpasses{...props}to<Input>, which passes to the<input>element—none of these receivearia-invalid. - Slot merges
aria-invalid=trueontoInputGroup's<div data-slot="input-group">. - CSS evaluates: does
div[data-slot="input-group"][aria-invalid="true"]have a descendant matching[data-slot][aria-invalid="true"]? Answer: No — the only matching element is the div itself, and:has()doesn't match self. - Result: none of the error-state classes (
bg-destructive-200,ring-destructive/20,border-destructive-400) are applied, regardless of validation state.
The path that does work
DatabasePasswordInput → DataInputs/Input → InputGroup. The DataInputs/Input component spreads {...props} (including aria-invalid merged by Slot) down to InputGroupInput, which forwards it to the <input data-slot="input-group-control">. Now a descendant has both data-slot and aria-invalid=true, so :has() fires correctly. This is the only pattern the fix actually works for.
How to fix
To support both patterns, add a parallel selector that matches when aria-invalid lands on the InputGroup's root element itself (i.e., [aria-invalid=true] as a direct attribute selector alongside the existing :has() variant), or propagate aria-invalid down to the inner <input> within InputGroupInput when rendering inside a FormControl context.
|
|
||
| // Error state. | ||
| 'has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40', | ||
| 'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40', |
There was a problem hiding this comment.
🔴 The PR replaces border-destructive (53.9% lightness in all themes) with border-destructive-400, which maps to only 20.6% lightness in dark mode—nearly invisible against dark backgrounds (~9–12% lightness). A dark: override for the border color is missing; the only dark-mode addition (dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40) only sets the ring color variable but the ring-width is only applied on focus-visible, so in the unfocused invalid state the near-invisible border is the sole error indicator. Add dark:has-[[data-slot][aria-invalid=true]]:border-destructive to restore the high-contrast 53.9% lightness border in dark mode.
Extended reasoning...
What the bug is and how it manifests
The PR changes the invalid-state border class from border-destructive to border-destructive-400 in input-group.tsx. In light mode this is appropriate—--destructive-400 has 91% lightness (light pink), matching other form fields. But in dark mode, --destructive-400 resolves to 6.7deg 60% 20.6% (a very dark brownish-red), while dark-mode panel/page backgrounds sit at approximately 8–12% lightness. The resulting contrast ratio (~1.2–1.5:1) is well below the WCAG 3:1 threshold for non-text UI elements, making the error border practically invisible.
The specific code path that triggers it
The changed line is in the error-state class string of InputGroup (line 30):
'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40'
The only dark-mode override added is dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40. This sets --tw-ring-color but does not apply a ring width—ring-2 is only present in the focus-visible rule. Consequently, in the unfocused invalid state the ring renders with zero width (no box-shadow), and the only visual indicator is the border at 20.6% lightness plus bg-destructive-200 at 9.2% lightness—both near-invisible.
Why existing code doesn't prevent it
input.tsx follows the same border-destructive-400 pattern but compensates with explicit focus overrides:
aria-[invalid=true]:focus:border-destructive aria-[invalid=true]:focus-visible:border-destructive
These restore the full-contrast 53.9% lightness border when the input is focused. input-group.tsx has no equivalent—its focus state adds a ring-background-control ring (not a destructive-colored border), so the error border stays at 20.6% in both focused and unfocused states in dark mode.
Impact
Any dark-mode user interacting with an invalid grouped input (e.g., the project-creation database password field) will see little to no red border error indication. This is a direct regression: before the PR, the border-destructive token provided 53.9% lightness in all themes.
Step-by-step proof
- Switch to dark mode (background lightness ~10%).
- Render an
InputGroupcontaining anInputGroupInputwitharia-invalid="true". - The wrapper div receives Tailwind class
border-destructive-400, which resolves via--destructive-400: 6.7deg 60% 20.6%(fromdark.css) to a very dark brownish-red border. - Background is ~10% lightness; border is 20.6% lightness → contrast ratio ≈ 1.3:1.
- The ring override only sets
--tw-ring-color; without aring-2on the invalid (non-focused) state, no box-shadow renders. - Result: no visible ring, near-invisible border—error state is undetectable.
How to fix
Add a dark-mode border override alongside the existing ring override:
- 'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40'
+ 'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40'border-destructive maps to --destructive-default: 10.2deg 77.9% 53.9% in all themes, providing a clearly visible red border in dark mode.
There was a problem hiding this comment.
The attempted fix adds has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]:focus-visible]:border-destructive, which restores the high-contrast border-destructive token when the input is focused and invalid (in both light and dark mode). However, the original concern was specifically the unfocused invalid state in dark mode: border-destructive-400 at 20.6% lightness remains the sole border indicator there, and the requested dark:has-[[data-slot][aria-invalid=true]]:border-destructive override is still absent.
The current error-state line is:
'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40',
'has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]:focus-visible]:border-destructive',
In dark mode without focus:
border-destructive-400→ 20.6% lightness (dark brownish-red, ~1.3:1 contrast against dark backgrounds)- The
ring-destructive/40override only sets--tw-ring-color; withoutring-2on the unfocused invalid state, no ring renders - Result: error border is still nearly invisible
To fix the unfocused dark-mode case, add dark:has-[[data-slot][aria-invalid=true]]:border-destructive alongside the existing ring override:
- 'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40',
+ 'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40',border-destructive maps to --destructive-default: 10.2deg 77.9% 53.9% in all themes, providing a clearly visible red border in the unfocused invalid state in dark mode.
🎭 Playwright Test ResultsDetails
Flaky testsFeatures › database-webhooks.spec.ts › Database Webhooks › preserves webhook URL path and custom headers after editing Skipped testsFeatures › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected |
| <InputGroupAddon | ||
| align="inline-end" | ||
| // Override defaults | ||
| className="pr-1 has-[>button]:mr-0 has-[>kbd]:mr-0" |
There was a problem hiding this comment.
Do we really need the has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem] on the underlying component? I don’t think it’s realistic that consumers will remember to pass these overrides each time. Maybe there’s a better way?
There was a problem hiding this comment.
Might be okay if people are just importing this ui-patterns version.
|
|
||
| // Error state. | ||
| 'has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40', | ||
| 'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40', |
There was a problem hiding this comment.
🔴 The PR adds has-[[data-slot][aria-invalid=true]]:bg-destructive-200 to the error state, but --destructive-200 resolves to only 9.2% lightness in dark mode — at or below dark backgrounds (~10–12% lightness) — making the background completely invisible (contrast ≈ 1:1). Combined with the already near-invisible border-destructive-400 at 20.6% lightness (~1.3:1 contrast) and a ring override that sets color without width (no box-shadow renders in unfocused state), the unfocused error state in dark mode has zero visually distinguishable indicators. Fix by adding dark:has-[[data-slot][aria-invalid=true]]:bg-transparent alongside the existing dark ring override so the error background reverts to transparent in dark mode.
Extended reasoning...
Bug: bg-destructive-200 is near-invisible in dark mode
What the bug is and how it manifests
The PR introduces has-[[data-slot][aria-invalid=true]]:bg-destructive-200 as part of the new error-state styling for InputGroup. In light mode, --destructive-200 resolves to 0deg 100% 99.4% (near-white light pink) — clearly visible against standard backgrounds. In dark mode, however, --destructive-200 resolves to 10.9deg 23.4% 9.2% lightness (confirmed from dark.css). Dark mode backgrounds sit at approximately 9–12% lightness (--background-200: 9%, --background-surface-75: 9%, --background-surface-100: 12.2%). The bg-destructive-200 at 9.2% lightness is at or below the page background lightness, making it completely invisible or even producing negative contrast.
The specific code path that triggers it
Line 30 of input-group.tsx (the changed line):
'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40'
The only dark-mode override added is dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40, which sets --tw-ring-color but does not apply a ring width — ring-2 is only present in the focus-visible rule. In the unfocused invalid state, no box-shadow renders, leaving only the border and background as visual indicators.
Why existing code doesn't prevent it
No dark: override was added for the background. The bg-destructive-200 class applies in all color modes, and the dark-mode CSS variable value for --destructive-200 happens to be darker than or equal to the page background. Light mode (99.4%) and dark mode (9.2%) values are polar opposites, yet the same Tailwind class is applied unconditionally.
What the impact would be
When combined with the separately noted near-invisible border-destructive-400 at 20.6% lightness (~1.3:1 contrast ratio against ~10% background), the unfocused error state in dark mode has NO visually distinguishable indicators whatsoever: neither the border nor the background meets any accessibility threshold. A dark-mode user who submits an invalid password and moves focus away from the field will see absolutely no error indication despite the field being marked aria-invalid=true.
Step-by-step proof
- Switch browser/OS to dark mode.
- Navigate to the project creation form.
- Fill in the database password field with an invalid value (or leave it blank) and submit.
- Move focus away from the field so the unfocused invalid state is active.
- The
InputGroupwrapper receivesbg-destructive-200→ resolves tohsl(10.9deg 23.4% 9.2%)— essentially identical to or darker than the dark-mode background (~10% lightness). border-destructive-400→ resolves tohsl(6.7deg 60% 20.6%)— contrast ratio ~1.3:1 against the background.- The ring override sets color only, no ring-width → zero box-shadow.
- Result: the field looks identical to a valid field in dark mode; no error state is communicated visually.
How to fix
Add dark:has-[[data-slot][aria-invalid=true]]:bg-transparent alongside the existing dark ring override:
-'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40',
+'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:bg-transparent dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40',This reverts the background to transparent in dark mode while keeping the light-pink tint in light mode.
🔬 also observed by verify-runtime
| className={cn( | ||
| 'flex-1 resize-none rounded-none border-0 bg-transparent py-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent', | ||
| 'flex-1 resize-none rounded-none border border-transparent bg-transparent py-0 shadow-none', |
There was a problem hiding this comment.
🟡 The PR changes both InputGroupInput and InputGroupTextarea from border-0 to border border-transparent, but only InputGroupInput received the compensating -m-px class. Without -m-px, the transparent 1px border on InputGroupTextarea takes layout space (box-sizing: border-box), sitting 1px inside the outer InputGroup border and creating a visible 1px gap filled by the group's background color (including bg-destructive-200 in error state). Add -m-px to InputGroupTextarea's class list to match InputGroupInput.
Extended reasoning...
What the bug is and how it manifests
The PR updates both inner grouped controls from border-0 to border border-transparent to give them stable border metrics. For InputGroupInput this is correct: the pre-existing -m-px (margin: -1px) extends the element 1px outward so its border overlaps and aligns with the outer InputGroup border. InputGroupTextarea receives the same border border-transparent change but does not receive -m-px, so it has no compensation for the space consumed by the new 1px transparent border.
The specific code path that triggers it
InputGroupInput (line ~134): 'flex-1 rounded-none border border-transparent -m-px bg-transparent shadow-none' — has -m-px.
InputGroupTextarea (line ~148): 'flex-1 resize-none rounded-none border border-transparent bg-transparent py-0 shadow-none' — missing -m-px.
Why existing code doesn't prevent it
In the old code, both components had border-0 (zero border-width), so -m-px was irrelevant for the textarea (no border space to compensate). InputGroupInput already had -m-px for other reasons and it was simply preserved when the PR updated the border. The PR author updated both to border border-transparent but only updated InputGroupInput's -m-px to be meaningful — the textarea's omission appears to be an oversight.
What the impact is
With box-sizing: border-box (Tailwind default), InputGroupTextarea sits 1px inside the outer InputGroup border on each side. This creates a 1px gap filled by the InputGroup's background (bg-foreground/[.026] normally, bg-destructive-200 in error state). In error state, this renders as a faint visible 'inner border' effect on the textarea that does not appear for InputGroupInput. The textarea content area is also 2px narrower and 2px shorter than an equivalent InputGroupInput.
Step-by-step proof
- Render an
InputGroupcontaining anInputGroupTextareawith anInputGroupAddon(as in the design-system form-patterns example). - Inspect the textarea element: it has
border border-transparentbut no-m-px. - With
box-sizing: border-box, the 1px border on each side shrinks the outer edge of the element 1px inward from theInputGroupcontainer's inner edge. - A 1px strip of the
InputGroup's background is now visible between theInputGroupborder and the textarea edge. - Trigger an error state (
aria-invalid=trueon a descendant): theInputGroupgetsbg-destructive-200, making the 1px gap distinctly visible as a faint red inner border ring on the textarea — absent onInputGroupInput. - Fix: add
-m-pxtoInputGroupTextarea's class list to matchInputGroupInput.
| // Error state. | ||
| 'has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40', | ||
| 'has-[[data-slot][aria-invalid=true]]:bg-destructive-200 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive-400 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40', | ||
| 'has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]:focus-visible]:border-destructive', |
There was a problem hiding this comment.
🟡 The focused+invalid border upgrade on line 31 uses only :focus-visible, so mouse-clicking into an invalid grouped input keeps the border at border-destructive-400 instead of upgrading to border-destructive. By contrast, input.tsx applies the upgrade on both :focus and :focus-visible; the PR description says 'focused error border uses destructive' without qualifying keyboard-only, suggesting this is unintentional.
Extended reasoning...
What the bug is and how it manifests
The PR adds has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]:focus-visible]:border-destructive (line 31) to upgrade the error border from border-destructive-400 to border-destructive when an invalid grouped input is focused. This selector only fires on :focus-visible (keyboard/tab navigation). Mouse-clicking into the field does not trigger :focus-visible, so the border stays at the lighter border-destructive-400 value. Keyboard users who tab into the field see the full-strength border-destructive upgrade; mouse users do not.
The specific code path that triggers it
input-group.tsx:31 — the error+focused selector is has-[[data-slot=input-group-control]:focus-visible], not has-[[data-slot=input-group-control]:focus]. Compare with input.tsx:16 which uses both aria-[invalid=true]:focus:border-destructive and aria-[invalid=true]:focus-visible:border-destructive to cover both interaction modes.
Why existing code does not prevent it
The refutation correctly notes that InputGroup's entire focus-state mechanism (line 27's ring styles) also uses :focus-visible only, so there is internal consistency within InputGroup. However, this internal consistency is in tension with input.tsx, which deliberately handles both :focus and :focus-visible for the same semantic state (invalid+focused border upgrade). The PR description states 'focused error border uses destructive' without qualifying keyboard-only, indicating the intent was broader coverage.
What the impact would be
A user who mouse-clicks into an invalid grouped input (e.g., the database password field after a validation error) sees the lighter border-destructive-400 border instead of the stronger border-destructive signal. The error state remains visible via the background and base border, so this is minor rather than a complete loss of feedback — hence nit severity.
Step-by-step proof
- Render a grouped input with aria-invalid=true (e.g., the database password field after form submission).
- The outer InputGroup div gets class border-destructive-400 from has-[[data-slot][aria-invalid=true]]:border-destructive-400.
- Mouse-click into the input. The inner input element receives CSS :focus but NOT :focus-visible (Chrome omits focus-visible for pointer interactions by default).
- The selector has-[[data-slot=input-group-control]:focus-visible]:border-destructive does not match — border stays at border-destructive-400.
- Tab into the same input instead. Now :focus-visible fires, the selector matches, and the border upgrades to border-destructive.
- Fix: add a parallel :focus variant — has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]:focus]:border-destructive — matching the dual approach in input.tsx.
Braintrust eval report
|
## What kind of change does this PR introduce? Bug fix. Resolves FE-2959. ## What is the current behaviour? Grouped inputs strip the inner control border with `border-0`, while the outer `InputGroup` is responsible for the visible outline. After #44703, grouped form inputs now receive the correct validation attributes, but the primitive still removes the inner border dimensions entirely. That keeps the visual layer brittle and can lead to inconsistent error rendering, especially in light mode where the grouped password field does not match the Project name input. The shared `ui-patterns` input wrapper also inherits the generic `inline-end` button spacing from `InputGroupAddon`, which pushes the password copy button slightly too far to the right. ## What is the new behaviour? The shared grouped-input primitive now keeps a transparent inner border instead of removing border widths entirely. The outer `InputGroup` continues to own the visible border, focus ring and error treatment, but the inner control now has stable border metrics and no redundant dark-mode background override. The grouped invalid state now also matches the plain input treatment more closely: - unfocused error border uses `destructive-400` - focused error border uses `destructive` - error background uses `destructive-200` The `ui-patterns` input wrapper now overrides the inherited `inline-end` negative margin for its own copy/reveal button addon, so the password copy button sits in the right place without changing spacing for other direct `InputGroup` consumers. | Before | After | | --- | --- | | <img width="1338" height="284" alt="CleanShot 2026-04-09 at 13 43 50@2x-91489355-5EEA-4884-BAA2-B93B28F1D7CB" src="https://github.com/user-attachments/assets/ed40683b-8a87-4deb-8a0f-f892d00894f0" />| <img width="1334" height="278" alt="CleanShot 2026-04-09 at 13 41 36@2x-5D7E930B-EDB2-4002-9367-34ACE2DF4DB4" src="https://github.com/user-attachments/assets/7d9594a4-9988-480e-a809-9f5ed29e8e24" /> | | <img width="1336" height="210" alt="CleanShot 2026-04-09 at 14 06 15@2x-05379F74-4CA5-4E6E-9250-CBA2764C1318" src="https://github.com/user-attachments/assets/25e48cd4-de0a-47f3-9022-d7a3829a0626" /> | <img width="1334" height="210" alt="CleanShot 2026-04-09 at 14 12 11@2x-11FBC519-D398-4A59-971A-97FBFEF610DE" src="https://github.com/user-attachments/assets/91c3710c-7773-4286-854d-7b7144db85ab" /> | An easy place to test this is the Database password field in the New Project creation flow. See also the Minimum password length field in Email (Sign In / Providers). ## Summary - update `packages/ui/src/components/shadcn/ui/input-group.tsx` - replace `border-0` on grouped inputs/textareas with transparent borders - remove the redundant `dark:bg-transparent` - keep the inner grouped controls visually neutral so the outer group owns the rendered border state - align grouped invalid border and background styling with the plain input treatment - update `packages/ui-patterns/src/DataInputs/Input.tsx` so copy/reveal buttons do not inherit the extra right pull intended for other `inline-end` addons
## Problem - Grouped textareas render text too close to the top border. The standalone `Textarea` retains its normal top padding. - `InputGroupTextarea` has overridden the inner textarea with `py-0` since #44282 on 31 March 2026. The group initially supplied `py-2`; #44387 removed that outer padding later the same day, leaving no top spacing. The override was retained during the border and surface updates in #44690 and #48887. - The textarea component page had no grouped textarea example, so this difference was easy to miss. ## Solution - Give the grouped textarea `pt-2` while retaining `pb-0` for block-end addons. The outer group continues to own its border and focus styles. - Add a “With addon” example to the textarea component page to keep this composition visible. ## Review instructions - Open `/design-system/docs/components/textarea` and find “With addon”. Confirm its text has the same top inset as the default textarea and the block-end addon remains below the input. - Open `/design-system/docs/ui-patterns/forms` and find “Textarea Multi-line text input for longer content with addon”. Confirm the text has the same top inset as the standalone textarea example immediately above it. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a textarea example with a supporting addon below the text field, showing a 120-character limit. * **Bug Fixes** * Clicking a block-end addon now focuses its textarea as well as an input. * **Documentation** * Added the textarea-with-addon example to the textarea component documentation. * **Style** * Added top padding to textareas within input groups while keeping bottom padding unchanged, adjusting spacing above entered text. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Problem - Grouped textareas render text too close to the top border. The standalone `Textarea` retains its normal top padding. - `InputGroupTextarea` has overridden the inner textarea with `py-0` since #44282 on 31 March 2026. The group initially supplied `py-2`; #44387 removed that outer padding later the same day, leaving no top spacing. The override was retained during the border and surface updates in #44690 and #48887. - The textarea component page had no grouped textarea example, so this difference was easy to miss. ## Solution - Give the grouped textarea `pt-2` while retaining `pb-0` for block-end addons. The outer group continues to own its border and focus styles. - Add a “With addon” example to the textarea component page to keep this composition visible. ## Review instructions - Open `/design-system/docs/components/textarea` and find “With addon”. Confirm its text has the same top inset as the default textarea and the block-end addon remains below the input. - Open `/design-system/docs/ui-patterns/forms` and find “Textarea Multi-line text input for longer content with addon”. Confirm the text has the same top inset as the standalone textarea example immediately above it. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a textarea example with a supporting addon below the text field, showing a 120-character limit. * **Bug Fixes** * Clicking a block-end addon now focuses its textarea as well as an input. * **Documentation** * Added the textarea-with-addon example to the textarea component documentation. * **Style** * Added top padding to textareas within input groups while keeping bottom padding unchanged, adjusting spacing above entered text. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
What kind of change does this PR introduce?
Bug fix. Resolves FE-2959.
What is the current behaviour?
Grouped inputs strip the inner control border with
border-0, while the outerInputGroupis responsible for the visible outline. After #44703, grouped form inputs now receive the correct validation attributes, but the primitive still removes the inner border dimensions entirely. That keeps the visual layer brittle and can lead to inconsistent error rendering, especially in light mode where the grouped password field does not match the Project name input.The shared
ui-patternsinput wrapper also inherits the genericinline-endbutton spacing fromInputGroupAddon, which pushes the password copy button slightly too far to the right.What is the new behaviour?
The shared grouped-input primitive now keeps a transparent inner border instead of removing border widths entirely. The outer
InputGroupcontinues to own the visible border, focus ring and error treatment, but the inner control now has stable border metrics and no redundant dark-mode background override.The grouped invalid state now also matches the plain input treatment more closely:
destructive-400destructivedestructive-200The
ui-patternsinput wrapper now overrides the inheritedinline-endnegative margin for its own copy/reveal button addon, so the password copy button sits in the right place without changing spacing for other directInputGroupconsumers.An easy place to test this is the Database password field in the New Project creation flow. See also the Minimum password length field in Email (Sign In / Providers).
Summary
packages/ui/src/components/shadcn/ui/input-group.tsxborder-0on grouped inputs/textareas with transparent bordersdark:bg-transparentpackages/ui-patterns/src/DataInputs/Input.tsxso copy/reveal buttons do not inherit the extra right pull intended for otherinline-endaddons