dusk-network / dusk-network/duskit

feat(components): support corner placements in `Tooltip` for better mobile viewport alignment

Open
#303 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Description
Currently, the Tooltip component only supports base placements (top, right, bottom, left). When computing the position with Floating UI, any alignment modifier is explicitly stripped away via placement.replace(/-.+$/, "").

While this simplifies the CSS for the tooltip arrow, it creates significant visual issues on smaller viewports (mobile). Tooltips often appear awkwardly positioned or visually disconnected from their target elements because the arrow cannot point to the corners or specific edges of the trigger.

Proposed Solution
Expand the ValidPlacement type to include aligned variants (e.g., top-start, top-end, bottom-start, bottom-end, etc.) and refactor the component to respect and render these corner placements.

Acceptance Criteria

  • The internal ValidPlacement type and validation logic accept alignment modifiers.
  • The CSS is updated to correctly position the tooltip arrow for all new aligned placements, ensuring it accurately points to the trigger element.
  • The explicit -start / -end stripping logic is removed or adapted from the Floating UI positioning resolution.
  • Tooltips maintain visual connection to their trigger toggles and buttons on mobile viewports.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Tooltip component's ValidPlacement type and the placement.replace(/-.+$/, "") logic described in the issue. Review the existing tooltip arrow CSS and how Floating UI placement is resolved, then verify that aligned placements are accepted and the arrow remains connected to triggers on mobile-sized viewports.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.