fix: proper z-index stacking and viewport-aware positioning for likers tooltip (#484)

z-index fix:
- remove static z-index from .likes element
- only apply z-index: 10 when tooltip is open (.likes.tooltip-open)
- this ensures the active tooltip's parent elevates above sibling tracks
without all tracks competing at the same z-index level

flip detection:
- detect when likes element is <300px from viewport top
- flip tooltip to appear below instead of above
- prevents tooltip from colliding with sticky header

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>

authored by zzstoatzz.io Claude and committed by GitHub d0d2b151 98cbb1a3

Changed files
+33 -1
frontend
+26
frontend/src/lib/components/LikersTooltip.svelte
··· 22 22 let likers = $state<Liker[]>([]); 23 23 let loading = $state(true); // start as loading 24 24 let error = $state<string | null>(null); 25 + let tooltipElement: HTMLDivElement | null = $state(null); 26 + let positionBelow = $state(false); 27 + 28 + // check if tooltip should flip below based on viewport position 29 + $effect(() => { 30 + if (!tooltipElement) return; 31 + 32 + // get the parent element's position (the .likes span) 33 + const parent = tooltipElement.parentElement; 34 + if (!parent) return; 35 + 36 + const parentRect = parent.getBoundingClientRect(); 37 + // if less than 300px from viewport top, flip tooltip below 38 + // 300px accounts for tooltip max height (~240px) plus padding 39 + positionBelow = parentRect.top < 300; 40 + }); 25 41 26 42 $effect(() => { 27 43 if (likeCount === 0) { ··· 68 84 </script> 69 85 70 86 <div 87 + bind:this={tooltipElement} 71 88 class="likers-tooltip" 89 + class:position-below={positionBelow} 72 90 role="tooltip" 73 91 onmouseenter={onMouseEnter} 74 92 onmouseleave={onMouseLeave} ··· 122 140 box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); 123 141 z-index: 1000; 124 142 pointer-events: auto; 143 + } 144 + 145 + /* flip tooltip below when near viewport top */ 146 + .likers-tooltip.position-below { 147 + bottom: auto; 148 + top: 100%; 149 + margin-bottom: 0; 150 + margin-top: 0.5rem; 125 151 } 126 152 127 153 .loading,
+7 -1
frontend/src/lib/components/TrackItem.svelte
··· 224 224 <span class="meta-separator">•</span> 225 225 <span 226 226 class="likes" 227 + class:tooltip-open={showLikersTooltip} 227 228 role="button" 228 229 tabindex="0" 229 230 aria-label={`${likeCount} ${likeCount === 1 ? 'like' : 'likes'} (focus to view users)`} ··· 616 617 position: relative; 617 618 cursor: help; 618 619 transition: color 0.2s; 619 - z-index: 100; 620 + } 621 + 622 + /* only elevate z-index when tooltip is open - this ensures the open tooltip 623 + renders above sibling track items without all tracks competing for z-index */ 624 + .likes.tooltip-open { 625 + z-index: 10; 620 626 } 621 627 622 628 .likes:hover {