# Changelog

Find here all changes tracked while developing PicoSPA.

## (Maybe) Future Version / Backlog

- [ ] `2️⃣ Try what picospa.details.autoOpen() does:` seems to be broken, it does NOT close the about section when clicking another link
- [ ] first version of bar-chart in CSS only
  - [ ] make caption render
  - [ ] choose to show value (tr) or label (th), or both
  - [ ] do it all for column chart too (maybe)
  - [ ] make grid lines not render over the axis
  - [ ] show a tooltip/cross when hovering the chart 
- [ ] tab accordion restore
- [ ] sidebar/menu toggle restore
- [ ] A copy-button to copy a headline's URL
- [ ] make `picospa.section.addAnchors()` also copy the URL to the clipboard? maybe show a separate icon when hovering the anchor icon?
- [ ] copy-to-clipboard function
- [ ] speak-button to read the text of a section
- [ ] make docs nicer for mobile: `<code>` and `<table>` overflow, so they are scrollable
- [ ] syntax highlighting for code blocks

## v2026.4.19

### `picospa.scroll.store()` 🆕
- [x] new fn `store({key, otherNodes})` — stores scroll offsets and keeps them up-to-date without restoring.
      Use together with `restore()` (same params) when you want to always store but only optionally restore.
- [x] `restore()` now delegates to `store()` internally; existing behavior is unchanged (BC preserved)

## v2026.1.12

- [x] function to catch navigate-away event, for allowing to show page-load-in-progress indicator 
      `navigation.addEventListener('navigate'` does all this, so this just provides a polyfill if needed


## v3.0.0

- [x] ensure `session.readMap()` ALWAYS returns a `Map`
- [x] Make scroll also store left scroll position, not just top, so it can be used e.g. for horizontally tabs, or alike
- [x] changed `picospa.details.scrollOnToggle()` to `scrollOnOpen()` feels better to only scroll when opening, not closing
- [x] first version of bar-chart in CSS only
  - [x] make tfoot be a nice x-axis
  - [x] add grid lines
- [x] Docs: Make the "in a nutshell" section easier to understand how to use picospa in 1 minute

## v2.1.0

- [x] add `picospa.details.scrollOnToggle()` to scroll the `<details>` into view when toggled

## v2.0.0 and v.2.0.1

- [x] docs: add a demo about "picospa.scroll.restore()" in [the docs](https://picossg.dev/tools/picospa/scroll/#section-try-it-out-1)
- [x] scroll: use `scrollend` event when available to update the scroll position in the session store, using `beforeunload` otherwise
- [x] introduced ADRs (mostly relevant for development or if you want to understand the decisions made)
- [x] add playwright tests
- [x] make docs work on mobile

### `picospa.section.*()`
- [x] 🐛 multiple headlines with the same `textContent`, e.g., "Parameters" create the same `id="section-parameters"`, so the anchor is not unique,
  added a number to the `id` to make it unique, e.g., `id="section-parameters-abc"` and `id="section-parameters-def"`

### `picospa.scroll.restore()`
- [x] API change, now call it with an object like `picospa.scroll.restore({key, otherNodes})`, to stay consistent with the other functions

### `picospa.details.reopen()` 🚨
- [x] parameters changed to an object with `key` and `nodes` properties, `picospa.details.reopen({key, nodes: string[] | NodeList})`, this allows for any param to be optional
- [x] the `nodes` parameter can now be of type `nodes: string[] | NodeList`, it allows for using a list of string or a result from `document.querySelectorAll()`
- [x] when `open` attribute is set in the HTML, it should be opened initially but the "update" should come from the storage, so user's changes are respected
- [x] `picospa.details.reopen()` without any parameters finds all `<details>` elements on the page and restores their state, using the `location.pathname` as the page key
- [x] added ADR-1 describing the `selectors` parameter of `picospa.details.reopen()`
- [x] docs

### `picospa.details.autoOpen()` 🆕
- [x] new fn `autoOpen()` – opens `<details>` when current page linked inside, useful inside `<nav>`s when opened via link
- [x] without parameters, it opens all `<details>` elements on the page that contain links to the current page
- [x] docs


## v1.0.5

- [x] add `picospa.section.addAnchors()` which adds `id` attribute if needed and a visual anchor icon to the headings of a section
- [x] added documentation for all functionality, see the [docs](https://picossg.dev/tools/picospa/)
- [x] put the docs online at https://picossg.dev/tools/picospa/

## v1.0.4

- [x] 1.0.3 did just not work, made it work

## v1.0.3

- [x] namespace all functions to `picospa.{details,colorScheme,scroll}`, tidying up

## v1.0.2

- [x] theme (re)store

## v1.0.0

- [x] details-reopen
- [x] scroll-restore
