From 6220238068c446a97d1726697601f7ba5e126028 Mon Sep 17 00:00:00 2001 From: tgiachi Date: Tue, 17 Nov 2026 10:02:30 +0100 Subject: [PATCH 1/2] fix(web): make the seek bar fit the width of a phone The shape of the track has 120 thin bars. With a 2px gap and a 1px minimum width each they need 358px, so on a phone the bar ran past the right edge of the full-screen player, the page scrolled sideways and the play button was off centre. The bars now have no minimum width and a 1px gap on a phone; wide screens keep the 2px gap. Fixes #45 --- web/src/components/Scrubber.test.tsx | 9 +++++++++ web/src/components/Scrubber.tsx | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/web/src/components/Scrubber.test.tsx b/web/src/components/Scrubber.test.tsx index d6ce82c..5a1f9a0 100644 --- a/web/src/components/Scrubber.test.tsx +++ b/web/src/components/Scrubber.test.tsx @@ -49,3 +49,12 @@ test('it is still a slider that is moved with the keyboard and says where it is fireEvent.change(slider, { target: { value: '1000' } }) expect(onSeek).toHaveBeenCalledWith(1000) }) + +test('the bars give way to the width of the screen: no minimum width, and a thin gap on a phone', () => { + const peaks = Array.from({ length: 120 }, () => 128) + const { container } = render( {}} size="big" peaks={peaks} />) + // 120 bars with a gap of 2px and 1px each would need 358px, more than a phone has. + const row = bars(container)[0].parentElement! + expect(row).toHaveClass('gap-px', 'sm:gap-[2px]') + for (const b of bars(container)) expect(b).toHaveClass('min-w-0') +}) diff --git a/web/src/components/Scrubber.tsx b/web/src/components/Scrubber.tsx index 7555443..34dcb68 100644 --- a/web/src/components/Scrubber.tsx +++ b/web/src/components/Scrubber.tsx @@ -35,7 +35,7 @@ export default function Scrubber({ positionMs, durationMs, onSeek, size, peaks, return (
@@ -48,7 +48,7 @@ export default function Scrubber({ positionMs, durationMs, onSeek, size, peaks, data-bar aria-hidden="true" style={{ height: `${height}%` }} - className={cn('min-w-px flex-1 rounded-[2px]', heard ? (friend ? 'bg-friend' : 'bg-primary') : 'bg-input')} + className={cn('min-w-0 flex-1 rounded-[2px]', heard ? (friend ? 'bg-friend' : 'bg-primary') : 'bg-input')} /> ) })} From f6a3cd6b5ed751e0b881fa1a20cc8d34ce0c3635 Mon Sep 17 00:00:00 2001 From: sonda-release Date: Tue, 17 Nov 2026 09:03:27 +0000 Subject: [PATCH 2/2] chore(release): 0.4.2 [skip ci] ## [0.4.2](https://git.kmalloc.org/squid/sonda/compare/v0.4.1...v0.4.2) (2026-11-17) ### Bug fixes * **web:** make the seek bar fit the width of a phone ([6220238](https://git.kmalloc.org/squid/sonda/commit/6220238068c446a97d1726697601f7ba5e126028)), closes [#45](https://git.kmalloc.org/squid/sonda/issues/45) --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76c2a47..5257286 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.4.2](https://git.kmalloc.org/squid/sonda/compare/v0.4.1...v0.4.2) (2026-11-17) + +### Bug fixes + +* **web:** make the seek bar fit the width of a phone ([6220238](https://git.kmalloc.org/squid/sonda/commit/6220238068c446a97d1726697601f7ba5e126028)), closes [#45](https://git.kmalloc.org/squid/sonda/issues/45) + ## [0.4.1](https://git.kmalloc.org/squid/sonda/compare/v0.4.0...v0.4.1) (2026-11-17) ### Bug fixes