Skip to content

feat(Selector): show a truncated value's whole label in a tooltip - #175

Draft
lablup-quill[bot] wants to merge 1 commit into
mainfrom
feat/gh-174-selector-truncated-value-tooltip
Draft

lablup-quill[bot] wants to merge 1 commit into
mainfrom
feat/gh-174-selector-truncated-value-tooltip

Conversation

@lablup-quill

@lablup-quill lablup-quill Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #174

Summary

Add showSelectedOptionTooltip, an opt-in prop on the single-select Selector (and so BAISelect single mode), that shows the selected option's full label in a tooltip on hover or keyboard focus when the trigger cuts it off with an ellipsis.

Changes

  • src/formControls/Selector/Selector.tsx: resolves the selected option from options (sections included) and mounts the trigger tooltip when the trigger clips the label.
  • src/formControls/triggerTooltip.tsx: the trigger tooltip MultiSelector already had, moved out and shared, plus the clipping measurement. MultiSelector behaviour is unchanged; both now follow the trigger's own disabled and expanded state the same way.
  • Tests: clipping on and off, hover and keyboard focus, following the value, a disabled control, an open listbox, aria-describedby wiring, sections and a value-only option, and the caller's ref.
  • A ShowTruncatedValueTooltip story and a CHANGELOG.md [Unreleased] entry.

Verification

pnpm run typecheck, pnpm run lint, pnpm run format:check, pnpm run test (111 files, 2410 passed, 16 skipped) and pnpm run build: pass.

Risk tier: Medium
Suggested human approvals: 1 (branch protection decides)

Add showSelectedOptionTooltip, an opt-in prop that reads the selected option's full label on hover or focus when the trigger ellipsizes it. It shows only while the label is actually clipped, and stays off while nothing is selected, while the control is disabled, or while the listbox is open. The trigger tooltip is now shared with MultiSelector so both follow the trigger's own state the same way.
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

GitHub Pages may take up to a minute to hydrate after the deploy.

🧩 Changed Components

No files changed under src/components/ or src/forks/.

4 other changed file(s) in src/
  • src/formControls/MultiSelector/MultiSelector.tsx
  • src/formControls/Selector/Selector.stories.tsx
  • src/formControls/Selector/Selector.tsx
  • src/formControls/triggerTooltip.tsx

📦 Bundle Size

Group Gzip Δ Gzip vs base
formControls 16.6 kB +0.7 kB

Total gzip (JS + CSS): 214.4 kB (+0.7 kB vs origin/main)


Generated by the PR Preview workflow for 005114e · Storybook · CI run

github-actions Bot added a commit that referenced this pull request Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Preview published under the pr-175 dist-tag (npmjs): 0.2.0-alpha.21.pr-175-20261124104310-005114e87

pnpm add @lablup/ui-common@0.2.0-alpha.21.pr-175-20261124104310-005114e87
pnpm add -D @lablup/ui-common-cli@0.2.0-alpha.21.pr-175-20261124104310-005114e87

In backend.ai-webui: pnpm run ui-common:pin pr-175. A consumer PR pinned to a preview cannot merge; repin to canary after this PR merges.

This branch was successfully deployed

1 active deployment
release — 005114e8 Deployed Nov 24, 2026 by lablup-quill[bot] via npmjs #202
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.

Show full value tooltip when a single-select Selector trigger is truncated

0 participants