feat(places): Places replaces Collections, with All places, place sheets and a calmer list

- Collections is Places now: /places opens "All places", every place of the
  trips and lists with where it comes from, the same filter row (where from,
  status, category, order), map bar (search, lock, list toggle) and place sheet
  as a list; /places/saved and /places/:id are the lists, and the old
  /collections links still land there. On the phone the same, with its own
  sheet. A place sheet shows each trip (planned day or trip dates, stay,
  booking, notes) and each list (status, labels, rating, notes) as one row
  that opens it.
- The rail: a calm "New list" with its plus tile, All places and All saved as
  views, a "My lists" heading, every name on one edge. Lists can carry one of
  24 symbols, shown in their colour in the rail and the editor.
- A saved place's row keeps to two lines: its category as an icon before the
  name, its average vote as a star on the picture. Map pins wear the same star.
- The place forms put the category in front of the name as a tile that opens
  the category list, instead of a row of chips.
- All saved gets a subtitle; the import dialog opens centred.
- Fixes: a pasted coordinate pair splits from either field of the place form;
  "more" in All places frees itself when a filter changes mid-load; place
  names on the trip map and the rating badge follow the reading direction.
This commit is contained in:
Maurice
2026-11-29 15:49:35 +01:00
parent 0ecca2b46c
commit 01d327b502
179 changed files with 6206 additions and 541 deletions
@@ -50,7 +50,7 @@ describe('AssistantAskButton', () => {
expect(screen.queryByRole('button')).not.toBeInTheDocument();
unmount();
renderAt('/collections/3');
renderAt('/places/3');
expect(screen.queryByRole('button')).not.toBeInTheDocument();
});
});
@@ -54,7 +54,7 @@ describe('collection answer cards', () => {
expect(within(card).getByText('Idea')).toBeInTheDocument();
expect(within(card).getByText('3')).toBeInTheDocument();
fireEvent.click(within(card).getByRole('button', { name: /Open list/ }));
expect(view.onOpen).toHaveBeenCalledWith({ kind: 'page', path: '/collections/12' });
expect(view.onOpen).toHaveBeenCalledWith({ kind: 'page', path: '/places/12' });
});
it('FE-AI-COLL-040: the places to revisit have a pill of their own in the head, in the visited tone (#2567)', () => {
@@ -86,7 +86,7 @@ describe('collection answer cards', () => {
expect(screen.getByText('Spot 4')).toBeInTheDocument();
expect(screen.queryByText('Spot 5')).toBeNull();
fireEvent.click(screen.getByRole('button', { name: '7 more in this list' }));
expect(view.onOpen).toHaveBeenCalledWith({ kind: 'page', path: '/collections/12' });
expect(view.onOpen).toHaveBeenCalledWith({ kind: 'page', path: '/places/12' });
});
it('FE-AI-COLL-013: a roomy chat shows eight rows', () => {
@@ -144,7 +144,7 @@ describe('collection answer cards', () => {
expect(screen.queryByText('Paris food')).toBeNull();
expect(screen.getByText('Invite from Maya')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: /Rome/ }));
expect(view.onOpen).toHaveBeenCalledWith({ kind: 'page', path: '/collections/40' });
expect(view.onOpen).toHaveBeenCalledWith({ kind: 'page', path: '/places/40' });
});
it('FE-AI-COLL-018: where a place is saved reads as its lists with its status in each', () => {
@@ -94,7 +94,7 @@ describe('collection change cards', () => {
const view = draw([applied(pending('save_place_to_collection', 'Septime', card), 'collection_place', [77])]);
expect(screen.queryByRole('button', { name: 'Show on map' })).toBeNull();
fireEvent.click(screen.getByRole('button', { name: 'Open in Collections' }));
expect(view.onOpen).toHaveBeenCalledWith({ kind: 'page', path: '/collections/12?place=77' });
expect(view.onOpen).toHaveBeenCalledWith({ kind: 'page', path: '/places/12?place=77' });
});
it('FE-AI-COLL-023: a save the place matched already says where it is saved', () => {
@@ -8,6 +8,7 @@ import type {
TrekCard,
} from '@trek/shared';
import { placesPath } from '../../../../utils/placesRoutes';
import type { EntityTarget } from '../cardTypes';
/**
@@ -26,12 +27,12 @@ export const MAX_FACTS = 4;
/** Where a list opens in Collections. */
export function listTarget(listId: number | null): EntityTarget {
return { kind: 'page', path: listId === null ? '/collections' : `/collections/${listId}` };
return { kind: 'page', path: placesPath(listId === null ? 'saved' : listId) };
}
/** Where a saved place opens: its list, with the place selected. */
function placeTarget(listId: number, placeId: number | null): EntityTarget {
const path = `/collections/${listId}`;
const path = placesPath(listId);
return { kind: 'page', path: placeId === null ? path : `${path}?place=${placeId}` };
}
@@ -62,9 +62,9 @@ describe('collection look', () => {
it('FE-AI-COLL-002: an applied list opens in Collections, unless the change deleted it or declined its invite', () => {
const look = ENTITY_LOOK.collection;
expect(look.openLabelKey).toBe('assistant.card.collection.openList');
expect(look.open?.(applied('collection', [12]), null)).toEqual({ kind: 'page', path: '/collections/12' });
expect(look.open?.(applied('collection', [12]), null)).toEqual({ kind: 'page', path: '/places/12' });
const card = listsCard({ lists: [listRow({ id: 13 })] });
expect(look.open?.(applied('collection', []), card)).toEqual({ kind: 'page', path: '/collections/13' });
expect(look.open?.(applied('collection', []), card)).toEqual({ kind: 'page', path: '/places/13' });
for (const change of ['remove', 'decline'] as const) {
expect(look.open?.(applied('collection', [12]), listsCard({ lists: [listRow({ change })] }))).toBeNull();
}
@@ -76,10 +76,10 @@ describe('collection look', () => {
const card = placesCard();
expect(look.open?.(applied('collection_place', [34]), card)).toEqual({
kind: 'page',
path: '/collections/12?place=34',
path: '/places/12?place=34',
});
const removed = placesCard({ places: [savedPlace({ delta: emptyDelta({ removed: true }) })] });
expect(look.open?.(applied('collection_place', [34]), removed)).toEqual({ kind: 'page', path: '/collections/12' });
expect(look.open?.(applied('collection_place', [34]), removed)).toEqual({ kind: 'page', path: '/places/12' });
expect(look.open?.(applied('collection_place', [34]), null)).toBeNull();
});