@startujn render { direction: down; arrow_spacing: 24 } journey SEARCH "Search, filter, open a detail page" description: "Find a vacation rental: search, narrow the results in a filter drawer, open a stay. Nothing leaves the site" unique_id_friendly: search start from_home { description: "Opens the site" } action load_recent { title: "Load recent searches" } data recent { type: browser-storage; title: "Recent searches"; description: "Last 5, this browser only"; location: "localStorage ยท recent_searches" } view search { title: "Search"; description: "Where, dates, guests, or a recent search"; route: / } start shared_link { type: deep-link; description: "A shared or bookmarked results link"; route: "/s/:place?dates&guests&filters" } action run_search { title: "Search stays"; description: "Query and filters from the route" } system search_svc { title: "Search service"; host: search.example } view results { title: "Results"; description: "List and map, 20 per page"; route: "/s/:place?dates&guests&filters" } view no_results { title: "No stays found"; description: "Suggests other dates or filters to remove"; route: "/s/:place?dates&guests&filters" } view unavailable { title: "Search not available"; description: "Results could not load" } view filters { type: drawer; title: "Filters"; description: "Price, type, rooms, amenities" } view stay { title: "Stay details"; description: "Photos, price for your dates, reviews"; route: "/stays/:id?dates&guests" } ref book { journey: BOOK_STAY; title: "Book a stay" } from_home --> load_recent recent -up-> load_recent { payload: [recent_queries] } load_recent --> search search --> run_search : [Search] { payload: [place, dates, guests] } shared_link --> run_search { payload: [place, dates, guests, filters] } run_search -right-> search_svc { payload: [place, dates, guests, filters, page] } search_svc ..> run_search { payload: [stays, total] } run_search -up-> recent { payload: [place, dates, guests] } run_search --> results : some found run_search -left-x-> unavailable : service error run_search --> no_results : none found no_results -up-> run_search : [Change dates] { payload: [dates] } results --> stay : [Open stay] { payload: [stay_id] } results --> filters : [Filters] filters -up-> run_search : [Clear all] filters -up-> run_search : [Apply] { payload: [price, type, rooms, amenities] } no_results --> filters : [Edit filters] unavailable .x.> run_search : [Try again] stay ..> results : [Back] stay --> book : [Reserve] @endujn