Skip to content

Replace status tooltip with details modal#3025

Merged
danielaskdd merged 13 commits intoHKUDS:mainfrom
g2424303264-code:status-details-modal
May 7, 2026
Merged

Replace status tooltip with details modal#3025
danielaskdd merged 13 commits intoHKUDS:mainfrom
g2424303264-code:status-details-modal

Conversation

@g2424303264-code
Copy link
Copy Markdown
Contributor

Description

Replace the document status hover tooltip with a click-triggered details dialog. The dialog displays the existing status information in a scrollable content area and includes a dedicated copy button for long error messages or metadata.

Related Issues

N/A

Changes Made

  • Added a document status details dialog opened from the status icon.
  • Added a scrollable content area for status details.
  • Added a dedicated copy button with success and failure feedback.
  • Added localized strings for the new dialog title, tooltips, and copy messages.

Checklist

  • Changes tested locally
  • Code reviewed
  • Documentation updated (if necessary)
  • Unit tests added (if applicable)

Additional Notes

Frontend checks were run with bun test and bun run build in lightrag_webui/.

@danielaskdd
Copy link
Copy Markdown
Collaborator

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 330f7d9d10

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lightrag_webui/src/features/DocumentManager.tsx Outdated
@danielaskdd
Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielaskdd danielaskdd added enhancement New feature or request ui web ui tracked Issue is tracked by project labels May 7, 2026
danielaskdd and others added 3 commits May 8, 2026 01:32
- Drop speculative `extraction_format`/`engine` cast (not in DocStatusResponse, no backend route emits them).
- Suppress tooltip flash after dialog close via `onCloseAutoFocus` preventDefault on DialogContent.
- Collapse trigger nesting to `<DialogTrigger asChild><Button tooltip ...>`, matching existing dialog patterns and removing a per-row TooltipProvider.
- Replace native `title` on file/summary cells with styled Tooltip components, sharing a single TooltipProvider lifted to the table root.
- Remove unreachable empty-details guard in DocumentStatusDetailsDialog.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@danielaskdd
Copy link
Copy Markdown
Collaborator

Pushed a follow-up commit (0496d44) addressing the review points:

  1. Speculative type-cast removedas DocStatusResponse & { extraction_format?: unknown; engine?: unknown } is gone. These fields aren't declared on DocStatusResponse and no backend route emits them; if they ever start being sent, prefer adding them to the type.
  2. Tooltip flash on dialog close fixed — added onCloseAutoFocus={(e) => e.preventDefault()} to DialogContent. Root cause: Radix Dialog restores focus to the trigger button on close, and Radix TooltipTrigger listens to focus for keyboard a11y, so the focus return triggered the tooltip every time. Suppressing the auto-focus restore fixes the flash without breaking keyboard nav (Tab still works).
  3. Trigger nesting simplified — collapsed <TooltipProvider><Tooltip><TooltipTrigger asChild><DialogTrigger asChild><Button> into <DialogTrigger asChild><Button tooltip={openLabel} side=\"top\">, reusing the existing Button.tooltip pattern (same as UploadDocumentsDialog/ClearDocumentsDialog). One fewer per-row TooltipProvider.
  4. Styled tooltips for file/summary cells — replaced native title= with <Tooltip> components for visual consistency. Lifted a single <TooltipProvider> to the <Table> root so it's shared across rows instead of created per-row.
  5. Unreachable guard removedif (!details) return null inside DocumentStatusDetailsDialog can't fire because the call site already checks hasDocumentDetails(doc).

Verified with `bun run build` (✓ 1.67s). Existing `react-hooks/set-state-in-effect` lint errors at lines 1131/1150/1156 pre-date this PR and are unrelated.

…om spacing

- Prevent the copy button's tooltip from auto-showing when the dialog
  opens. Radix FocusScope was focusing the first tabbable child (the
  copy button), and TooltipTrigger's focus listener fired the tooltip.
  Redirect initial focus to DialogContent itself.
- Drop `min-h-[7.5em]` on the details box. With short content (e.g.
  Track ID + 2 metadata lines) the min-height padded the box taller
  than its content, leaving a visible empty band below the last line.
  Letting the box size to content removes that gap; max-h still caps
  long content for scrolling.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@danielaskdd
Copy link
Copy Markdown
Collaborator

Pushed another follow-up (7499017) addressing two display issues observed when opening the modal:

1. Copy button tooltip auto-shows on dialog open
Radix FocusScope (inside DialogContent) focuses the first tabbable child on open. In our layout the copy button is the first focusable element (DialogTitle/DialogDescription aren't focusable, and the built-in X close button is rendered after children). TooltipTrigger listens to focus for keyboard a11y, so the auto-focus immediately fired the tooltip. Fix: redirect initial focus to DialogContent itself via onOpenAutoFocus:

onOpenAutoFocus={(e) => {
  e.preventDefault()
  ;(e.currentTarget as HTMLElement | null)?.focus()
}}

DialogContent already carries tabIndex={-1}, so it can hold focus. Tab still traps inside the dialog, ESC still closes it.

2. Empty band below the last line of details
The inner box used min-h-[7.5em] (≈105px). With typical content (Track ID + 2 metadata lines ≈ 80px) the min-height padded the box taller than its content, producing the visible gap below the last line. Removed min-h-[7.5em] so the box sizes to content; max-h-[60vh] still caps long content for scrolling, and p-3 keeps the existing inner padding even for very short content.

@danielaskdd danielaskdd merged commit 8914b32 into HKUDS:main May 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tracked Issue is tracked by project ui web ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants