Skip to content

[FIX] Fix tiny action buttons in Prompt Studio modals#1879

Merged
chandrasekharan-zipstack merged 2 commits into
mainfrom
fix/prompt-studio-action-buttons-css
Mar 31, 2026
Merged

[FIX] Fix tiny action buttons in Prompt Studio modals#1879
chandrasekharan-zipstack merged 2 commits into
mainfrom
fix/prompt-studio-action-buttons-css

Conversation

@chandrasekharan-zipstack

@chandrasekharan-zipstack chandrasekharan-zipstack commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

What

  • Fix tiny/shrunken action buttons (copy, edit, delete, re-index) in Prompt Studio's LLM Profile Settings and Manage Document Variants modals
  • Consolidate delete button into the Actions column in Manage Document Variants (was a separate unlabeled column)
  • Add "Select Default" column header and constrain column widths

Why

  • The Vite migration (PR UN-3185 [MISC]: Migrate frontend from Create React App to Vite #1607) switched the lockfile from npm to bun, bumping antd from 5.13.2 to 5.29.3. In newer antd v5, icon-only buttons no longer render correctly when icons are passed as children instead of using the icon prop — buttons became tiny/barely visible
  • Additionally, classID (invalid React prop) was used instead of className on icon components since the initial commit, so the styling class was never applied
  • The delete button in Manage Documents was in its own unlabeled column, inconsistent with the LLM Profile Settings layout
image image

How

  • Use antd's icon prop for all icon-only <Button> components in ManageLlmProfiles.jsx and ManageDocsModal.jsx
  • Move the delete button into the Actions column <Space> alongside the re-index button in ManageDocsModal.jsx
  • Remove the separate delete column definition
  • Add "Select Default" title with align: "center" and width: 120 to the select column
  • Reduce Actions column width from 200 to 120
  • Remove unused .manage-llm-pro-icon CSS class (set font-size: 10px)

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • No. This is a pure frontend CSS/layout fix. Only changes how existing icon buttons are rendered (using icon prop vs children) and column layout in the Manage Documents table. No logic, API, or data changes.

Database Migrations

  • None

Env Config

  • None

Relevant Docs

  • None

Related Issues or PRs

Dependencies Versions

  • No changes

Notes on Testing

  • Open any Prompt Studio project
  • Click Settings (gear icon) → verify LLM Profile Settings action buttons (copy, edit, delete) are properly sized
  • Click Manage Documents → verify re-index and delete buttons are side by side in Actions column, Select Default column is labeled and compact, document names take most of the table width

Screenshots

image image

Checklist

I have read and understood the Contribution Guidelines.

…modals

The Vite migration bumped antd from 5.13.2 to 5.29.3. Newer antd no
longer sizes icon-only buttons correctly when icons are passed as
children instead of using the `icon` prop. Also fixes `classID` (invalid
React prop) that was used instead of `className` since initial commit.

- Use antd `icon` prop for all icon-only buttons in ManageLlmProfiles
  and ManageDocsModal
- Merge delete button into Actions column in ManageDocsModal (was a
  separate unlabeled column)
- Add "Select Default" header to document selection column
- Constrain Actions and Select Default column widths so document names
  take most space
- Remove unused `.manage-llm-pro-icon` CSS class (10px font-size)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Style

    • Updated button icon styling across action buttons for consistency.
  • Refactor

    • Reorganized table column layout in document management interface to consolidate delete and reindex actions for improved usability.

Walkthrough

Refactored Ant Design Button components across six component files to use the icon prop instead of rendering icon elements as children. Additionally, restructured the ManageDocsModal table layout by consolidating the delete action into the reindex column and adjusting column widths, and removed an unused CSS icon styling rule.

Changes

Cohort / File(s) Summary
Ant Design Button Icon Prop Refactoring
frontend/src/components/agency/prompt/Prompt.jsx, frontend/src/components/custom-tools/header-title/HeaderTitle.jsx, frontend/src/components/pipelines-or-deployments/notification-modal/DisplayNotifications.jsx, frontend/src/components/settings/platform/PlatformSettings.jsx
Updated Button components to pass icons via the icon prop instead of rendering them as children (MinusOutlined, EditOutlined, DeleteOutlined). No logic or behavior changes.
ManageLlmProfiles Icon and Styling Updates
frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx, frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.css
Refactored three action buttons (Copy, Edit, Delete) to use the icon prop, removed unused className and classID attributes, and deleted the .manage-llm-pro-icon CSS rule setting font-size: 10px.
ManageDocsModal Table Restructuring
frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx
Removed the dedicated delete column and moved the delete action into the reindex column with a ConfirmModal wrapper. Adjusted reindex column width (200 → 120), relabeled and widened the select action column to "Select Default" (30 → 120), and centered its alignment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change—fixing undersized action buttons in Prompt Studio modals—and reflects the core fix across multiple components.
Description check ✅ Passed The description is comprehensive and complete, covering all required template sections including What, Why, How, breaking changes assessment, testing notes, related issues, and the contribution checklist.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/prompt-studio-action-buttons-css

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.

@greptile-apps

greptile-apps Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes icon-only <Button> components that became tiny/invisible after the antd upgrade from 5.13.2 to 5.29.3 (introduced by the Vite migration in #1607). The fix is applied consistently across six components by moving icons from button children to antd's icon prop, which is the correct pattern in newer antd v5. It also removes an invalid classID prop (should be className) that was silently swallowing a font-size: 10px CSS rule, and consolidates the Manage Documents table layout by merging the orphaned delete column into the Actions column.

Key changes:

  • ManageLlmProfiles.jsx / ManageDocsModal.jsx: All icon-only <Button> elements now use icon={<XxxOutlined />} instead of <XxxOutlined /> as children.
  • ManageLlmProfiles.css: Removed .manage-llm-pro-icon { font-size: 10px } — this class was never applied (invalid classID prop) and would have shrunk icons undesirably if it had been.
  • ManageDocsModal.jsx: Delete button merged into the Actions <Space>, the standalone delete column removed, "Select Default" column header added with align: "center" and width: 120, and Actions column width trimmed from 200 to 120.
  • Prompt.jsx, HeaderTitle.jsx, DisplayNotifications.jsx, PlatformSettings.jsx: Same icon prop migration applied for consistency.
  • No logic, API, or data changes in any file.

Confidence Score: 5/5

  • Safe to merge — pure frontend rendering fix with no logic, API, or data changes.
  • All changes are mechanical substitutions of the icon-as-child pattern with the correct antd icon prop. The root cause is well understood (antd 5.29 behaviour change + invalid classID prop), the fix is applied uniformly across all affected components, and the PR description includes before/after screenshots confirming correct rendering. No P0 or P1 issues found.
  • No files require special attention.

Important Files Changed

Filename Overview
frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx Consolidated delete button into the Actions column Space, switched to icon prop for the delete Button, removed the standalone delete column definition, added "Select Default" title with align/width, and reduced Actions column width from 200 to 120.
frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx Replaced child icon pattern with the antd icon prop for copy, edit, and delete buttons; removed invalid classID prop and display-flex-align-center className from all three buttons.
frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.css Removed .manage-llm-pro-icon CSS rule (font-size: 10px) that was responsible for the shrunk icon buttons; class was also never applied due to the invalid classID prop.
frontend/src/components/agency/prompt/Prompt.jsx Converted MinusOutlined and EditOutlined from button children to the icon prop on their respective Buttons; no logic changes.
frontend/src/components/custom-tools/header-title/HeaderTitle.jsx Moved EditOutlined icon from button children to the icon prop; simplified to a self-closing Button element.
frontend/src/components/pipelines-or-deployments/notification-modal/DisplayNotifications.jsx Moved EditOutlined and DeleteOutlined icons from button children to the icon prop; no logic changes.
frontend/src/components/settings/platform/PlatformSettings.jsx Moved DeleteOutlined icon from button children to the icon prop; no logic changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["antd Button (icon-only)"] --> B{How is icon passed?}
    B -->|"Old: children\n&lt;Button&gt;&lt;Icon/&gt;&lt;/Button&gt;"| C["antd 5.29+ renders\ntiny / invisible button"]
    B -->|"New: icon prop\n&lt;Button icon=&lt;Icon/&gt; /&gt;"| D["antd renders\ncorrectly-sized button"]

    E["classID prop on Icon"] --> F["Invalid React prop — silently ignored\nCSS class never applied\n(font-size: 10px never set)"]
    E --> G["Removed in this PR"]

    H["ManageDocsModal table"] --> I["Before: 3 columns\n(Actions | Delete | Select)"]
    H --> J["After: 2 columns\n(Actions w/ delete merged | Select Default)"]
Loading

Reviews (2): Last reviewed commit: "[FIX] Fix icon-only buttons across remai..." | Re-trigger Greptile

Same antd 5.29.3 regression — use `icon` prop instead of children for
icon-only buttons in PlatformSettings, HeaderTitle, Prompt, and
DisplayNotifications.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@chandrasekharan-zipstack chandrasekharan-zipstack marked this pull request as ready for review March 31, 2026 04:45
@github-actions

Copy link
Copy Markdown
Contributor

Frontend Lint Report (Biome)

All checks passed! No linting or formatting issues found.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx (1)

123-127: Add accessible names for icon-only action buttons.

Line 123, Line 129, and Line 145 render icon-only buttons without explicit labels. Add aria-label so screen readers can announce the actions.

♿ Suggested update
             <Tooltip title="Copy Profile ID">
               <Button
                 size="small"
                 icon={<CopyOutlined />}
+                aria-label="Copy profile ID"
                 onClick={() => copyProfileId(item?.profile_id)}
               />
             </Tooltip>
             <Button
               size="small"
               icon={<EditOutlined />}
+              aria-label="Edit profile"
               disabled={isPublicSource}
               onClick={() => handleEdit(item?.profile_id)}
             />
@@
                 <Button
                   size="small"
                   icon={<DeleteOutlined />}
+                  aria-label="Delete profile"
                   disabled={
                     isPublicSource || defaultLlmProfile === item?.profile_id
                   }
                 />

Also applies to: 129-134, 145-151

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

In
`@frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx`
around lines 123 - 127, The icon-only <Button> elements need accessible names:
for each icon-only Button (the one calling copyProfileId(item?.profile_id) and
the buttons that call editProfile(...) and deleteProfile(...)) add an aria-label
with a concise descriptive phrase (e.g., "Copy profile ID", "Edit profile",
"Delete profile") so screen readers can announce the action; locate the Button
components rendering the CopyOutlined, Edit (or pencil) and Delete icons and add
the appropriate aria-label attribute to each.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx`:
- Around line 123-127: The icon-only <Button> elements need accessible names:
for each icon-only Button (the one calling copyProfileId(item?.profile_id) and
the buttons that call editProfile(...) and deleteProfile(...)) add an aria-label
with a concise descriptive phrase (e.g., "Copy profile ID", "Edit profile",
"Delete profile") so screen readers can announce the action; locate the Button
components rendering the CopyOutlined, Edit (or pencil) and Delete icons and add
the appropriate aria-label attribute to each.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 308df6ba-dd5c-484a-a999-d50407153ad4

📥 Commits

Reviewing files that changed from the base of the PR and between 70bbd61 and d264ad8.

📒 Files selected for processing (7)
  • frontend/src/components/agency/prompt/Prompt.jsx
  • frontend/src/components/custom-tools/header-title/HeaderTitle.jsx
  • frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx
  • frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.css
  • frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx
  • frontend/src/components/pipelines-or-deployments/notification-modal/DisplayNotifications.jsx
  • frontend/src/components/settings/platform/PlatformSettings.jsx
💤 Files with no reviewable changes (1)
  • frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.css

@athul-rs

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Notable observations (below threshold, not flagged as issues):

  • NotesCard.jsx has the same icon-as-child pattern this PR fixes in other files — consider including it for completeness
  • Icon-only buttons across the changed files lack aria-label attributes (pre-existing, but opportunity to add during this refactor)

Lint Rule Candidates

Patterns spotted that could become automated lint rules if they recur:

  • Icon-only Button without icon prop: Ant Design <Button> components with only an icon child instead of using the icon prop — causes sizing issues in antd v5.x
  • Icon-only Button missing aria-label: <Button icon={<SomeIcon />}> without an aria-label — accessibility gap for screen readers

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@athul-rs

Copy link
Copy Markdown
Contributor

Suggested addition: codify this pattern in CLAUDE.md

This is the 3rd PR where these two patterns have been flagged in review (#1758, #1860, now this one). Worth adding them as explicit rules so they get caught automatically going forward.

Consider adding this to CLAUDE.md as part of this PR:

## Frontend Code Review Rules

These are patterns that have been flagged 3+ times in code review. Treat them as lint rules — flag them in reviews and fix them when writing new code.

1. **Icon-only buttons must use the `icon` prop**: In Ant Design v5, `<Button icon={<EditOutlined />} />` is correct. Do NOT pass icons as children (`<Button><EditOutlined /></Button>`) — this causes sizing/rendering bugs.
2. **Icon-only buttons must have `aria-label`**: Any `<Button>` that has only an icon and no text must include an `aria-label` describing its action (e.g., `aria-label="Delete profile"`).

Also worth checking NotesCard.jsx (lines 148-164) — it has the same icon-as-child pattern this PR fixes elsewhere.

🤖 Generated with Claude Code

@chandrasekharan-zipstack chandrasekharan-zipstack merged commit 92374fe into main Mar 31, 2026
10 checks passed
@chandrasekharan-zipstack chandrasekharan-zipstack deleted the fix/prompt-studio-action-buttons-css branch March 31, 2026 05:44
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