Skip to content

fix: replace white scrollbar on artist page with chevron arrow carousel#29

Merged
frank-mendez merged 3 commits into
mainfrom
claude/fix-issue-28-rNDbX
Mar 24, 2026
Merged

fix: replace white scrollbar on artist page with chevron arrow carousel#29
frank-mendez merged 3 commits into
mainfrom
claude/fix-issue-28-rNDbX

Conversation

@frank-mendez

Copy link
Copy Markdown
Owner

Summary

  • Removes the native white scrollbar from the artist albums section
  • Hides the native scrollbar (scrollbarWidth: none) and adds left/right chevron arrow buttons that appear dynamically based on scroll position
  • Matches the carousel pattern already used on the home page (PlaylistCarousel)

Closes #28

Test plan

  • Navigate to an artist page with multiple albums — confirm no white scrollbar is visible
  • Confirm a right chevron arrow appears when there are more albums to the right
  • Click the right arrow to scroll — confirm it scrolls smoothly
  • After scrolling right, confirm a left chevron arrow appears
  • Click the left arrow — confirm it scrolls back
  • All 17 existing ArtistDetail tests pass

https://claude.ai/code/session_015duffePt3aymjzz7T84rEB

Replace the native overflow-x-auto scrollbar on the artist albums
section with a hidden-scrollbar carousel matching the home page pattern.
Left/right chevron arrow buttons appear dynamically based on scroll
position.

Closes #28

https://claude.ai/code/session_015duffePt3aymjzz7T84rEB
Copilot AI review requested due to automatic review settings March 24, 2026 15:49
@vercel

vercel Bot commented Mar 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
react-typescript-spotify Ready Ready Preview, Comment Mar 24, 2026 3:58pm

@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 70.61% (🎯 60%) 2960 / 4192
🔵 Statements 70.61% (🎯 60%) 2960 / 4192
🔵 Functions 65.84% (🎯 60%) 214 / 325
🔵 Branches 80.55% (🎯 60%) 522 / 648
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/features/home/PlaylistCarousel.tsx 100% 90.9% 33.33% 100%
src/components/ui/ScrollArrow.tsx 100% 100% 100% 100%
src/hooks/useCarouselScroll.ts 92.3% 100% 66.66% 92.3% 30-31
src/pages/ArtistDetail.tsx 100% 82.6% 60% 100%
Generated in workflow #59 for commit 57575c9 by the Vitest Coverage Report Action

Move the duplicated ScrollArrow component from PlaylistCarousel and
ArtistDetail into a shared src/components/ui/ScrollArrow.tsx, eliminating
code duplication flagged by SonarQube.

https://claude.ai/code/session_015duffePt3aymjzz7T84rEB

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the Artist detail page’s Albums section to use a chevron-based horizontal carousel (matching the home page pattern) instead of relying on the native horizontal scrollbar.

Changes:

  • Added scroll container ref + scroll/resize listeners to compute when left/right chevrons should appear.
  • Introduced overlay chevron buttons that scroll the albums row smoothly by a fixed increment.
  • Applied inline scrollbar-hiding styles to the albums scroll container.
Comments suppressed due to low confidence (2)

src/pages/ArtistDetail.tsx:129

  • scrollbarWidth: 'none' / msOverflowStyle: 'none' won’t hide the horizontal scrollbar on Chromium/WebKit browsers, so the “white scrollbar” issue will likely persist on Windows Chrome/Edge. Consider adding a CSS class that also targets ::-webkit-scrollbar (e.g., display: none / height: 0) and apply it to this scroll container.
    src/pages/ArtistDetail.tsx:135
  • New carousel behavior (dynamic left/right chevrons + smooth scrolling) isn’t covered by the existing ArtistDetail tests. Since this change is user-visible and stateful (scroll position -> arrow visibility), add tests asserting arrow presence/absence and that clicking the arrows calls scrollBy/updates scroll state.
  );
}

Comment thread src/pages/ArtistDetail.tsx Outdated
Comment on lines 43 to 62
@@ -26,9 +58,6 @@ export default function ArtistDetail() {
);
}

const albums = (albumsData?.items ?? []).slice(0, 10);
const artistImage = artist.images?.[0]?.url;

return (
<div className="flex flex-col min-h-full" data-testid="artist-detail">

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

The useEffect dependency is albums, but albums is created via .slice(0, 10) on every render, so this effect will re-run and rebind scroll/resize listeners on any re-render (including state updates from scrolling). Consider memoizing albums or changing the dependency to something stable (e.g., albumsData?.items or albums.length).

Copilot uses AI. Check for mistakes.
Comment thread src/pages/ArtistDetail.tsx Outdated
Comment on lines 19 to 22
const scrollRef = useRef<HTMLDivElement>(null);
const [canScrollLeft, setCanScrollLeft] = useState(false);
const [canScrollRight, setCanScrollRight] = useState(false);

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

This button should explicitly set type="button" to avoid defaulting to submit if the component ever ends up inside a form.

Copilot uses AI. Check for mistakes.
- Extract scroll state/effect logic into useCarouselScroll hook shared by
  PlaylistCarousel and ArtistDetail, eliminating code duplication
- Fix useEffect dependency to use stable albumsData?.items instead of
  the albums array recreated on every render
- Add type="button" to ScrollArrow button to prevent accidental form submit

https://claude.ai/code/session_015duffePt3aymjzz7T84rEB
@sonarqubecloud

Copy link
Copy Markdown

@frank-mendez frank-mendez merged commit d535aa2 into main Mar 24, 2026
10 checks passed
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.

Fix Artist page Scrollbar

3 participants