Skip to content

fix(docs): resolve the real source path for "Edit this page" - #754

Merged
patricklx merged 1 commit into
mainfrom
fix/edit-this-page-link
Aug 7, 2026
Merged

fix(docs): resolve the real source path for "Edit this page"#754
patricklx merged 1 commit into
mainfrom
fix/edit-this-page-link

Conversation

@patricklx

Copy link
Copy Markdown
Collaborator

Summary

  • (service "kolay/docs") resolved to undefined — kolay doesn't register anything in Ember's container; its docs state lives in an ember-primitives store reached via docsManager().
  • Resolves the current page the way kolay's own private selected-page state does: strips query params/hash from the app-relative router.currentURL and looks it up with findByPath (matches with or without .md).
  • Fixes every "Edit this page" link, which previously pointed at a 404 (docs-app/app/templates.md).

Test plan

  • Verified against a production build served under a rootURL: link resolves correctly for a top-level page, a page inside a family folder (2-components/skeleton/icon.md), a family index page, and the extension-less form of a URL.
  • pnpm glint in docs-app shows no new errors introduced by this change (pre-existing unrelated errors in theme-support.gts/application.ts are untouched).

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

`(service "kolay/docs")` resolved to undefined -- kolay registers nothing in
ember's container, its docs state is an ember-primitives store reached with
`docsManager()`. `DocsService` has no public `selected` either, so
`{{docs.selected.path}}` rendered empty and every page's edit link pointed at
`docs-app/app/templates.md`, a 404.

Resolve the current page the way kolay's own private selected-page state does:
split query params / hash off the app-relative `router.currentURL` and look the
result up with `findByPath`, which matches with or without the `.md` extension.
The manifest page's `appRelativePath` is the file's location under
`app/templates` with the extension already on it, so the template's trailing
".md" goes away too (`path` is unusable here -- it carries the deployed
rootURL prefix).

Verified against a production build served under a rootURL: the link resolves
to the real source file for a top-level page, for a page inside a family folder
(2-components/skeleton/icon.md), for a family index page, and for the
extension-less form of a URL.

Signed-off-by: Patrick Pircher <patrick.pircher@ibm.com>
@patricklx
patricklx merged commit c1dcfe4 into main Aug 7, 2026
8 checks passed
@patricklx
patricklx deleted the fix/edit-this-page-link branch August 7, 2026 18:48
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