Skip to content

Conversation

@EnxDev
Copy link
Contributor

@EnxDev EnxDev commented Jan 2, 2026

User description

SUMMARY

This PR fixes a cosmetic issue in the dashboard tab reordering feature where the cursor would incorrectly show as a drag cursor when hovering over the tab title input field.

The Problem
When hovering over the input field used to edit tab names, the drag cursor would appear instead of the text cursor, even though editing was still possible. This created a confusing user experience where the visual feedback didn't match the expected behavior.

The Solution
We customize the PointerSensor.activators to check if the pointer target is an interactive element (input, textarea, or contentEditable).
When an interactive element is detected, drag activation is prevented, allowing the browser to show the correct text cursor and making the interaction feel more natural.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

  • Before
before-custom-tag.mp4
  • After
after-custom-tag.mp4

TESTING INSTRUCTIONS

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
    es new feature or API
  • Removes existing feature or API

CodeAnt-AI Description

Disable drag while editing tab titles to prevent accidental reorders

What Changed

  • Drag-and-drop is disabled when the user starts a pointer interaction on an input, textarea, or any content-editable element inside a tab, so clicking to edit a tab name no longer triggers tab reordering
  • The tab title edit field shows the correct text cursor and accepts typing without initiating a drag
  • Removed forcing the tabs container to full height, restoring the previous sizing behavior

Impact

✅ Fewer accidental tab reorders
✅ Clearer tab title editing
✅ Correct text cursor when editing tabs

💡 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.

Prevents drag activation when clicking on input/textarea elements,
allowing users to edit tab titles without accidentally triggering
drag-and-drop reordering
@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 2, 2026

Code Review Agent Run #f841b1

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: ad53a4c..ad53a4c
    • superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.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 Superset 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 dashboard:tab Related to the usage of tabs in the Dashboard label Jan 2, 2026
@codeant-ai-for-open-source codeant-ai-for-open-source bot added the size:M This PR changes 30-99 lines, ignoring generated files label Jan 2, 2026
@codeant-ai-for-open-source
Copy link
Contributor

Sequence Diagram

Shows how pointer events are routed to the PointerSensor which now detects interactive elements (input/textarea/contentEditable). If interactive, drag activation is prevented so the user can edit the tab title; otherwise the normal drag-reorder flow proceeds.

sequenceDiagram
    participant User
    participant Browser
    participant PointerSensor
    participant DndContext
    participant TabsRenderer

    User->>Browser: Pointer down on tab title
    Browser->>PointerSensor: Deliver pointer event
    alt Target is interactive (input/textarea/contentEditable)
        PointerSensor-->>Browser: Prevent drag activation
        Browser-->>User: Show text cursor / allow editing
        User->>TabsRenderer: Edit tab title
        TabsRenderer-->>User: Save/display updated title
    else Target is non-interactive
        PointerSensor->>DndContext: Activate drag
        DndContext->>TabsRenderer: Reorder tabs onDragEnd
        TabsRenderer-->>User: Render reordered tabs
    end
Loading

Generated by CodeAnt AI

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

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Global Mutation
    The PR mutates PointerSensor.activators at module initialization. This changes dnd-kit global behavior for all consumers and may have unintended side effects across the app or other DnD contexts. Prefer passing custom activators to the specific sensor instance (via useSensor) instead of mutating the library export.

  • Import-time Side Effects
    The active code runs at module import time. If this file is imported in SSR or other contexts unexpectedly, it produces side effects by overriding the sensor behavior globally. Consider scoping the override to client-side init or the component lifecycle.

  • DOM Traversal Safety
    isInteractiveElement uses recursion and assumes the node is an HTMLElement with a tagName. event.target may be a text node or non-HTMLElement (SVG, etc.). The recursive implementation could cause a stack overflow on very deep trees and may throw when encountering non-element nodes. Use an iterative traversal, guard node types, and stop at document/body.

@EnxDev EnxDev added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Jan 2, 2026
@github-actions github-actions bot added 🎪 ad53a4c 🚦 building Environment ad53a4c status: building 🎪 ad53a4c 📅 2026-01-02T11-17 Environment ad53a4c created at 2026-01-02T11-17 🎪 ad53a4c 🤡 EnxDev Environment ad53a4c requested by EnxDev and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Jan 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

🎪 Showtime is building environment on GHA for ad53a4c

@github-actions github-actions bot added the 🎪 ⌛ 48h Environment expires after 48 hours (default) label Jan 2, 2026
Comment on lines +57 to +64
handler: ({ nativeEvent: event }, { onActivation }) => {
if (
event.button !== 0 ||
isInteractiveElement(event.target as HTMLElement)
) {
return false;
}
onActivation?.({ event });
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 custom PointerSensor.activators handler calls onActivation directly on pointer down whenever the conditions pass, which bypasses the configured activationConstraint: { distance: 10 } on the sensor; this means drags will start immediately instead of after the intended movement threshold, causing unintended drags when users just click tabs. [logic error]

Severity Level: Minor ⚠️

Suggested change
handler: ({ nativeEvent: event }, { onActivation }) => {
if (
event.button !== 0 ||
isInteractiveElement(event.target as HTMLElement)
) {
return false;
}
onActivation?.({ event });
handler: ({ nativeEvent: event }) => {
if (
event.button !== 0 ||
isInteractiveElement(event.target as HTMLElement)
) {
return false;
}
// Returning true lets the default PointerSensor logic
// (including activationConstraint) decide when to activate
Why it matters? ⭐

The current activator explicitly calls onActivation on pointer down which forces immediate activation and indeed bypasses the PointerSensor's activationConstraint (distance: 10) supplied when creating the sensor. In dnd-kit the handler should return true to indicate the event is a potential activation and let the sensor's own logic (including distance threshold) decide when to call onActivation. The suggested change fixes a real logic bug that causes accidental drags when clicking tabs.

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

**Path:** superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx
**Line:** 57:64
**Comment:**
	*Logic Error: The custom `PointerSensor.activators` handler calls `onActivation` directly on pointer down whenever the conditions pass, which bypasses the configured `activationConstraint: { distance: 10 }` on the sensor; this means drags will start immediately instead of after the intended movement threshold, causing unintended drags when users just click tabs.

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.

@github-actions github-actions bot added 🎪 ad53a4c 🚦 deploying Environment ad53a4c status: deploying 🎪 ad53a4c 🚦 running Environment ad53a4c status: running 🎪 🎯 ad53a4c Active environment pointer - ad53a4c is receiving traffic 🎪 ad53a4c 🌐 54.218.223.66:8080 Environment ad53a4c URL: http://54.218.223.66:8080 (click to visit) and removed 🎪 ad53a4c 🚦 building Environment ad53a4c status: building 🎪 ad53a4c 🚦 deploying Environment ad53a4c status: deploying 🎪 ad53a4c 🚦 running Environment ad53a4c status: running 🎪 🎯 ad53a4c Active environment pointer - ad53a4c is receiving traffic labels Jan 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

🎪 Showtime deployed environment on GHA for ad53a4c

Environment: http://54.218.223.66:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@github-actions github-actions bot removed the 🎪 ad53a4c 📅 2026-01-02T11-17 Environment ad53a4c created at 2026-01-02T11-17 label Jan 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

🎪 Showtime deployed environment on GHA for b5e76cc

Environment: http://35.94.203.45:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 2, 2026

Code Review Agent Run #6af842

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: ad53a4c..b5e76cc
    • superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.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 Superset 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

Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

The original issue was that when dragging an active tab it would not show the drag indicator. We have a few possible paths here:

  • Show the drag indicator only when dragging has actually started.
  • Add an additional dragging area (before or after the tab title) that would indicate to the user that dragging can be done by targeting that specific area - very common pattern.
  • Accept that an active tab is also editable and never show the drag indicator (previous behavior) - acceptable but not perfect.

I think option 1 is viable and option 2 is ideal.

The change introduced in this PR seems to have an issue for which dragging would not be possible at all if you are hovering the tab text - which is definitely something we don't want.

@geido
Copy link
Member

geido commented Jan 2, 2026

The original issue was that when dragging an active tab it would not show the drag indicator. We have a few possible paths here:

  • Show the drag indicator only when dragging has actually started.
  • Add an additional dragging area (before or after the tab title) that would indicate to the user that dragging can be done by targeting that specific area - very common pattern.
  • Accept that an active tab is also editable and never show the drag indicator (previous behavior) - acceptable but not perfect.

I think option 1 is viable and option 2 is ideal.

The change introduced in this PR seems to have an issue for which dragging would not be possible at all if you are hovering the tab text - which is definitely something we don't want.

Better ask for product feedback if you want to go with option 2

@EnxDev
Copy link
Contributor Author

EnxDev commented Jan 2, 2026

Better ask for product feedback if you want to go with option 2

Yes, I believe the changes I introduced in this PR could be integrated with option 2.

@github-actions github-actions bot removed 🎪 b5e76cc 🚦 running Environment b5e76cc status: running 🎪 b5e76cc 🌐 35.94.203.45:8080 Environment b5e76cc URL: http://35.94.203.45:8080 (click to visit) 🎪 b5e76cc 🤡 EnxDev Environment b5e76cc requested by EnxDev 🎪 b5e76cc 📅 2026-01-02T12-01 Environment b5e76cc created at 2026-01-02T12-01 labels Jan 4, 2026
@EnxDev EnxDev added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Jan 5, 2026
@github-actions github-actions bot added 🎪 b5e76cc 🚦 building Environment b5e76cc status: building 🎪 b5e76cc 📅 2026-01-05T16-40 Environment b5e76cc created at 2026-01-05T16-40 🎪 b5e76cc 🤡 EnxDev Environment b5e76cc requested by EnxDev and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Jan 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

🎪 Showtime is building environment on GHA for b5e76cc

@github-actions github-actions bot added 🎪 b5e76cc 🚦 deploying Environment b5e76cc status: deploying 🎪 b5e76cc 🚦 running Environment b5e76cc status: running 🎪 🎯 b5e76cc Active environment pointer - b5e76cc is receiving traffic 🎪 b5e76cc 🌐 35.95.20.49:8080 Environment b5e76cc URL: http://35.95.20.49:8080 (click to visit) and removed 🎪 b5e76cc 🚦 building Environment b5e76cc status: building 🎪 b5e76cc 🚦 deploying Environment b5e76cc status: deploying 🎪 b5e76cc 🚦 running Environment b5e76cc status: running 🎪 🎯 b5e76cc Active environment pointer - b5e76cc is receiving traffic labels Jan 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

🎪 Showtime deployed environment on GHA for b5e76cc

Environment: http://35.95.20.49:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@github-actions github-actions bot removed 🎪 b5e76cc 🚦 running Environment b5e76cc status: running 🎪 b5e76cc 🤡 EnxDev Environment b5e76cc requested by EnxDev 🎪 b5e76cc 📅 2026-01-05T16-40 Environment b5e76cc created at 2026-01-05T16-40 🎪 b5e76cc 🌐 35.95.20.49:8080 Environment b5e76cc URL: http://35.95.20.49:8080 (click to visit) labels Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard:tab Related to the usage of tabs in the Dashboard size/M size:M This PR changes 30-99 lines, ignoring generated files 🎪 ⌛ 48h Environment expires after 48 hours (default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants