Skip to content

fix(nav): remember open folder, Tutorial Navigator first, fix palette + channels - #2162

Merged
jung-thomas merged 1 commit into
DEVfrom
feat/nav-menu-improvements
Sep 5, 2026
Merged

fix(nav): remember open folder, Tutorial Navigator first, fix palette + channels#2162
jung-thomas merged 1 commit into
DEVfrom
feat/nav-menu-improvements

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Four navigation-menu improvements Tom requested.

Changes

  1. Palette regression fixedheader.html <script id="nav-data"> now pipes | jsonify | safeJS. It was emitting a double-encoded JSON string, so the ⌘K palette's JSON.parse yielded a string, parsed.groups was undefined, and the EXPLORE group came up empty. This is why "all navigation options are missing from the Palette."
  2. Channels page fixedchannels/list.html channel-collections-data gets the same | safeJS. The double-encoded "[]" made the channels-directory island throw visibleCollections("[]").filter is not a function, so only the "suggest a new item" row rendered. (236 channels exist in the data.)
  3. Tutorial Navigator first — moved to the top of the Learn submenu in navigation.yaml.
  4. Remember open folder — the nav accordion now persists the last-open group to localStorage (sb-nav-open-group) and restores it on load. Single-open accordion behavior is preserved (Tom's choice); empty string = user collapsed everything.

No island TypeScript changed — all four are Hugo template/data edits the pre-built islands read at runtime. safeJS matches the proven sibling pattern already used on channels-data (list.html:11) and feedback-share.html.

Testing

  • test/unit/hugo/header-nav-includes-explore.test.ts passes (YAML parses, header still ranges the data).
  • navigation.yaml validated with yq; accordion JS selectors verified against the template's data-nav-group / data-nav-items attributes.
  • Full build + palette/channels islands exercised by CI on this PR and the post-DEV-deploy e2e job.

…x palette+channels double-encode

- header.html nav-data: pipe | safeJS so the ⌘K palette receives a real JSON
  object (was double-encoded to a string → parsed.groups undefined → EXPLORE
  group empty). Fixes all-nav-options-missing-from-palette regression.
- channels/list.html channel-collections-data: same | safeJS fix; the
  channels-directory island was crashing on the double-encoded "[]" string
  (visibleCollections("[]").filter is not a function) → only the submit row showed.
- navigation.yaml: move Tutorial Navigator to first entry in the Learn group.
- header.html accordion: persist the last-open group to localStorage and restore
  it on load (single-open behavior preserved), so navigation continues where it
  left off.
@jung-thomas
jung-thomas merged commit a5fad92 into DEV Sep 5, 2026
4 checks passed
@jung-thomas
jung-thomas deleted the feat/nav-menu-improvements branch September 5, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant