- {/* The chips scroll inside their own flexible box on narrow viewports
- or large system font scales; without it this row was the widest
- thing on the page and dragged the fixed bars off-screen under
- Android's forced zoom. min-w-max keeps the pill track wrapping
- its chips instead of getting squeezed to the box. */}
-
+ {/* The chips scroll inside their own box on narrow viewports or large
+ system font scales; without it this row was the widest thing on
+ the page and dragged the fixed bars off-screen under Android's
+ forced zoom. min-w-max keeps the pill track wrapping its chips,
+ and the box stays content-wide (no flex-1) so the pill still hugs
+ them on wide phones while ml-auto parks the icons on the right. */}
+
value={tripFilter}
onChange={setTripFilter}
@@ -150,7 +151,7 @@ export default function MDashboard(): React.ReactElement {
]}
/>
-
setSubOpen(true)}>
+ setSubOpen(true)}>
{
expect(container.firstElementChild!.className).not.toContain('h-dvh')
})
+ it('FE-MOB-COLSCR-019d: the open list switcher scrolls instead of hiding its last entries behind the dock (#2104)', () => {
+ mocks.coll = makeHook({ view: 'map' })
+ render( )
+
+ fireEvent.click(switcher())
+ // In the viewport-high map column the panel is the only item that can give
+ // way, so it has to cap and scroll itself to keep "new list" reachable.
+ const panel = screen.getByRole('button', { name: /collections.newList/ }).parentElement!
+ expect(panel.className).toContain('overflow-y-auto')
+ expect(panel.className).toContain('min-h-0')
+ expect(panel.className).toMatch(/max-h-\[/)
+ })
+
it('FE-MOB-COLSCR-020: a map view with nothing mappable falls back to the empty note', () => {
mocks.coll = makeHook({ view: 'map', mappable: [] })
render( )
diff --git a/client/tests/unit/mobile/dashboard/MDashboard.test.tsx b/client/tests/unit/mobile/dashboard/MDashboard.test.tsx
index 267f1d4d2..fd421a87a 100644
--- a/client/tests/unit/mobile/dashboard/MDashboard.test.tsx
+++ b/client/tests/unit/mobile/dashboard/MDashboard.test.tsx
@@ -552,6 +552,17 @@ describe('MDashboard', () => {
const wrapper = track.parentElement as HTMLElement;
expect(wrapper.className).toContain('m-hscroll');
expect(wrapper.className).toContain('min-w-0');
- expect(wrapper.className).toContain('flex-1');
+ });
+
+ it('FE-MOB-DASH-039: the filter pill hugs its chips instead of filling the row', async () => {
+ render( );
+
+ // flex-1 on the scroll box stretched the grey pill track all the way to the
+ // calendar icon on phones from ~400px up; the icons ride on ml-auto instead.
+ const chip = await screen.findByText('dashboard.filter.planned');
+ const wrapper = chip.closest('button')!.parentElement!.parentElement as HTMLElement;
+ expect(wrapper.className).not.toContain('flex-1');
+ expect(screen.getByRole('button', { name: 'dashboard.subscribeAllTrips' }).className)
+ .toContain('ml-auto');
});
});