Skip to content

fix(library): hoist track row above siblings while + popover is open#74

Merged
InstaZDLL merged 1 commit into
mainfrom
fix/add-to-playlist-popover-stacking
May 20, 2026
Merged

fix(library): hoist track row above siblings while + popover is open#74
InstaZDLL merged 1 commit into
mainfrom
fix/add-to-playlist-popover-stacking

Conversation

@InstaZDLL
Copy link
Copy Markdown
Owner

@InstaZDLL InstaZDLL commented May 20, 2026

Summary

  • Fixes bug: Regolar Playlist adding song from "Songs" screen with + small popup window ,do not work #72 — the small "Add to a playlist" popover that opens from the + button on a track row in the Songs view appeared semi-transparent and didn't accept clicks.
  • Root cause: every virtualized row in TrackTable is position: absolute without a z-index. The popover's own z-50 is scoped to its row's stacking context, so it could not climb above sibling rows rendered later in DOM order. Those rows painted on top of the popover, which simultaneously made it look transparent (the underlying row's duration / heart leaking through) and stole every click on a menu item.
  • Fix: bump the owning row's z-index to 20 while its popover is open, so it stacks above every following row.

Test plan

  • Open Songs view → hover a track row that isn't the last one → click the + button: popover is fully opaque, no duration/heart from rows below leaking through.
  • Click a playlist in the popover: the track is added (no longer silently absorbed by the row underneath).
  • Click "New playlist": modal opens with the track pre-staged.
  • Close + re-open on different rows (first, middle, last visible): no regression.

Summary by CodeRabbit

  • Corrections de bugs
    • Correction de l'affichage du menu "Ajouter à la playlist" dans la vue des pistes pour qu'il s'affiche correctement au-dessus des autres éléments.

Review Change Stack

Each virtualized row is `position: absolute` without a z-index, so the
"Add to a playlist" popover's `z-50` couldn't escape its own row's
stacking context. Sibling rows rendered after it in DOM order painted
on top, making the popover look transparent (showing the duration /
heart of underlying rows) and swallowing every click on the menu items.

Bump the row's z-index while its popover is open so it stacks above the
following rows.

Closes #72
@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented May 20, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

Cette pull request corrige un problème d'ordre d'empilage visuel dans la table des morceaux. Un zIndex conditionnel est ajouté à la ligne virtualisée pour que le popover « Ajouter à la playlist » reste visible et cliquable au-dessus des lignes rendues après, résolvant le bug où le popover était masqué ou inaccessible.

Changes

Affichage du popover « Ajouter à la playlist »

Layer / File(s) Résumé
Correction du z-index du popover
src/components/views/LibraryView.tsx
Ajout d'un zIndex conditionnel (lignes 1086-1092) sur le conteneur de ligne virtualisée. Lorsque le menu popover est ouvert, la ligne est élevée pour que le popover s'affiche correctement au-dessus des autres lignes rendues virtuellement.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🎵 Le popover était emprisonné,
Caché sous les lignes du tableur,
Un simple zIndex l'a libéré,
Maintenant la playlist brille en couleur ! 🎶

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Le titre suit la convention Commits et décrit précisément le changement principal : l'augmentation du z-index pour éviter que le popover soit masqué.
Linked Issues check ✅ Passed Le PR adresse directement le problème signalé en #72 : le popover non fonctionnel du bouton + sur la vue Songs. La solution (augmentation du z-index) corrige exactement la cause identifiée.
Out of Scope Changes check ✅ Passed Le changement est strictement limité à la correction du z-index pour le problème de popover. Les 7 lignes ajoutées sont entièrement alignées avec l'objectif de #72.
Description check ✅ Passed La description couvre correctement le problème (#72), la racine du problème et la solution apportée. Le plan de test est complet et vérifiable.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-to-playlist-popover-stacking

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 github-actions Bot added scope: frontend React/Vite frontend (src/) type: fix Bug fix size: xs < 10 lines labels May 20, 2026
@InstaZDLL InstaZDLL self-assigned this May 20, 2026
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/views/LibraryView.tsx (1)

1546-1567: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Appliquer le même fix aux grilles Albums et Artistes pour résoudre le z-index des popovers.

Les lignes virtualisées dans AlbumGrid (ligne 1557) et ArtistList (ligne 1826) utilisent transform: translateY() sans zIndex, créant des contextes d'empilement qui piègent les popovers « Ajouter à la playlist » rendus à l'intérieur. Ajouter zIndex: isMenuOpen ? 20 : undefined aux styles de chaque ligne virtualisée permet aux popovers d'échapper à ce contexte.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/views/LibraryView.tsx` around lines 1546 - 1567, The
virtualized row container created in the AlbumGrid (the map over
virtualizer.getVirtualItems() that returns the div with transform:
`translateY(${row.start - scrollMargin}px)`) is creating a new stacking context
and trapping popovers; update that div's inline style to include a conditional
zIndex (e.g., zIndex: isMenuOpen ? 20 : undefined) so when a card menu/popover
inside (renderAlbumCard) is open it can escape the stacking context; apply the
same change to the equivalent virtualized row in ArtistList so both Albums and
Artists grids use the conditional zIndex when their item menu is open.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/components/views/LibraryView.tsx`:
- Around line 1546-1567: The virtualized row container created in the AlbumGrid
(the map over virtualizer.getVirtualItems() that returns the div with transform:
`translateY(${row.start - scrollMargin}px)`) is creating a new stacking context
and trapping popovers; update that div's inline style to include a conditional
zIndex (e.g., zIndex: isMenuOpen ? 20 : undefined) so when a card menu/popover
inside (renderAlbumCard) is open it can escape the stacking context; apply the
same change to the equivalent virtualized row in ArtistList so both Albums and
Artists grids use the conditional zIndex when their item menu is open.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2c905966-a675-4d81-bdcd-f71aab3cdc98

📥 Commits

Reviewing files that changed from the base of the PR and between ef2d754 and 03f91e1.

📒 Files selected for processing (1)
  • src/components/views/LibraryView.tsx

@InstaZDLL InstaZDLL merged commit e3be0b9 into main May 20, 2026
14 checks passed
@InstaZDLL InstaZDLL deleted the fix/add-to-playlist-popover-stacking branch May 20, 2026 19:47
InstaZDLL added a commit that referenced this pull request May 20, 2026
…ver is open (#75)

Follow-up to PR #74. Same stacking-context trap as TrackTable: every
virtualized row in AlbumGrid and ArtistList is `position: absolute`
without a z-index, so the `+` popover's `z-50` couldn't escape its row
and the rows rendered after it in DOM order painted on top — same
visual transparency + click-swallowing symptoms.

Bump the row's z-index when one of its cards owns the open popover.
InstaZDLL added a commit that referenced this pull request May 20, 2026
Follow-up to #75. The z-index fix wasn't enough in practice: the
virtualizer rows use `transform: translateY()`, which creates a
stacking context, and the popover's `top-full right-0` resolved to
"below the entire tile" rather than "below the + button". Some
ancestor (likely the page scroller's own transform / will-change set
by tanstack-virtual) was clipping or restacking the popover so the
following row's avatar/cover still bled through.

Switch the popover to a `createPortal(..., document.body)` render
path. Each `+` button registers its DOM node in a `Map<id, HTMLButtonElement>`
ref; the popover takes that node as `anchorEl` and positions itself
via `getBoundingClientRect` + scroll/resize listeners. Now anchored
right under the trigger button (not below the full tile), and lives
at the document root so stacking contexts no longer apply.

TrackTable keeps its current in-flow popover — its z-index fix from
#74 works because the row layout is a single flex line, not a CSS
grid of multiple cards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: frontend React/Vite frontend (src/) size: xs < 10 lines type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Regolar Playlist adding song from "Songs" screen with + small popup window ,do not work

1 participant