Skip to content

Comments

Fixed textarea width regression in spam filters settings#26532

Merged
minimaluminium merged 2 commits intomainfrom
claude/slack-review-label-edit-logic-H21ko
Feb 24, 2026
Merged

Fixed textarea width regression in spam filters settings#26532
minimaluminium merged 2 commits intomainfrom
claude/slack-review-label-edit-logic-H21ko

Conversation

@minimaluminium
Copy link
Member

@minimaluminium minimaluminium commented Feb 23, 2026

ref https://linear.app/ghost/issue/DES-1298

The global textarea rule in ghost.css sets max-width: 500px, which prevented the TextArea component from stretching to full width. Added max-w-none to override this constraint.

fixes https://linear.app/ghost/issue/DES-1298
The TextArea component was missing w-full classes on both the wrapper div
and the textarea element itself, causing it not to stretch to full width
in flex containers. This is now consistent with the TextField component.

Slack thread: https://ghost.slack.com/archives/C019B1K4FAM/p1771816644361159?thread_ts=1771688471.127429&cid=C019B1K4FAM

https://claude.ai/code/session_01ByHJQL76bLHXq8mY3VHK46
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

The textarea component's class string was updated to include w-full max-w-none, causing the textarea to expand to the full available width. The change is strictly a styling/class adjustment and does not modify event handling or functional behavior.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing a textarea width issue in spam filters settings.
Description check ✅ Passed The description is directly related to the changeset, explaining the textarea width constraint issue and the fix applied.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/slack-review-label-edit-logic-H21ko

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/admin-x-design-system/src/global/form/text-area.tsx (1)

57-63: Use tailwind-merge to prevent silent Tailwind class conflicts when custom widths or other utilities are passed via className.

className (line 62) is passed directly to clsx after w-full. Since clsx performs no deduplication of conflicting Tailwind utilities, a caller passing e.g. className="w-1/2" produces both w-full w-1/2 in the DOM — which one wins is determined by stylesheet order, not the class attribute, causing unpredictable results.

♻️ Replace `clsx` with `tailwind-merge` to resolve Tailwind class conflicts
-import clsx from 'clsx';
+import {twMerge} from 'tailwind-merge';
+import clsx from 'clsx';
+
+// or, if the project establishes a `cn` helper:
+// import cn from '../../utils/cn';

Then replace:

-    let styles = clsx(
+    let styles = twMerge(clsx(
         'order-2 w-full rounded-lg border bg-grey-150 px-3 py-2 transition-all dark:bg-grey-900 dark:text-white',
         error ? 'border-red bg-white' : 'border-transparent ...',
         title && 'mt-1.5',
         fontStyle === 'mono' && 'font-mono text-sm',
         className
-    );
+    ));

This ensures consumer-provided widths (or other utilities) cleanly override the defaults.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/admin-x-design-system/src/global/form/text-area.tsx` around lines 57 -
63, Replace the plain clsx usage with tailwind-merge to prevent silent Tailwind
utility conflicts: import twMerge from 'tailwind-merge' and wrap the computed
class string so consumer-provided utilities in className (e.g., widths like
"w-1/2") will correctly override the defaults; update the styles assignment
around the existing clsx(...) expression (reference: the styles variable where
clsx is called and the className parameter passed into it) to pass the combined
classes through twMerge before using them.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/admin-x-design-system/src/global/form/text-area.tsx`:
- Around line 57-63: Replace the plain clsx usage with tailwind-merge to prevent
silent Tailwind utility conflicts: import twMerge from 'tailwind-merge' and wrap
the computed class string so consumer-provided utilities in className (e.g.,
widths like "w-1/2") will correctly override the defaults; update the styles
assignment around the existing clsx(...) expression (reference: the styles
variable where clsx is called and the className parameter passed into it) to
pass the combined classes through twMerge before using them.

The global textarea rule in ghost.css sets max-width: 500px which was
preventing the TextArea from stretching to full width. Also removed
unnecessary w-full from the wrapper div.
@minimaluminium minimaluminium merged commit f851cf2 into main Feb 24, 2026
31 checks passed
@minimaluminium minimaluminium deleted the claude/slack-review-label-edit-logic-H21ko branch February 24, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants