Skip to content

Conversation

@innovark37
Copy link
Contributor

@innovark37 innovark37 commented Dec 16, 2025

User description

SUMMARY

This PR fixes visual inconsistencies in the three-dot menu buttons across different card types on the Home page. Previously, Saved Queries cards had different styling compared to Dashboard and Chart cards, creating an inconsistent user experience.

Changes

  • Removed extra wrapper div (<QueryData>) around the actions container
  • Fixed icon color: Changed from iconColor={theme.colorText} to standard iconSize="xl" to match other cards
  • Fixed icon alignment: Removed vertical-align: baseline from the Share menu item icon
  • Standardized spacing: Menu button now has consistent margins/padding like other card types

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE
{0FD9BC70-003F-4131-8ED6-63DA8E053B7D}

AFTER
{932666B0-72D9-470A-BD29-759A05056C14}

TESTING INSTRUCTIONS

  1. Navigate to SQL Lab
  2. Create and save a query
  3. Navigate to Home (/)
  4. Verify saved query appears on Home page
  5. Compare the three-dot button on your Saved Query card with three-dot buttons on Dashboard and Chart cards
    • Verify all buttons have identical margins/padding from card edges
    • Verify all icons have same color and size
    • Verify icon alignment in menu items

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

CodeAnt-AI Description

Unify three-dot menu styling on Saved Query cards to match other Home page cards

What Changed

  • Removed an extra wrapper around Saved Query actions so the three-dot menu uses the same actions container as Dashboard and Chart cards
  • Standardized the menu button appearance: icon now uses the same size and color approach as other cards and share menu icon alignment was fixed
  • Preserved existing menu items and click behavior while ensuring consistent margins/padding and click targets

Impact

✅ Consistent three-dot menus across Saved Query, Dashboard, and Chart cards
✅ Identical icon size, color, and spacing on Home page cards
✅ Predictable click behavior when opening card action menus

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI is reviewing your PR.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Dec 16, 2025

Code Review Agent Run #aa9f67

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 8786ed0..8786ed0
    • superset-frontend/src/features/home/SavedQueries.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added the home Namespace | Related to the Homepage label Dec 16, 2025
@codeant-ai-for-open-source codeant-ai-for-open-source bot added the size:S This PR changes 10-29 lines, ignoring generated files label Dec 16, 2025
@codeant-ai-for-open-source
Copy link
Contributor

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Missing useCallback dependencies
    The menuItems function is wrapped with useCallback but the callback's dependency array is empty. The callback references external variables (e.g., canEdit, canDelete, addDangerToast, addSuccessToast, copyQueryLink, and theme) and can therefore capture stale values leading to incorrect menu contents or wrong behavior after props/state change.

  • Visual/spacing regression risk
    The QueryData wrapper that previously applied spacing/margin for the action icons was removed. The new implementation uses Icons.MoreOutlined with only iconSize="xl". This may cause spacing/alignment differences compared with other card types (previous behavior relied on wrapper CSS). Verify the menu button margin/padding and icon vertical alignment across all card types to ensure consistent UX.

Comment on lines +340 to +350
<ListViewCard.Actions
onClick={e => {
e.stopPropagation();
e.preventDefault();
}}
>
<Dropdown
menu={{ items: menuItems(q) }}
trigger={['click', 'hover']}
>
<Dropdown
menu={{
items: menuItems(q),
}}
trigger={['click', 'hover']}
>
<Button buttonSize="xsmall" buttonStyle="link">
<Icons.MoreOutlined iconColor={theme.colorText} />
</Button>
</Dropdown>
</ListViewCard.Actions>
</QueryData>
<Button buttonSize="xsmall" buttonStyle="link">
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: The click handler that stops propagation and calls preventDefault is attached to the container (ListViewCard.Actions), which interferes with the Dropdown's trigger and may prevent the menu from opening; move the event handling to the actual clickable Button and only stop propagation (avoid preventDefault) so the Dropdown still receives/handles the click as expected. [logic error]

Severity Level: Minor ⚠️

Suggested change
<ListViewCard.Actions
onClick={e => {
e.stopPropagation();
e.preventDefault();
}}
>
<Dropdown
menu={{ items: menuItems(q) }}
trigger={['click', 'hover']}
>
<Dropdown
menu={{
items: menuItems(q),
}}
trigger={['click', 'hover']}
>
<Button buttonSize="xsmall" buttonStyle="link">
<Icons.MoreOutlined iconColor={theme.colorText} />
</Button>
</Dropdown>
</ListViewCard.Actions>
</QueryData>
<Button buttonSize="xsmall" buttonStyle="link">
<ListViewCard.Actions>
<Dropdown
menu={{ items: menuItems(q) }}
trigger={['click', 'hover']}
>
<Button
buttonSize="xsmall"
buttonStyle="link"
onClick={e => {
// Only stop propagation to avoid clicking the card parent,
// but don't call preventDefault so Dropdown can handle the event.
e.stopPropagation();
}}
>
Why it matters? ⭐

The current parent-level handler calls preventDefault and stopPropagation which can interfere with child handlers (the Dropdown's click trigger). Moving the stopPropagation to the actual Button and dropping preventDefault is a minimal, targeted fix that prevents the click from bubbling to the card while allowing the Dropdown to process the click normally. This addresses a real UX/logic issue and is safe to apply.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/features/home/SavedQueries.tsx
**Line:** 340:350
**Comment:**
	*Logic Error: The click handler that stops propagation and calls preventDefault is attached to the container (`ListViewCard.Actions`), which interferes with the Dropdown's trigger and may prevent the menu from opening; move the event handling to the actual clickable Button and only stop propagation (avoid preventDefault) so the Dropdown still receives/handles the click as expected.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI finished reviewing your PR.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes visual inconsistencies in the three-dot menu buttons on Saved Query cards by aligning their styling with Dashboard and Chart cards on the Home page.

  • Removed the QueryData wrapper component that was adding unnecessary margins and styling to the actions container
  • Standardized the menu button icon to use iconSize="xl" instead of iconColor={theme.colorText} to match other card types
  • Fixed icon alignment by removing vertical-align: baseline from the Share menu item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

home Namespace | Related to the Homepage size/M size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant