Skip to content

fix(web): in-app Help deep links resolve to the right section + heading#14

Merged
SecureCloudGroup merged 1 commit into
mainfrom
fix/help-doc-links
Jul 10, 2026
Merged

fix(web): in-app Help deep links resolve to the right section + heading#14
SecureCloudGroup merged 1 commit into
mainfrom
fix/help-doc-links

Conversation

@SecureCloudGroup

Copy link
Copy Markdown
Owner

Fixes the two low/cosmetic in-app Help nav findings from the post-release audit. GitHub rendering is unchanged — the source .md files are untouched; only the build-time transform that mirrors docs into the app changed.

Bug: build-docs.mjs rewrote inter-doc links but (a) dropped the #fragment from file.md#heading links → landed at the top of the target section, and (b) turned README.md (the docs index, which the app doesn't render as a section) into #README, which matches nothing → silent fallback to Getting Started. marked also emitted headings with no id, so fragments had no scroll target regardless.

Fix:

  • build-docs.mjs — slug ids on every heading (GitHub-style algorithm); preserve a link's fragment as #slug__heading; map the docs-index link to # (Help home).
  • help/+page.svelte — parse #slug__heading, switch to that section and scroll the heading into view (guarded to a slug shape so a crafted hash can't break the query).

Verified: docs regen → README link #, Embeddings link #models__embeddings-for-knowledge-search with a matching <h… id="embeddings-for-knowledge-search">; plain cross-doc links still #slug; absolute/SECURITY links untouched; 57 headings now anchorable. npm run check 0/0, npm test 54, build OK; shipped bundle carries the fix. (docs.generated.ts is gitignored — regenerated by the web CI job.)

Comment thread web/scripts/build-docs.mjs Fixed
Comment thread web/scripts/build-docs.mjs Fixed
The build-time docs transform collapsed 'file.md#heading' cross-doc links to just
'#slug' (dropping the fragment) and rewrote the docs-index link (README.md) to a
'#README' anchor with no matching section, so the in-app Help page silently fell back
to Getting Started. marked also emitted headings with no id, so there was no scroll
target even if the fragment survived.

- build-docs.mjs: add GitHub-style slug ids to every heading; preserve a link's
  fragment as '#slug__heading'; map the README docs-index link to '#' (Help home).
- help/+page.svelte: parse '#slug__heading', select the section, and scroll the target
  heading into view (guarded to a slug shape).

GitHub rendering is unchanged (source .md files untouched). Rebuilt the SPA bundle.
Found by the post-release audit.
@SecureCloudGroup SecureCloudGroup merged commit ee69e93 into main Jul 10, 2026
8 checks passed
@SecureCloudGroup SecureCloudGroup deleted the fix/help-doc-links branch July 10, 2026 14:41
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.

2 participants