Skip to content

feat(citations): show full prompt text on hover in the prompt filter dropdown #298

Closed

Description

@gkhngyk

Problem

On the Citations page (/dashboard/citations), the Prompt filter dropdown truncates long prompts so they can't be read in full. Truncation is fine for the dropdown width, but there's currently no way to see the complete prompt text — hovering an option shows nothing.

Worse, the full text is discarded before render. In web/src/app/[locale]/(dashboard)/dashboard/citations/page.tsx (~line 391), the combobox items are built as:

const promptComboboxItems = useMemo(
  () =>
    prompts.map((p) => ({
      value: p.id,
      label: p.text.length > 80 ? `${p.text.slice(0, 80)}…` : p.text,
    })),
  [prompts],
);

So each item only keeps a pre-sliced label — the original p.text is gone. On top of that, ComboboxItem already applies the Tailwind truncate class (web/src/components/ui/combobox.tsx:115), so the manual slice(0, 80) is redundant for the visual layout and only serves to throw the full text away.

Proposed change

  1. Keep the full prompt on each item: add fullText: p.text.
  2. Drop the manual slice(0, 80) — let the existing CSS truncate handle visual overflow, so the option fits the dropdown width without losing data.
  3. Pass title={item.fullText} to ComboboxItem (it already spreads {...props} onto the underlying element) → native browser tooltip on hover, also read by screen readers. No new dependency or tooltip component needed.

Files to touch

  • web/src/app/[locale]/(dashboard)/dashboard/citations/page.tsx — add fullText, drop the slice, pass title to ComboboxItem
  • web/src/components/ui/combobox.tsx — only if title doesn't already reach the DOM node via {...props} (it should, so likely no change)

How to test

  1. Open /dashboard/citations for a brand with at least one long prompt (>80 chars).
  2. Open the Prompt filter dropdown — long options are visually truncated with an ellipsis (unchanged).
  3. Hover a truncated option → the full prompt text appears as a native tooltip.
  4. Short prompts render and behave exactly as before (no regression).
  5. No new runtime dependency added.

Activity

  1. added
    enhancement
    good first issue
    on Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions