Skip to content

fix(test-activity): prevent tooltip overflow on small viewports (@Mubashir21)#7821

Open
Mubashir21 wants to merge 1 commit intomonkeytypegame:masterfrom
Mubashir21:fix/test-activity-tooltip-overflow
Open

fix(test-activity): prevent tooltip overflow on small viewports (@Mubashir21)#7821
Mubashir21 wants to merge 1 commit intomonkeytypegame:masterfrom
Mubashir21:fix/test-activity-tooltip-overflow

Conversation

@Mubashir21
Copy link
Copy Markdown

@Mubashir21 Mubashir21 commented Apr 12, 2026

Description

Bug: On small/mobile viewports, the activity calendar tooltips near the left and right edges get clipped by the viewport boundary because the tooltip position was hardcoded to "up" for every cell.

Fix: After the cells are rendered, I measure the actual tooltip width using a hidden probe element with the same font styles as the balloon tooltip. For each cell, I use getBoundingClientRect() to check if the tooltip would overflow the left or right edge of the viewport. If it would, the position is switched to "up-left" or "up-right" accordingly. A ResizeObserver on the container recalculates positions on every resize, so it works correctly at any viewport width.

Steps to reproduce: Go to /account, shrink the browser window to mobile width, hover over cells on the left or right edge of the activity calendar: the tooltip gets cut off.

Checks

  • Check if any open issues are related to this PR; if so, be sure to tag them below.
  • Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info)
  • Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title.
image image

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants