fix(ui): shrink-wrap floating player bar instead of full-width strip (#969)

* fix(ui): shrink-wrap floating player bar instead of full-width strip

The bar used fixed left and right insets, which stretched its background
across the whole main column. Center it with max-content width so only
the pill-shaped controls are painted, and soften the drop shadow.

* docs: note PR #969 in changelog and settings credits
This commit is contained in:
cucadmuh
2026-06-04 00:03:24 +03:00
committed by GitHub
parent e8962c21ab
commit c9b2d140d9
7 changed files with 65 additions and 14 deletions
@@ -0,0 +1,19 @@
import { describe, expect, it } from 'vitest';
import { computeFloatingPlayerBarStyle } from './computeFloatingPlayerBarStyle';
describe('computeFloatingPlayerBarStyle', () => {
it('centers in the main column and shrink-wraps instead of stretching', () => {
const style = computeFloatingPlayerBarStyle(220, 1600, 1920);
expect(style.left).toBe(910);
expect(style.right).toBe('auto');
expect(style.transform).toBe('translateX(-50%)');
expect(style.width).toBe('max-content');
expect(style.maxWidth).toBe(1332);
});
it('accounts for a hidden queue panel', () => {
const style = computeFloatingPlayerBarStyle(220, null, 1920);
expect(style.left).toBe(1070);
expect(style.maxWidth).toBe(1652);
});
});