Skip to content

fix: add missing Popover import in DetailHeader#476

Merged
JasonW404 merged 3 commits intomainfrom
fix/detailheader-popover-import
Apr 29, 2026
Merged

fix: add missing Popover import in DetailHeader#476
JasonW404 merged 3 commits intomainfrom
fix/detailheader-popover-import

Conversation

@JasonW404
Copy link
Copy Markdown
Collaborator

Summary

Fix a runtime crash when viewing dataset details with many tags (>5 or tags that overflow the container width).

Root Cause

The TagsInline component in DetailHeader.tsx uses <Popover> to display hidden tags when they overflow the container width (450px). However, Popover was not imported from antd:

  • Line 3: Imported Card, Button, Tag, Tooltip, Modal but missing Popover
  • Lines 193-215: Used <Popover> component

Error Flow

  1. User clicks dataset card on home page → navigates to /data/management/detail/:id
  2. DetailHeader renders TagsInline component
  3. Tags overflow container → hiddenCount > 0 triggers Popover render
  4. Popover is undefined → React crashes
  5. ErrorBoundary catches error → shows modal with "Go Home" button
  6. User clicks "Go Home" → redirected to homepage

Fix

Add Popover to the antd import statement on line 3.

Test Plan

  1. Create a dataset with more than 5 tags
  2. Click on the dataset card to view details
  3. Verify no crash occurs and tags are displayed correctly
  4. Hover over "+N" tag indicator to see hidden tags in Popover

The TagsInline component uses Popover to display hidden tags when
they overflow the container width, but Popover was not imported from
antd. This caused a runtime error when datasets had many tags (>5),
triggering ErrorBoundary and redirecting users to homepage.

Root cause: Line 3 imported Card, Button, Tag, Tooltip, Modal but
missing Popover, while Popover was used at lines 193-215.

Fix: Add Popover to the antd import statement.
Copilot AI review requested due to automatic review settings April 29, 2026 03:41
Copy link
Copy Markdown

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

Fixes a runtime crash in the dataset detail page when tags overflow, by ensuring the Popover component used by TagsInline is correctly imported from antd.

Changes:

  • Add missing Popover import to frontend/src/components/DetailHeader.tsx to prevent Popover is undefined at runtime.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jason added 2 commits April 29, 2026 12:18
The backend returns Tag objects with UUID string IDs, but frontend components
AddTagPopover and DetailHeader defined Tag interface with id: number, causing
type mismatch and potential display issues.

Changes:
- AddTagPopover.tsx: interface Tag { id: number } → { id: string }
- DetailHeader.tsx: TagConfig and TagsInline interfaces updated to id: string

This aligns with:
- Backend: TagResponse.java returns UUID string
- dataset.model.ts: TagItem interface already correctly defines id: string
@JasonW404 JasonW404 merged commit 3306b1c into main Apr 29, 2026
8 checks passed
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.

2 participants