32.7 follow-up: status, the three new points, and the new traps (bare-substring assertion, hidden anchor, current menu item)
This commit is contained in:
1 parent
adcda25385
commit
e9e26aad78
1 file changed
+19
-16
+19
-16
@@ -8,12 +8,13 @@ Short working handover for the next model. Keep it short.
|
|||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
- **Done and verified:** sections 1–31 and section 18 steps 1–11. **Section 32.1, the icon, is done** — the SVG drawing, the favicon on every page, the top-bar brand mark and the two 192 and 512 px PNGs — together with **section 32.2, the UI pass with the retro theme**, **section 32.3, the alert and page texts**, **section 32.4, the bug report** (round 32-A and round 32-B), and **section 32.7, the dashboard menu and the dashboard clean-up**. The follow-up round of 32.1 and 32.2 — the favicon, the top-bar brand mark, the footer at the bottom, the single way back, the history button and the three line/table changes in the history view — is done too. Schema version 12. **511 green tests.** The StartOS package is built, sideloaded and running on a StartOS 0.4.0 box; the package version is still `0.1.0:0`.
|
- **Done and verified:** sections 1–31 and section 18 steps 1–11. **Section 32.1, the icon, is done** — the SVG drawing, the favicon on every page, the top-bar brand mark and the two 192 and 512 px PNGs — together with **section 32.2, the UI pass with the retro theme**, **section 32.3, the alert and page texts**, **section 32.4, the bug report** (round 32-A and round 32-B), and **section 32.7, the dashboard menu and the dashboard clean-up, including its follow-up round**. The follow-up round of 32.1 and 32.2 — the favicon, the top-bar brand mark, the footer at the bottom, the single way back, the history button and the three line/table changes in the history view — is done too. Schema version 12. **513 green tests.** The StartOS package is built, sideloaded and running on a StartOS 0.4.0 box; the package version is still `0.1.0:0`.
|
||||||
- **What is left of section 32:** 32.6 the documentation drift, and then 32.5 the raise to `1.0.0:0` together with section 18 step 12. 32.6 has to come after the rounds it documents, and 32.5 last. One item inside 32.4 is left to the user: **BR-003** — read the 32.4 section below before acting on it, because the report's own wording for it is out of date. The user's own manual pass is also outstanding: the retro theme on a narrow phone, the footer on a short page, the favicon in the tab, the brand mark in the top bar, the top-bar menu and the cleaned dashboard, installing the PWA with the two PNG icons, the history view after the three changes, and the whole box test again.
|
- **What is left of section 32:** 32.6 the documentation drift, and then 32.5 the raise to `1.0.0:0` together with section 18 step 12. 32.6 has to come after the rounds it documents, and 32.5 last. One item inside 32.4 is left to the user: **BR-003** — read the 32.4 section below before acting on it, because the report's own wording for it is out of date. The user's own manual pass is also outstanding: the retro theme on a narrow phone, the footer on a short page, the favicon in the tab, the brand mark in the top bar, the top-bar menu with the current page greyed out, the cleaned dashboard, the `Download CSV` link and its note on the history page, the jump to `#history-detail`, installing the PWA with the two PNG icons, and the whole box test again.
|
||||||
- **A round stops when it is done.** Do not start the next item unless the user asks.
|
- **A round stops when it is done.** Do not start the next item unless the user asks.
|
||||||
- **Verified how:** the automated suite, the user's manual browser testing, and the install and test round on a StartOS 0.4.0 box. The user runs the suite; the agent has no shell.
|
- **Verified how:** the automated suite, the user's manual browser testing, and the install and test round on a StartOS 0.4.0 box. The user runs the suite; the agent has no shell.
|
||||||
- **Tests:** `python3 -m unittest discover -s tests`. They run on a Windows copy at `C:\Users\<brukarnamn>\Downloads\helsesjekk`, so they must pass there as well as on Linux.
|
- **Tests:** `python3 -m unittest discover -s tests`. They run on a Windows copy at `C:\Users\<brukarnamn>\Downloads\helsesjekk`, so they must pass there as well as on Linux.
|
||||||
- **Known gap, still open, folded into 32.6:** `docs/application.md` and `README.md` still describe the API as it was before section 31 — no login/session endpoints, no gating or CSRF rule, the old maintenance command name, the undated export name, and now also the two new summary fields, the moved field reminder, the added `model` field in the check detail, the icon link on the pages, the two PNG icons, the top-bar menu, the removed dashboard cards, the `Download CSV` link on the history page and the robots rule. The documentation conflict in the bug report (BR-004) covers the same ground.
|
- **Known gap, still open, folded into 32.6:** `docs/application.md` and `README.md` still describe the API as it was before section 31 — no login/session endpoints, no gating or CSRF rule, the old maintenance command name, the undated export name, and now also the two new summary fields, the moved field reminder, the added `model` field in the check detail, the icon link on the pages, the two PNG icons, the top-bar menu, the removed dashboard cards, the `Download CSV` link and its note on the history page, the `#history-detail` anchor and the robots rule. The documentation conflict in the bug report (BR-004) covers the same ground.
|
||||||
|
- **These two files are getting large.** `TODO.md` is ~81 KB and this note ~72 KB, and every round rewrites both in full. The document's own convention is that a finished round is one line in the §19–31 table, with the reasoning in the git history. Once 32.6 and 32.5 are done, §32.1–§32.4 and §32.7 can be collapsed into that table the same way, and the round sections in this note can shrink to one line each, keeping only the "Rules that are easy to get wrong" and "Traps" sections. Do that with the user's go-ahead, not on your own.
|
||||||
|
|
||||||
## Section 32 — what is left
|
## Section 32 — what is left
|
||||||
|
|
||||||
@@ -21,21 +22,23 @@ Short working handover for the next model. Keep it short.
|
|||||||
- **32.2 UI polish — done**, including the follow-up round. See the round 32.2 section below. The only thing left for the user is the manual browser pass on a narrow phone and over the new points.
|
- **32.2 UI polish — done**, including the follow-up round. See the round 32.2 section below. The only thing left for the user is the manual browser pass on a narrow phone and over the new points.
|
||||||
- **32.3 Alert and page texts — done.** See the round 32.3 section below.
|
- **32.3 Alert and page texts — done.** See the round 32.3 section below.
|
||||||
- **32.4 The bug report — done.** See the section below for what each finding turned out to be.
|
- **32.4 The bug report — done.** See the section below for what each finding turned out to be.
|
||||||
- **32.7 The dashboard menu and the dashboard clean-up — done.** Six points, all in `TODO.md` §32.7: the `Menu` drop-down in the top bar instead of the Sign out button; the `Configured setup` / `Your keys` heading and the `#key-count` label gone, with `#key-list` moved up under `#setup-shape`; the `Next check` card gone and the earliest due date moved into `Attention`; no placeholder text in an empty alert list; the dashboard history card gone with `Download CSV` moved to `/history`; and no indexing or crawling (`static/robots.txt`, a `noindex, nofollow` meta on all six pages, and an `X-Robots-Tag` header from `_send_security_headers()`). No schema change, no new endpoint, no new feature, and `static/robots.txt` is the only new file. See the round 32.7 section below. It had to be done before 32.6, so the documents describe the released state.
|
- **32.7 The dashboard menu and the dashboard clean-up — done**, including the three-point follow-up round the user asked for afterwards. Six points in `TODO.md` §32.7: the `Menu` drop-down in the top bar instead of the Sign out button; the `Configured setup` / `Your keys` heading and the `#key-count` label gone, with `#key-list` moved up under `#setup-shape`; the `Next check` card gone and the earliest due date moved into `Attention`; no placeholder text in an empty alert list; the dashboard history card gone with `Download CSV` moved to `/history`; and no indexing or crawling (`static/robots.txt`, a `noindex, nofollow` meta on all six pages, and an `X-Robots-Tag` header from `_send_security_headers()`). The follow-up added `Dashboard` as the first menu entry with the current page greyed out and not clickable, moved the export note to the history page under the button, and made both `View` and a saved check land on `#history-detail`. No schema change, no new endpoint, no new feature, and `static/robots.txt` is the only new file. See the round 32.7 section below. It had to be done before 32.6, so the documents describe the released state.
|
||||||
- **32.6 The documentation drift.** `README.md`, `docs/application.md`, `instructions.md`, `UPDATING.md`, `AGENTS.md` and the package's own i18n strings are all behind the code. `TODO.md` §32.6 lists what is wrong in each. It answers the rest of BR-004, and it must be done after 32.1–32.2 and 32.7 and before 32.5, so the documents describe the released state.
|
- **32.6 The documentation drift.** `README.md`, `docs/application.md`, `instructions.md`, `UPDATING.md`, `AGENTS.md` and the package's own i18n strings are all behind the code. `TODO.md` §32.6 lists what is wrong in each. It answers the rest of BR-004, and it must be done after 32.1–32.2 and 32.7 and before 32.5, so the documents describe the released state.
|
||||||
- **32.5 The version raise.** `0.1.0:0` → `1.0.0:0`, once the items above are done and the user says so. No schema change, no new endpoint, no new feature. `startos/versions/` stays empty, because the app migrates its own schema.
|
- **32.5 The version raise.** `0.1.0:0` → `1.0.0:0`, once the items above are done and the user says so. No schema change, no new endpoint, no new feature. `startos/versions/` stays empty, because the app migrates its own schema.
|
||||||
|
|
||||||
## Round 32.7 — the top-bar menu and the dashboard clean-up
|
## Round 32.7 — the top-bar menu and the dashboard clean-up
|
||||||
|
|
||||||
Six points, all in `TODO.md` §32.7. No schema change, no new endpoint, no new feature, no new document, and `static/robots.txt` is the only new file.
|
Six points, all in `TODO.md` §32.7, plus a three-point follow-up round. No schema change, no new endpoint, no new feature, no new document, and `static/robots.txt` is the only new file.
|
||||||
|
|
||||||
- **The menu is built by `static/session.js`, not by the pages.** It replaced the lone Sign out button, and it is added on the five application pages — `/login` has none, because `session.js` is not loaded there. The items are `Start health check` → `/health-check`, `Settings` → `/settings`, `History` → `/history`, a separator, and `Sign out`. The first three are `<a>` and Sign out is a `<button type="button">`. The panel is hidden until the button is pressed and closes on `Escape`, on a click outside it and after a choice. **`session.js` still creates its own `.topbar-actions` wrapper**, so no page's markup had to change for the wrapper. The new classes are `.menu`, `.menu-button`, `.menu-panel`, `.menu-item` and `.menu-separator`, all in the retro theme and with no inline style, because the CSP allows none.
|
- **The menu is built by `static/session.js`, not by the pages.** It replaced the lone Sign out button, and it is added on the five application pages — `/login` has none, because `session.js` is not loaded there. The items are `Dashboard` → `/`, `Start health check` → `/health-check`, `Settings` → `/settings`, `History` → `/history`, a separator, and `Sign out`. The destinations are `<a>` and Sign out is a `<button type="button">`. The panel is hidden until the button is pressed and closes on `Escape`, on a click outside it and after a choice. **`session.js` still creates its own `.topbar-actions` wrapper**, so no page's markup had to change for the wrapper. The new classes are `.menu`, `.menu-button`, `.menu-panel`, `.menu-item` and `.menu-separator`, all in the retro theme and with no inline style, because the CSP allows none.
|
||||||
- **`static/index.html` lost its own navigation.** The `Start annual health check` button in `.page-heading` and the whole `<div class="topbar-actions">` with the Settings link are gone, together with the `Configured setup` / `Your keys` section, the `#key-count` span, the `Next check` card and the `history-card` block. `#key-list` now stands inside `section.page-heading`, right after `#setup-shape`. The context links stay: the `/` link in the blocked-keys note, `Open the settings` in `setup.js`, the `/settings` links in `app.js` (`createRotateLink` and `createRemoveSoftwareControl`) and `Open the alert list` on the key card.
|
- **The page you are on is marked, greyed out and not clickable.** `createMenuItem()` compares `currentPath()` — `window.location.pathname` with trailing slashes stripped, and the root kept as `/` — with the item's `href`. On a match it renders a `<span class="menu-item menu-item-current">` with `aria-current="page"` instead of an `<a>`, so there is nothing to follow and the menu can never reload the page it is showing. `.menu-item-current` is grey (`var(--line)`) with `cursor: default`, and the hover and focus rule is scoped with `:not(.menu-item-current)` so the current item never lights up like a link.
|
||||||
|
- **`static/index.html` lost its own navigation.** The `Start annual health check` button in `.page-heading` and the whole `<div class="topbar-actions">` with the Settings link are gone, together with the `Configured setup` / `Your keys` section, the `#key-count` span, the `Next check` card, the `history-card` block and the `p#workflow-note` that used to sit under the alerts. `#key-list` now stands inside `section.page-heading`, right after `#setup-shape`. The context links stay: the `/` link in the blocked-keys note, `Open the settings` in `setup.js`, the `/settings` links in `app.js` (`createRotateLink` and `createRemoveSoftwareControl`) and `Open the alert list` on the key card.
|
||||||
- **The Attention card is the only summary card.** `renderSummary()` in `app.js` drives it alone: the heading is unchanged (`Nothing overdue` / `1 key overdue` / `N keys overdue`), the detail line is the overdue list when something is overdue, and otherwise `Earliest next check <YYYY-MM-DD>, for Key N: <name>.` — the two old lines (`No key has passed its next check date.` and `Earliest next check, for key …`) are gone. With no `next_check_due` anywhere, the fallback is still `No key has a next check date yet. Save a health check to schedule one.` `.overview-grid` is one column at every width and is no longer named in the media query.
|
- **The Attention card is the only summary card.** `renderSummary()` in `app.js` drives it alone: the heading is unchanged (`Nothing overdue` / `1 key overdue` / `N keys overdue`), the detail line is the overdue list when something is overdue, and otherwise `Earliest next check <YYYY-MM-DD>, for Key N: <name>.` — the two old lines (`No key has passed its next check date.` and `Earliest next check, for key …`) are gone. With no `next_check_due` anywhere, the fallback is still `No key has a next check date yet. Save a health check to schedule one.` `.overview-grid` is one column at every width and is no longer named in the media query.
|
||||||
- **An empty alert list renders no text at all.** `renderAlerts()` empties `#alerts-list` and leaves `alertCount` at `No alerts`. The placeholder in the markup and the failure branch (offline / `Alerts could not be loaded.`) stay.
|
- **An empty alert list renders no text at all.** `renderAlerts()` empties `#alerts-list` and leaves `alertCount` at `No alerts`. The placeholder in the markup and the failure branch (offline / `Alerts could not be loaded.`) stay.
|
||||||
- **The export link moved to the history page.** `static/history.html` carries `<a class="secondary-button" href="/api/export">Download CSV</a>` in `.page-heading`, **with no `download` attribute**, so the dated filename from `Content-Disposition` still wins. The dead `history-card` half of the CSS selector is gone; `.card-actions` stays, because the rule is shared.
|
- **The export link and its note live on the history page.** `static/history.html` carries `<a class="secondary-button" href="/api/export">Download CSV</a>` in `.page-heading`, **with no `download` attribute**, so the dated filename from `Content-Disposition` still wins, and `p#workflow-note` stands directly under it, reading `Save a health check to see it in the history. Download CSV exports every saved key check, one row per key check, as a dated file.` The note was reworded from `The history page exports …`, because it now stands on the page it explains. `.page-heading > .secondary-button { margin-top: 12px; }` keeps the button clear of the line above it. The dead `history-card` half of the CSS selector is gone; `.card-actions` stays, because the rule is shared.
|
||||||
|
- **Both ways into a check land on `#history-detail`.** The `View` link in `history.js` is `/history?id=<id>#history-detail`, and `saveHealthCheck()` in `health-check.js` assigns `/history?id=<new id>#history-detail` after a save. The detail section is hidden until a check is opened, and a hidden element has no box, so the browser cannot jump to the anchor on its own: `revealDetail()` reveals the section first and then calls `scrollIntoView({ behavior: "smooth", block: "start" })`. Both `renderDetail()` and the not-found branch of `loadDetail()` go through it.
|
||||||
- **No indexing, no crawling.** `static/robots.txt` is `User-agent: *` + `Disallow: /`, served through `STATIC_FILES` as `text/plain; charset=utf-8` and deliberately **not** in the `SHELL` list of `static/sw.js`. `_send_security_headers()` in `app.py` adds `X-Robots-Tag: noindex, nofollow`, so the pages, the JSON, a redirect, the CSV and the static files are all covered in one place. All six pages carry `<meta name="robots" content="noindex, nofollow">` in `<head>`.
|
- **No indexing, no crawling.** `static/robots.txt` is `User-agent: *` + `Disallow: /`, served through `STATIC_FILES` as `text/plain; charset=utf-8` and deliberately **not** in the `SHELL` list of `static/sw.js`. `_send_security_headers()` in `app.py` adds `X-Robots-Tag: noindex, nofollow`, so the pages, the JSON, a redirect, the CSV and the static files are all covered in one place. All six pages carry `<meta name="robots" content="noindex, nofollow">` in `<head>`.
|
||||||
- **Tests:** thirteen new ones. Eight in `tests/test_health_check_form.py` (no setup block and no key count; no Next check card and no history block; the earliest line; the empty alert list; the menu; the menu classes; the robots meta on all six pages; the history export link), four in `tests/test_app.py` (the dashboard carries no navigation link of its own; the history page's CSV download; `/robots.txt`; the `X-Robots-Tag` header on every answer, plus one for a redirect in `AuthApiTests`), and one in `tests/test_pwa.py` (robots.txt is served but is not part of the shell). Two existing tests were **replaced, not deleted**: `test_dashboard_links_to_the_form_the_history_the_export_and_the_settings` in `tests/test_app.py` became `test_the_dashboard_carries_no_navigation_link_of_its_own`, and `test_the_dashboard_link_does_not_override_the_filename` in `tests/test_export_filename.py` became `test_the_history_link_does_not_override_the_filename`, which now reads `static/history.html` and asserts the dashboard has no export link. The suite went from 498 to **511 tests**.
|
- **Tests:** thirteen new ones in the main round and two more in the follow-up. Eight in `tests/test_health_check_form.py` in the main round (no setup block and no key count; no Next check card and no history block; the earliest line; the empty alert list; the menu; the menu classes; the robots meta on all six pages; the history export link), four in `tests/test_app.py` (the dashboard carries no navigation link of its own; the history page's CSV download; `/robots.txt`; the `X-Robots-Tag` header on every answer, plus one for a redirect in `AuthApiTests`), and one in `tests/test_pwa.py` (robots.txt is served but is not part of the shell). The follow-up **replaced rather than deleted** two tests — `test_dashboard_links_to_the_form_the_history_the_export_and_the_settings` in `tests/test_app.py` became `test_the_dashboard_carries_no_navigation_link_of_its_own`, and `test_the_history_page_offers_the_export` became `test_the_history_page_offers_the_export_and_the_note`, which now also pins the note under the button and the button's spacing — and renamed one, `test_the_top_bar_menu_offers_the_three_pages_and_sign_out` → `test_the_top_bar_menu_lists_the_dashboard_and_the_pages`. Two new ones came with it: `test_the_menu_marks_the_page_you_are_on_and_greys_it_out` and `test_the_history_links_to_the_detail_section`. The suite went from 498 to 511 and then to **513 tests**.
|
||||||
|
|
||||||
## Round 32.2 — the UI pass and the retro theme
|
## Round 32.2 — the UI pass and the retro theme
|
||||||
|
|
||||||
@@ -82,7 +85,7 @@ Seven small changes, no new feature and no schema change. The reasoning is in `T
|
|||||||
- **BR-007 — confirmed and fixed.** The service worker only stores a successful, same-origin, non-redirected response.
|
- **BR-007 — confirmed and fixed.** The service worker only stores a successful, same-origin, non-redirected response.
|
||||||
- **BR-008 — confirmed and fixed.** The address-path comparison is canonical.
|
- **BR-008 — confirmed and fixed.** The address-path comparison is canonical.
|
||||||
- **The report was written against a different file set.** It asks for `SECURITY.md`, `PRIVACY.md`, `THREATMODEL.md`, `PLATFORM-ACCESS.md`, `ENCRYPTION.md`, `OFFLINE.md`, `AI-STATUS.md` and `DATA-MODEL.md`; none of them exist here. Do not create them.
|
- **The report was written against a different file set.** It asks for `SECURITY.md`, `PRIVACY.md`, `THREATMODEL.md`, `PLATFORM-ACCESS.md`, `ENCRYPTION.md`, `OFFLINE.md`, `AI-STATUS.md` and `DATA-MODEL.md`; none of them exist here. Do not create them.
|
||||||
- **The counts in the report were partly wrong and are corrected there.** Round 32-A added ten tests, not eight, and `tests/test_secret_guard.py` holds 43, not 44: 5 wordlist tests, 10 detection tests, 17 field-level tests, 6 warning tests and 5 API tests. The suite went from 422 to 475, which is the number the user confirmed. Round 32.3 added two more — one in `tests/test_alerts.py` and one in `tests/test_health_check_form.py` — and round 32.2 added seven net, for 484. The seven are six new tests in `tests/test_health_check_form.py` and two in `tests/test_app.py`, minus the one `WarningTests` test that the rewritten class no longer has. The follow-up round of 32.1 and 32.2 added fourteen more in total, for 498, and round 32.7 added thirteen, for **511**.
|
- **The counts in the report were partly wrong and are corrected there.** Round 32-A added ten tests, not eight, and `tests/test_secret_guard.py` holds 43, not 44: 5 wordlist tests, 10 detection tests, 17 field-level tests, 6 warning tests and 5 API tests. The suite went from 422 to 475, which is the number the user confirmed. Round 32.3 added two more — one in `tests/test_alerts.py` and one in `tests/test_health_check_form.py` — and round 32.2 added seven net, for 484. The seven are six new tests in `tests/test_health_check_form.py` and two in `tests/test_app.py`, minus the one `WarningTests` test that the rewritten class no longer has. The follow-up round of 32.1 and 32.2 added fourteen more in total, for 498; round 32.7 added thirteen, for 511; and the 32.7 follow-up added two, for **513**.
|
||||||
|
|
||||||
## Round 32.3 — the alert texts and the page texts
|
## Round 32.3 — the alert texts and the page texts
|
||||||
|
|
||||||
@@ -174,10 +177,7 @@ The rules are in `TODO.md` §7; these are the traps that have already cost time.
|
|||||||
- **The export is plain CSV only.** XLSX is not built and the app does not promise Excel compatibility. The column names and the column order are an agreement; do not change them. A text cell that a spreadsheet would read as a formula is neutralized with a leading apostrophe, and that is the only change a cell may receive.
|
- **The export is plain CSV only.** XLSX is not built and the app does not promise Excel compatibility. The column names and the column order are an agreement; do not change them. A text cell that a spreadsheet would read as a formula is neutralized with a leading apostrophe, and that is the only change a cell may receive.
|
||||||
- **The PWA cache stores only a valid shell answer.** `isCacheable()` in `static/sw.js` requires `response.ok`, `response.type === "basic"` and `!response.redirected`, so a login page (or an error page) can never replace the cached shell. The allow-list is the other half: the worker never names `/api/*`, `/health`, `/login` or `/robots.txt`.
|
- **The PWA cache stores only a valid shell answer.** `isCacheable()` in `static/sw.js` requires `response.ok`, `response.type === "basic"` and `!response.redirected`, so a login page (or an error page) can never replace the cached shell. The allow-list is the other half: the worker never names `/api/*`, `/health`, `/login` or `/robots.txt`.
|
||||||
- **No page is meant to be crawled.** All six pages carry `<meta name="robots" content="noindex, nofollow">` in `<head>`, `_send_security_headers()` in `app.py` adds `X-Robots-Tag: noindex, nofollow`, and `static/robots.txt` answers `Disallow: /`. A new page has to carry the meta, and `static/robots.txt` must **not** be added to the service worker's shell list. The header is not sent by `send_error()` — that is, a `404` and a `500` answer without it — which is deliberate: the header covers the pages, the JSON, a redirect, the CSV and the static files, which is what the round asked for.
|
- **No page is meant to be crawled.** All six pages carry `<meta name="robots" content="noindex, nofollow">` in `<head>`, `_send_security_headers()` in `app.py` adds `X-Robots-Tag: noindex, nofollow`, and `static/robots.txt` answers `Disallow: /`. A new page has to carry the meta, and `static/robots.txt` must **not** be added to the service worker's shell list. The header is not sent by `send_error()` — that is, a `404` and a `500` answer without it — which is deliberate: the header covers the pages, the JSON, a redirect, the CSV and the static files, which is what the round asked for.
|
||||||
- **A free-text field refuses a wallet secret, and the guard runs before the length limit.** See the 32-B section above. The refusal is a `ValidationError`, the message never repeats the value, and the password is not checked. The reminder that says so is one line in the key setup, not one per field (32.2).
|
- **The navigation lives in the top bar, not on the page.** `static/session.js` builds the menu, the panel and the `.topbar-actions` wrapper on the five application pages; `/login` has none. The dashboard markup therefore carries no `href` for `/health-check`, `/settings`, `/history` or `/api/export`, and the export link and its note are on the history page. The page the user is already on is a `<span>` with `aria-current="page"`, not a link. Do not add a navigation link back to the dashboard markup: `tests/test_app.py`'s `test_the_dashboard_carries_no_navigation_link_of_its_own` pins it.
|
||||||
- **Every alert message says what is wrong, which key or software, and what closes it**, and it does not repeat the name in `source` — except the cloud-key form of `software_incompatible`. See the round 32.3 section above and `TODO.md` §7.
|
|
||||||
- **The two new summary fields are additive and mean what they say.** `key_names` follows `key_numbers`; `needs_follow_up` is a property of the saved check, so it does not change when an alert is closed or a key is renamed. Do not "fix" it to follow `collect_alerts()`, which hides acknowledged alerts and would rewrite history.
|
|
||||||
- **The navigation lives in the top bar, not on the page.** `static/session.js` builds the `Menu` button, the panel and the `.topbar-actions` wrapper on the five application pages; `/login` has none. The dashboard markup therefore carries no `href` for `/health-check`, `/settings`, `/history` or `/api/export`, and `Download CSV` is on the history page. Do not add a navigation link back to the dashboard markup: `tests/test_app.py`'s `test_the_dashboard_carries_no_navigation_link_of_its_own` pins it.
|
|
||||||
- **The Attention card is the only summary card.** Its detail line carries the overdue list when something is overdue and the earliest due date otherwise; `nextCheckTitle` and `nextCheckDetail` no longer exist, and `.overview-grid` is one column at every width.
|
- **The Attention card is the only summary card.** Its detail line carries the overdue list when something is overdue and the earliest due date otherwise; `nextCheckTitle` and `nextCheckDetail` no longer exist, and `.overview-grid` is one column at every width.
|
||||||
- **An empty alert list renders nothing.** The count beside the heading says `No alerts`; do not put placeholder text back into `#alerts-list`.
|
- **An empty alert list renders nothing.** The count beside the heading says `No alerts`; do not put placeholder text back into `#alerts-list`.
|
||||||
- **The prohibition lists** in sections 1 and 13 of `TODO.md` stay unticked. They are standing prohibitions, to be re-confirmed before release — with the one amendment for the installable PWA.
|
- **The prohibition lists** in sections 1 and 13 of `TODO.md` stay unticked. They are standing prohibitions, to be re-confirmed before release — with the one amendment for the installable PWA.
|
||||||
@@ -208,7 +208,7 @@ Pages: `/`, `/setup`, `/settings`, `/health-check`, `/history`, `/login`. Endpoi
|
|||||||
|
|
||||||
Maintenance commands, run inside the container by the StartOS actions and usable by hand: `maintenance.py delete-all-data` and `maintenance.py set-admin-password`. Neither is an HTTP endpoint.
|
Maintenance commands, run inside the container by the StartOS actions and usable by hand: `maintenance.py delete-all-data` and `maintenance.py set-admin-password`. Neither is an HTTP endpoint.
|
||||||
|
|
||||||
The rotate payload is `replaced` + `keep_name` + `name` + `type` + `address_path`, and `type` is optional. `GET /api/health-checks/<id>` also returns `closed_alerts`, and each of its `key_checks` rows carries `model` as well — the field was added in the follow-up round of 32.1 so the history can show the model and the firmware version on one line, and the fields that were already there keep their names. The settings page has two sections, and `POST /api/settings/keys` is what a rename alone goes through.
|
The rotate payload is `replaced` + `keep_name` + `name` + `type` + `address_path`, and `type` is optional. `GET /api/health-checks/<id>` also returns `closed_alerts`, and each of its `key_checks` rows carries `model` as well — the field was added in the follow-up round of 32.1 so the history can show the model and the firmware version on one line, and the fields that were already there keep their names. The settings page has two sections, and `POST /api/settings/keys` is what a rename alone goes through. The `#history-detail` anchor and the `?id=` query on `/history` are client-side only: they never reach the server, so no route changed for them.
|
||||||
|
|
||||||
Five things that are easy to break:
|
Five things that are easy to break:
|
||||||
|
|
||||||
@@ -226,6 +226,8 @@ Five things that are easy to break:
|
|||||||
- **`urlopen` raises `HTTPError` on a 4xx.** A test that expects a `400` has to catch it and read the body from the exception; `tests/test_secret_guard.py`'s `post_status()` helper is the pattern. A `302` behaves the same way when the opener refuses to follow it, which is how `tests/test_app.py` reads a redirect's headers.
|
- **`urlopen` raises `HTTPError` on a 4xx.** A test that expects a `400` has to catch it and read the body from the exception; `tests/test_secret_guard.py`'s `post_status()` helper is the pattern. A `302` behaves the same way when the opener refuses to follow it, which is how `tests/test_app.py` reads a redirect's headers.
|
||||||
- **A field has a length limit, and the guard runs before it.** A test that pastes an 80-character seed phrase into a 60-character label field gets a secret refusal, not a length refusal. Use a WIF key (52 characters) or a BIP38 key (58) when a test needs a secret that *fits* a short field, and use the seed phrase where the field has room. Both sides are pinned in `tests/test_secret_guard.py`.
|
- **A field has a length limit, and the guard runs before it.** A test that pastes an 80-character seed phrase into a 60-character label field gets a secret refusal, not a length refusal. Use a WIF key (52 characters) or a BIP38 key (58) when a test needs a secret that *fits* a short field, and use the seed phrase where the field has room. Both sides are pinned in `tests/test_secret_guard.py`.
|
||||||
- **A `required` control inside a `display:none` container still blocks submission.** The browser refuses to submit and logs "An invalid form field is not focusable". Hiding a section is not enough: the required flags must be cleared, or the section must render something other than required fields. That is why `renderSecurityChecks()` shows an empty note instead of cards when a key could not be checked, why `syncUncheckableState()` clears the flags on the wallet software and the compatibility select — also for a cloud key, whose grid is hidden — and why `syncRequiredFields()` clears the flag on `hardware_works` and `seed_backup_verified`. The rotation fields follow the same rule: the type is `disabled` until the key is marked for rotation, the path is `disabled` when the key has a saved check and is not marked, and the script refuses to send an empty path. The login page sidesteps it with two separate forms, so only the visible one is ever validated.
|
- **A `required` control inside a `display:none` container still blocks submission.** The browser refuses to submit and logs "An invalid form field is not focusable". Hiding a section is not enough: the required flags must be cleared, or the section must render something other than required fields. That is why `renderSecurityChecks()` shows an empty note instead of cards when a key could not be checked, why `syncUncheckableState()` clears the flags on the wallet software and the compatibility select — also for a cloud key, whose grid is hidden — and why `syncRequiredFields()` clears the flag on `hardware_works` and `seed_backup_verified`. The rotation fields follow the same rule: the type is `disabled` until the key is marked for rotation, the path is `disabled` when the key has a saved check and is not marked, and the script refuses to send an empty path. The login page sidesteps it with two separate forms, so only the visible one is ever validated.
|
||||||
|
- **A hidden element has no box, so an anchor cannot jump to it.** `#history-detail` is hidden until a check is opened, so the browser's own `:target` scroll does nothing. `revealDetail()` in `history.js` unhides the section first and only then calls `scrollIntoView()`. Do not reorder those two lines, and do not drop the anchor from the `View` link or from the target in `saveHealthCheck()`.
|
||||||
|
- **A bare substring assertion over page markup also catches comments.** `test_the_dashboard_has_no_next_check_card_and_no_history_block` failed on the first run because it asserted `assertNotIn("Next check", html)` and the page carried an HTML comment that named the removed card. It now pins the markup that was actually removed — `<p class="eyebrow">Next check</p>` and the two ids — which is the pattern to copy: assert on the element, not on the phrase. A phrase-based assertion is also case-sensitive and would trip on any future line such as `Next check due`.
|
||||||
- **The mismatch confirmation follows its warning.** `#address-path-confirmed` is `required` only while `#address-path-warning` is visible, so the browser itself stops the submission and a required control is never hidden.
|
- **The mismatch confirmation follows its warning.** `#address-path-confirmed` is `required` only while `#address-path-warning` is visible, so the browser itself stops the submission and a required control is never hidden.
|
||||||
- **The per-field secret reminder is gone; only the setup keeps one.** It used to be a `<span>` built in JavaScript (`settings.js` put it inside a `.field` label, where a `<p>` is not allowed) with `display: block` and `font-weight: 400` so it looked right in both places. Since 32.2 it is a single `p.secret-warning` in `setup.html`, and `setup.js`, `health-check.js` and `settings.js` no longer build one at all. A test asserts `setup.html` holds exactly one `class="secret-warning"` and that the check form and the settings hold none, so re-adding a per-field copy breaks it.
|
- **The per-field secret reminder is gone; only the setup keeps one.** It used to be a `<span>` built in JavaScript (`settings.js` put it inside a `.field` label, where a `<p>` is not allowed) with `display: block` and `font-weight: 400` so it looked right in both places. Since 32.2 it is a single `p.secret-warning` in `setup.html`, and `setup.js`, `health-check.js` and `settings.js` no longer build one at all. A test asserts `setup.html` holds exactly one `class="secret-warning"` and that the check form and the settings hold none, so re-adding a per-field copy breaks it.
|
||||||
- **`static/health-check.js` must not use `placeholder` anywhere.** A test asserts the string is absent, because a previous value is a real input value.
|
- **`static/health-check.js` must not use `placeholder` anywhere.** A test asserts the string is absent, because a previous value is a real input value.
|
||||||
@@ -251,7 +253,8 @@ Five things that are easy to break:
|
|||||||
- **`#key-count` still exists in `setup.html`, but not on the dashboard.** The dashboard's counter span was removed in 32.7; `setup.html` still has the `Key slots` input with `id="key-count"` and `name="key_count"`. The two are on different pages and were never the same element, so assert per file: `assertNotIn('id="key-count"', index.html)` and `assertNotIn("keyCount", app.js)` are what `tests/test_health_check_form.py` pins.
|
- **`#key-count` still exists in `setup.html`, but not on the dashboard.** The dashboard's counter span was removed in 32.7; `setup.html` still has the `Key slots` input with `id="key-count"` and `name="key_count"`. The two are on different pages and were never the same element, so assert per file: `assertNotIn('id="key-count"', index.html)` and `assertNotIn("keyCount", app.js)` are what `tests/test_health_check_form.py` pins.
|
||||||
- **A `display: grid` panel ignores the `hidden` attribute.** `.menu-panel` is a grid, so the browser's own `[hidden] { display: none }` loses to it. The sheet carries `.menu-panel[hidden] { display: none; }` for that reason, the same way `.form-stack[hidden]`, `.field-grid[hidden]` and `.form-section[hidden]` already did. Do not drop that rule.
|
- **A `display: grid` panel ignores the `hidden` attribute.** `.menu-panel` is a grid, so the browser's own `[hidden] { display: none }` loses to it. The sheet carries `.menu-panel[hidden] { display: none; }` for that reason, the same way `.form-stack[hidden]`, `.field-grid[hidden]` and `.form-section[hidden]` already did. Do not drop that rule.
|
||||||
- **The menu's outside-click listener has to allow the button's own click.** The button's handler runs first and toggles the panel; the document listener then sees a target inside `.menu` and does nothing. Reordering them, or replacing `menu.contains(event.target)` with a check on the panel alone, makes the button close the panel it just opened.
|
- **The menu's outside-click listener has to allow the button's own click.** The button's handler runs first and toggles the panel; the document listener then sees a target inside `.menu` and does nothing. Reordering them, or replacing `menu.contains(event.target)` with a check on the panel alone, makes the button close the panel it just opened.
|
||||||
- **The export link moved, and two tests moved with it.** `tests/test_export_filename.py` now reads `static/history.html` and asserts the dashboard has no `/api/export` link, and `tests/test_app.py`'s dashboard test became `test_the_dashboard_carries_no_navigation_link_of_its_own`. A future round that adds a link to the dashboard has to update both, not delete them.
|
- **The current-page check compares a normalised path, and the current item is a span.** `currentPath()` strips trailing slashes and keeps the root as `/`, so `/health-check/` matches `/health-check`. The match is rendered as a `<span class="menu-item menu-item-current">` with `aria-current="page"`, never an `<a>` — that is what makes it unclickable. A test asserts the span, the class string and the `aria-current` attribute, so switching back to a disabled link breaks it.
|
||||||
|
- **The export link and its note moved, and four tests moved with them.** `tests/test_export_filename.py` reads `static/history.html` and asserts the dashboard has no `/api/export` link; `tests/test_app.py`'s dashboard test became `test_the_dashboard_carries_no_navigation_link_of_its_own`; `test_the_history_page_offers_the_export_and_the_note` in `tests/test_health_check_form.py` pins the note under the button and the `.page-heading > .secondary-button` rule; and `test_the_history_links_to_the_detail_section` pins both anchors. A future round that adds a link to the dashboard has to update these, not delete them.
|
||||||
|
|
||||||
## Product clarification
|
## Product clarification
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user