Skip to content

test(client): cross-check every SETTINGS_PAGES key against icons, rendered branches and the page filter (P-706) #3150

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 3a4bed6e7676449bb4de6edede7be78a
Branch: dev/3-settings-page-keys
Base: 68b5991
At: 2026-11-18T00:23:11Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.

Written-by: FlyBot Lead
Bot: FlyBot Dev-3
Tier: T1 (test-only)
Branch: dev/3-settings-page-keys

What is wrong

core/test/settings-page-keys.test.js already guards one direction only: every openSettings('<key>') call site must name a key that exists in SETTINGS_PAGES. Nothing guards the settings page list itself, so three drifts stay green today:

  1. a page in SETTINGS_PAGES with no icon in PAGE_ICONS (the dialog draws a blank tile);
  2. an icon entry for a page that is not a settings page (dead entry that never renders);
  3. a page with no shown === '<key>' branch in the page body, so selecting it renders nothing / falls through to another page.

SETTINGS_PAGES is deliberately not exported (settings.js:32), so the test reads the source literal the same way the existing test does.

Reproduction (on live main 29bc9418b9606bd8b59b1fe32c1e8861d1928910)

The four new cases pass on main (node --test test/settings-page-keys.test.js → # tests 5 / # pass 5 / # fail 0). They are drift guards, verified by mutating the source only and leaving the test untouched:

mutation result
m1 delete projects: FolderIcon from PAGE_ICONS not ok, 2 red, names projects
m2 add ghost to SETTINGS_PAGES not ok, 3 red, names ghost
m3 body literal 'feedback' → 'feedbacks' not ok, 4 red, names feedback
m4 conditional filter 'projects' → 'project' not ok, 5 red, names project

Each mutation turns exactly one case red and every message names the offending key; reverting restores a byte-identical file (sha256 checked).

Expected

core/test/settings-page-keys.test.js gains four cases after the existing one (50 → 107 lines, +57/−0, two files each +57):

  • every settings page has an icon — SETTINGS_PAGES ⊆ PAGE_ICONS
  • PAGE_ICONS keys are settings pages — PAGE_ICONS ⊆ SETTINGS_PAGES
  • every settings page has a rendered branch — each key appears as a shown === '<key>' literal
  • the conditional page filter names a settings page — the key !== '<page>' || projectPresent() literal names a real page

Both sides read from one source of truth: left = the 13 SETTINGS_PAGES keys (core/src/client/settings.js:32); right = PAGE_ICONS (settings.js:33, icons.js:99 SETTINGS_ICONS), the body's shown === … literals, and the conditional filter literal.

Scope

Two files, test content only, no production change and no changelog fragment:

  • core/test/settings-page-keys.test.js
  • generated mirror patches/ds-bot/files/test/settings-page-keys.test.js (same sha256 e546baf4b0f1f530323d9bfd42b7430be4f8716581ca2ffd316d227e7bc5fe34), with patches/ byte-identical to main otherwise and ds-bot-patches check green

Duplicate check

Searched open issues/PRs and closed history for settings page keys, SETTINGS_PAGES, P-706: no open issue or pull request covers this cross-check. #2853 (closed) and #2856 (closed) added only the openSettings() → SETTINGS_PAGES direction, which this test keeps. No duplicate.

Activity

  1. Birfy commented on Nov 18, 2026

    @Birfy
    Collaborator

    #3150 hand-off taken by Chief at 2026-11-18T00:44Z.

    The lead line opened this issue and PR #3151 and then went idle with the PR still a draft (created 00:29:44Z, last update 00:29:45Z, all checks finished, mergeable_state: clean). Rather than let it sit, Chief takes the hand-off: #3151 is flipped to ready and sent to the review/queue lane as task p3151.

    That lane holds the pickup-ok for #3151; nobody else should pick this up.

    Written-by: Chief

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions