feat(widgets): add label styling options to button widget#41998
feat(widgets): add label styling options to button widget#41998amelia-c0n wants to merge 13 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe Button widget exposes configurable label text color, font size, and bold/italic styling. Values are validated, forwarded through the component stack, and applied to label text and icons while preserving disabled-state styling. ChangesButton label customization
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant PropertyPane
participant ButtonWidget
participant ButtonComponent
participant StyledButton
PropertyPane->>ButtonWidget: Configure label styling properties
ButtonWidget->>ButtonComponent: Pass labelStyle, labelTextColor, labelTextSize
ButtonComponent->>StyledButton: Forward label styling props
StyledButton->>StyledButton: Validate and apply label and icon styles
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/29431001505. |
|
🔴🔴🔴 Cyclic Dependency Check: This PR has increased the number of cyclic dependencies by 2, when compared with the release branch. Refer this document to identify the cyclic dependencies introduced by this PR. You can view the dependency diff in the run log. Look for the check-cyclic-dependencies job in the run. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app/client/src/widgets/ButtonWidget/component/index.tsx (1)
138-138: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winUse logical OR for a safer CSS fallback.
If
labelTextSizeis explicitly bound to an empty string (e.g., via JS evaluation), the nullish coalescing operator (??) will inject the empty string, resulting in an invalid CSS rule (font-size: ;). Using the logical OR operator (||) provides a safer fallback to"inherit".♻️ Proposed refactor
- font-size: ${labelTextSize ?? "inherit"}; + font-size: ${labelTextSize || "inherit"};🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/client/src/widgets/ButtonWidget/component/index.tsx` at line 138, Update the font-size interpolation in the ButtonWidget styling to use logical OR instead of nullish coalescing, so empty labelTextSize values fall back to "inherit" while preserving valid configured sizes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/client/src/widgets/ButtonWidget/widget/index.tsx`:
- Around line 449-454: Update the regex in the validation configuration within
the ButtonWidget index to use grouped prefix matching, rejecting values
beginning with “<” or “{{” only. Replace the current character-class lookahead
while preserving the existing non-empty text requirement.
---
Nitpick comments:
In `@app/client/src/widgets/ButtonWidget/component/index.tsx`:
- Line 138: Update the font-size interpolation in the ButtonWidget styling to
use logical OR instead of nullish coalescing, so empty labelTextSize values fall
back to "inherit" while preserving valid configured sizes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 98d836e4-7bd4-4ea2-b296-995db8b1405a
📒 Files selected for processing (2)
app/client/src/widgets/ButtonWidget/component/index.tsxapp/client/src/widgets/ButtonWidget/widget/index.tsx
|
Deploy-Preview-URL: https://ce-41998.dp.appsmith.com |
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/29501986465. |
|
Deploy-Preview-URL: https://ce-41998.dp.appsmith.com |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_Basic_spec.js`:
- Around line 426-428: Extract the shared color-picker selector used near lines
426-428 and 615-617 of
app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_Basic_spec.js
into a locator variable in Widgets.json, preferring a data-* locator where
available; update both sites to use that variable instead of inline CSS template
strings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 73ee94bb-6c19-4268-8d72-732fcf9088d3
📒 Files selected for processing (1)
app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_Basic_spec.js
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/29560276310. |
|
Deploy-Preview-URL: https://ce-41998.dp.appsmith.com |
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/29587879042. |
|
Deploy-Preview-URL: https://ce-41998.dp.appsmith.com |
Description
Adds a Label styles section to the Button widget property pane so users can customize the button label independently of the button color settings.
labelTextColor)labelTextSize)labelStyle)Styles apply to the label text and icon, including the disabled state.
Fixes #15065
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/29582506952
Commit: 9fc952e
Cypress dashboard.
Tags:
@tag.AllSpec:
Fri, 17 Jul 2026 14:14:30 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit