feat(collections): "want to revisit" status for saved places (#2567)

A fourth status after visited, for a place already seen that the user wants
to go back to. It joins the one-tap cycle, the filters, the pickers, the
assistant cards and the MCP status tool, and counts as visited wherever
visits are counted (isVisitedCollectionStatus), so "visited everywhere"
keeps it. The status pickers go two by two where four would not fit.
This commit is contained in:
Maurice
2026-11-13 09:28:17 +01:00
parent 73ac4b29ad
commit 72e8b1f8d9
56 changed files with 178 additions and 51 deletions
@@ -108,17 +108,19 @@ describe('useSaveToCollection', () => {
expect(result.current.unvisited).toEqual([]);
});
it('FE-COMP-SAVETOCOLHOOK-004: unvisited leaves out visited and read-only lists', async () => {
it('FE-COMP-SAVETOCOLHOOK-004: unvisited leaves out visited, to-revisit and read-only lists', async () => {
vi.spyOn(collectionsApi, 'membership').mockResolvedValue({
saved: true,
lists: [
{ collection_id: 1, name: 'Favorites', place_id: 900, status: 'visited', can_edit: true },
{ collection_id: 2, name: 'Wishlist', place_id: 901, status: 'idea', can_edit: false },
{ collection_id: 3, name: 'Team', place_id: 902, status: 'want', can_edit: true },
// #2567: a place to revisit was visited already, "visited everywhere" keeps the wish.
{ collection_id: 4, name: 'Again', place_id: 903, status: 'revisit', can_edit: true },
],
});
const { result } = await loaded();
await waitFor(() => expect(result.current.savedByCollection.size).toBe(3));
await waitFor(() => expect(result.current.savedByCollection.size).toBe(4));
expect(result.current.unvisited.map((l) => l.place_id)).toEqual([902]);
});