#412 · "Timelines" in a timeline's breadcrumb leads back to the list it came from
- timeline-app
- pull request
A timeline's breadcrumb, "Timelines / ", always linked "Timelines" to `/`. On a server with the landing page on, such as timescale.info, that's the landing page, not the search or list the timeline was opened from. ## Changes - **The lists remember themselves:** the dashboard's and profiles' lists (`timeline-browser.jsx`) store their address, with its search, sort and page, in the tab's `sessionStorage` whenever it changes. The helpers `rememberList` and `lastList` are in `platform/lib/timeline-lists.js`, and they only accept a path on this site. - **The link points back:** the platform's editor (`editor.jsx`) sets the framed editor's `#timelines-link` to that address once the frame loads. - **A sensible default:** with no list remembered, for example on a timeline opened from a shared link, a new tab or the landing page's examples, the link goes to the timeline browser. That's `/explore` with the landing page on and `/` otherwise, set when the editor's page is served (`editor-html.js`). - The offline editor and the desktop app are unchanged. ## Tests - `test/timeline-lists.test.mjs` tests remembering a list, refusing an address on another site, and a browser where storage is blocked. - `test/landing-live-postgres.mjs` searches `/explore` in a real browser, opens a result, checks that "Timelines" leads back to the same search, and checks that the timeline opened in a new tab leads to `/explore`. It passed locally in Playwright's Docker image. - The unit tests pass, except the README contents check, which fails locally only because of a `node_modules` symlink.