Skip to content

fix(ui): incorrect z-index on tooltip#2628

Open
bastiendmt wants to merge 1 commit intonpmx-dev:mainfrom
bastiendmt:fix/z-index
Open

fix(ui): incorrect z-index on tooltip#2628
bastiendmt wants to merge 1 commit intonpmx-dev:mainfrom
bastiendmt:fix/z-index

Conversation

@bastiendmt
Copy link
Copy Markdown

🔗 Linked issue

🧭 Context

Z-index on tooltip is above header. This is especially strange on mobile since the tooltip stay active.

📚 Description

I've updated the tooltip z-index as well as the header so it stays behind.

Before

ScreenRecording_04-25-2026.22-20-03_1.MP4

After

Screen.Recording.2026-04-25.at.22.26.09.mov

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 27, 2026 7:16am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 27, 2026 7:16am
npmx-lunaria Ignored Ignored Apr 27, 2026 7:16am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4d1e9497-a047-4839-850e-74edf9f5a6e4

📥 Commits

Reviewing files that changed from the base of the PR and between 144f0b9 and f300c35.

📒 Files selected for processing (2)
  • app/components/Package/Header.vue
  • app/components/Tooltip/Base.vue
✅ Files skipped from review due to trivial changes (2)
  • app/components/Package/Header.vue
  • app/components/Tooltip/Base.vue

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Corrected the visual stacking order of sticky interface elements and tooltips to ensure they display properly relative to other page components.

Walkthrough

Two Vue components had their Tailwind z-index utilities adjusted. The Package Header's sticky subheader changed from z-10 to z-50, while the Tooltip Base container changed from z-[100] to z-[40], altering their stacking order relative to other positioned elements.

Changes

Cohort / File(s) Summary
Sticky Header Z-Index
app/components/Package/Header.vue
Changed sticky package subheader z-index from z-10 to z-50 to modify its layering relative to other positioned elements.
Tooltip Z-Index
app/components/Tooltip/Base.vue
Changed tooltip container z-index from z-[100] to z-[40] to adjust its stacking order relative to other positioned elements.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: fixing an incorrect z-index on the tooltip component, which is the primary focus of this PR.
Description check ✅ Passed The description is directly related to the changeset, providing context about the z-index layering issue between tooltip and header, and confirming the changes made to both components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

Hello! Thank you for opening your first PR to npmx, @bastiendmt! 🚀

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any issues you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Vercel

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/components/Package/Header.vue (1)

238-238: Loading placeholder Package/Skeleton.vue still uses z-10 — keep it in sync with the new z-50.

app/components/Package/Skeleton.vue:22 mirrors this sticky subheader (sticky top-14 z-10 border-b border-border pt-2) but was not updated. As a result, during loading the placeholder will sit behind any element in the z-10..z-49 range (e.g. Package/ActionBar.vue at z-36), and then jump to z-50 once the real header mounts. Aligning Skeleton to z-50 keeps the layering consistent across the loading→loaded transition.

♻️ Suggested change in app/components/Package/Skeleton.vue
-<div class="w-full bg-bg sticky top-14 z-10 border-b border-border pt-2">
+<div class="w-full bg-bg sticky top-14 z-50 border-b border-border pt-2">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/Package/Header.vue` at line 238, The loading skeleton in
Package/Skeleton.vue still uses the old z-10 value causing a z-index jump;
update the sticky subheader class in Package/Skeleton.vue (the element with
"sticky top-14 z-10 border-b border-border pt-2" / the skeleton's subheader) to
use z-50 so it matches the real header's class ("w-full bg-bg sticky top-14 z-50
border-b border-border pt-2") and keeps layering consistent during the
loading→loaded transition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/components/Tooltip/Base.vue`:
- Line 61: The tooltip's z-index was lowered to z-[50], causing it to share
stacking with other overlays; change the class in Base.vue that currently
contains "z-[50]" to "z-[100]" (i.e., update the class string on the tooltip
root in Base.vue to use z-[100] instead of z-[50]) so the tooltip explicitly
stacks above z-50 elements but remains below high-priority overlays like
LogoContextMenu (z-[999]); after the change, manually test mobile cases noted in
the review (tooltips from Playgrounds, ReadmeTocDropdown, and sticky
Package/Header) to confirm correct stacking.

---

Nitpick comments:
In `@app/components/Package/Header.vue`:
- Line 238: The loading skeleton in Package/Skeleton.vue still uses the old z-10
value causing a z-index jump; update the sticky subheader class in
Package/Skeleton.vue (the element with "sticky top-14 z-10 border-b
border-border pt-2" / the skeleton's subheader) to use z-50 so it matches the
real header's class ("w-full bg-bg sticky top-14 z-50 border-b border-border
pt-2") and keeps layering consistent during the loading→loaded transition.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 937d121b-f255-4151-886b-280a3daee210

📥 Commits

Reviewing files that changed from the base of the PR and between ebcfc01 and 144f0b9.

📒 Files selected for processing (2)
  • app/components/Package/Header.vue
  • app/components/Tooltip/Base.vue

Comment thread app/components/Tooltip/Base.vue Outdated
v-if="props.isVisible"
ref="tooltipRef"
class="px-2 py-1 font-mono text-xs text-fg bg-bg-elevated border border-border rounded shadow-lg whitespace-pre-line break-words max-w-xs z-[100]"
class="px-2 py-1 font-mono text-xs text-fg bg-bg-elevated border border-border rounded shadow-lg whitespace-pre-line break-words max-w-xs z-[50]"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# First, let's look at the tooltip component to verify the z-index and teleportation
echo "=== Checking Tooltip/Base.vue structure ==="
cat -n app/components/Tooltip/Base.vue | head -70

Repository: npmx-dev/npmx.dev

Length of output: 2995


🏁 Script executed:

#!/bin/bash

# Search for z-index values in the mentioned components
echo "=== Searching for z-index values in mentioned components ==="

# Package/Header.vue
echo -e "\n--- Package/Header.vue z-index ---"
rg "z-\[" app/components/Package/Header.vue

# VersionSelector.vue
echo -e "\n--- VersionSelector.vue z-index ---"
rg "z-\[" app/components/VersionSelector.vue

# ReadmeTocDropdown.vue (or similar)
echo -e "\n--- ReadmeTocDropdown z-index ---"
fd -e vue -e ts | xargs rg -l "ReadmeTocDropdown" | head -5
rg "z-\[" $(fd -e vue -e ts | xargs rg -l "ReadmeTocDropdown" 2>/dev/null | head -1)

# Playgrounds component
echo -e "\n--- Playgrounds z-index ---"
rg "z-\[" app/components/Package/Playgrounds.vue

# LogoContextMenu
echo -e "\n--- LogoContextMenu z-index ---"
rg "z-\[" $(fd -e vue -e ts | xargs rg -l "LogoContextMenu" 2>/dev/null | head -1)

Repository: npmx-dev/npmx.dev

Length of output: 352


🏁 Script executed:

#!/bin/bash

# Verify teleportation in Tooltip/Base.vue
echo "=== Checking for teleport in Tooltip/Base.vue ==="
rg -A 5 -B 5 "teleport" app/components/Tooltip/Base.vue

Repository: npmx-dev/npmx.dev

Length of output: 610


🏁 Script executed:

#!/bin/bash

# Get more complete view of Tooltip/Base.vue to understand the structure
echo "=== Complete Tooltip/Base.vue (first 100 lines) ==="
head -100 app/components/Tooltip/Base.vue

Repository: npmx-dev/npmx.dev

Length of output: 2525


🏁 Script executed:

#!/bin/bash

# Search for the components mentioned, not just z-[
echo "=== Finding mentioned components ==="

echo -e "\n--- LogoContextMenu ---"
fd -e vue -e ts | xargs rg -l "LogoContextMenu"

echo -e "\n--- Header.vue or subheader references ---"
fd -i "header.vue" app/components/

echo -e "\n--- All z-index usage (broader search) ==="
rg "z-\[" app/components/ --type vue -l | head -20

Repository: npmx-dev/npmx.dev

Length of output: 461


🏁 Script executed:

#!/bin/bash

# Check git history to see if the change was z-[100] to z-[50]
echo "=== Git history for Tooltip/Base.vue ==="
git log --oneline -20 -- app/components/Tooltip/Base.vue

# Show the actual diff for recent changes
echo -e "\n=== Recent changes to Tooltip/Base.vue ==="
git log -p -5 -- app/components/Tooltip/Base.vue | head -150

Repository: npmx-dev/npmx.dev

Length of output: 186


🏁 Script executed:

#!/bin/bash

# Search for any z-[100] or z-[999] in the codebase
echo "=== Searching for z-[100] (cited old value) ==="
rg "z-\[100\]" app/

echo -e "\n=== Searching for z-\[999\] (LogoContextMenu cited value) ==="
rg "z-\[999\]" app/

Repository: npmx-dev/npmx.dev

Length of output: 526


🏁 Script executed:

#!/bin/bash

# Get the actual git diff for the tooltip change
echo "=== Git diff for the tooltip z-index fix ==="
git show 144f0b9:app/components/Tooltip/Base.vue | grep -A 2 -B 2 "z-\[" || echo "File may not exist in that commit"

git show HEAD:app/components/Tooltip/Base.vue | grep -A 2 -B 2 "z-\[" || echo "Current version"

# Check the commit details
echo -e "\n=== Commit details ==="
git show 144f0b9 --stat

Repository: npmx-dev/npmx.dev

Length of output: 50373


🏁 Script executed:

#!/bin/bash

# Search for z-index in all the mentioned components more broadly
echo "=== Searching z-index in Header components ==="
rg -i "z-\[" app/components/Package/Header.vue
rg -i "z-\[" app/components/AppHeader.vue

echo -e "\n=== Searching z-index in VersionSelector ==="
rg -i "z-\[" app/components/VersionSelector.vue

echo -e "\n=== Searching z-index in Playgrounds ==="
rg -i "z-\[" app/components/Package/Playgrounds.vue

echo -e "\n=== Searching z-index in ReadmeTocDropdown ==="
fd -i "readmetoc" app/components/
rg -i "z-\[" app/components/ReadmeTocDropdown.vue 2>/dev/null || echo "Component not found or no z-index"
</parameter>

Repository: npmx-dev/npmx.dev

Length of output: 441


🏁 Script executed:

#!/bin/bash

# Look at LogoContextMenu to understand what it is
echo "=== LogoContextMenu.vue content ==="
head -80 app/components/LogoContextMenu.vue

Repository: npmx-dev/npmx.dev

Length of output: 2112


🏁 Script executed:

#!/bin/bash

# Search for all z-index values to get a complete picture
echo "=== All z-index values in app/components ==="
grep -r "z-\[" app/components/ --include="*.vue" | cut -d: -f2 | sort | uniq

Repository: npmx-dev/npmx.dev

Length of output: 537


🏁 Script executed:

#!/bin/bash

# Search more broadly for these components - maybe they're styled differently
echo "=== Detailed search for mentioned components ==="

echo "--- Package/Header.vue (first 50 lines for structure) ---"
head -50 app/components/Package/Header.vue | cat -n

echo -e "\n--- VersionSelector.vue (searching for class attributes) ---"
rg "class=" app/components/VersionSelector.vue | head -10

echo -e "\n--- ReadmeTocDropdown.vue (complete file, it's important) ---"
wc -l app/components/ReadmeTocDropdown.vue
head -80 app/components/ReadmeTocDropdown.vue | cat -n

Repository: npmx-dev/npmx.dev

Length of output: 5767


🏁 Script executed:

#!/bin/bash

# Maybe z-index is set via inline styles or computed properties
echo "=== Searching for computed styles or inline z-index ==="
rg -i "style.*z|z.*index" app/components/Package/Header.vue
rg -i "style.*z|z.*index" app/components/VersionSelector.vue
rg -i "style.*z|z.*index" app/components/ReadmeTocDropdown.vue
rg -i "style.*z|z.*index" app/components/Package/Playgrounds.vue

echo -e "\n=== Alternative: z-index in JavaScript ==="
rg "zIndex|z-index" app/components/Package/ --type vue

Repository: npmx-dev/npmx.dev

Length of output: 207


🏁 Script executed:

#!/bin/bash

# Let me check the complete ReadmeTocDropdown and look for position/z-index anywhere
echo "=== Checking ReadmeTocDropdown.vue for all styling ==="
grep -n "z-\|position:\|style=" app/components/ReadmeTocDropdown.vue | head -20

echo -e "\n=== Checking Package/Playgrounds.vue for structure and z-index ==="
head -100 app/components/Package/Playgrounds.vue | cat -n | grep -i "z-\|position\|style\|class"

Repository: npmx-dev/npmx.dev

Length of output: 440


🏁 Script executed:

#!/bin/bash

# Look at the template section of ReadmeTocDropdown more carefully
echo "=== ReadmeTocDropdown.vue template section (lines 150-271) ==="
tail -n +150 app/components/ReadmeTocDropdown.vue | cat -n

Repository: npmx-dev/npmx.dev

Length of output: 5178


🏁 Script executed:

#!/bin/bash

# Check if there's a Portal/Teleport in ReadmeTocDropdown 
echo "=== Checking for Teleport/Portal in ReadmeTocDropdown ==="
grep -i "teleport\|portal" app/components/ReadmeTocDropdown.vue

Repository: npmx-dev/npmx.dev

Length of output: 156


🏁 Script executed:

#!/bin/bash

# Check complete Playgrounds.vue for z-index
echo "=== Package/Playgrounds.vue z-index search ==="
grep -n "z-\|fixed\|absolute\|sticky" app/components/Package/Playgrounds.vue | head -20

# Check the dropdown/menu part specifically
echo -e "\n=== Playgrounds.vue dropdown structure ==="
grep -A 10 -B 5 "dropdown\|menu\|Teleport" app/components/Package/Playgrounds.vue | head -40

Repository: npmx-dev/npmx.dev

Length of output: 1357


🏁 Script executed:

#!/bin/bash

# Check Header.vue more thoroughly for z-index on any sticky elements
echo "=== Package/Header.vue - checking for sticky/positioning and z-index ==="
grep -n "sticky\|z-\|fixed\|absolute" app/components/Package/Header.vue

# Check the template section for any child elements with z-index
echo -e "\n=== Package/Header.vue template (lines 200+) ==="
tail -n +200 app/components/Package/Header.vue | head -100 | cat -n

Repository: npmx-dev/npmx.dev

Length of output: 4946


🏁 Script executed:

#!/bin/bash

# Check VersionSelector for positioning and z-index more thoroughly
echo "=== VersionSelector.vue complete z-index/positioning check ==="
wc -l app/components/VersionSelector.vue
grep -n "z-\|fixed\|absolute\|sticky\|Teleport\|dropdown" app/components/VersionSelector.vue | head -30

Repository: npmx-dev/npmx.dev

Length of output: 695


🏁 Script executed:

#!/bin/bash

# Final verification - check if there's any evidence of the prior z-[100] value
echo "=== Searching for any remaining z-[100] in the codebase ==="
rg "z-\[100\]" app/

echo -e "\n=== Git diff to see what changed (if anything) ==="
git show 144f0b9 --no-patch --format="%B"

Repository: npmx-dev/npmx.dev

Length of output: 352


Tooltip now shares z-50 with several other floating UI elements—stacking is determined by DOM order.

Lowering the tooltip from z-[100] to z-[50] places it at the same stacking level as Package/Header.vue (sticky subheader, z-50), VersionSelector.vue dropdown (z-50, absolute), ReadmeTocDropdown.vue (z-50, fixed, teleported to body), and Package/Playgrounds.vue menu (z-50, absolute). Since the tooltip is teleported to body, it renders after these elements in the DOM and will continue to paint above them—which is the intended behaviour—but stacking is now implicit (DOM order) rather than explicit (z-index).

Higher-priority overlays such as LogoContextMenu.vue (z-[999]) remain correctly above the tooltip.

Recommend manual testing on mobile for:

  • Tooltips opened from triggers inside the Playgrounds menu and ReadmeTocDropdown to confirm they still render above their host menus.
  • Tooltips from triggers in the sticky Package/Header.vue to confirm the header overlap bug is resolved.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/Tooltip/Base.vue` at line 61, The tooltip's z-index was
lowered to z-[50], causing it to share stacking with other overlays; change the
class in Base.vue that currently contains "z-[50]" to "z-[100]" (i.e., update
the class string on the tooltip root in Base.vue to use z-[100] instead of
z-[50]) so the tooltip explicitly stacks above z-50 elements but remains below
high-priority overlays like LogoContextMenu (z-[999]); after the change,
manually test mobile cases noted in the review (tooltips from Playgrounds,
ReadmeTocDropdown, and sticky Package/Header) to confirm correct stacking.

@ghostdevv ghostdevv changed the title fix(tooltip): incorrect z-index fix(ui): incorrect z-index on tooltip Apr 26, 2026
Copy link
Copy Markdown
Contributor

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

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

could you take a look at the code rabbit comment?

@bastiendmt
Copy link
Copy Markdown
Author

could you take a look at the code rabbit comment?

I've updated it to 40 👍

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.

2 participants