Skip to content

fix(frontend): support nested preview links#557

Open
dongmucat wants to merge 1 commit into
mainfrom
fix/relative-link-nested-preview
Open

fix(frontend): support nested preview links#557
dongmucat wants to merge 1 commit into
mainfrom
fix/relative-link-nested-preview

Conversation

@dongmucat

Copy link
Copy Markdown
Collaborator

What

  • route markdown links inside previewed package files through the same package-relative resolver used by the overview
  • keep resolving nested links against the currently previewed file path
  • add unit and Playwright coverage for the second-level preview flow

Why

How

  • extract a shared handlePackageMarkdownLinkClick(...) path in SkillDetailPage
  • use documentationPath for overview links and previewNode?.path for links rendered inside FilePreviewDialog
  • pass onLinkClick through FilePreviewDialog into MarkdownRenderer
  • extend the existing relative-link page test and real-API Playwright test to cover README.md -> docs/usage.md -> docs/nested.md

Testing

  • make typecheck-web
  • make lint-web
  • make test-backend-app
  • cd web && npx -y node@20.19.0 ./node_modules/vitest/vitest.mjs run
  • cd web && env -u http_proxy -u https_proxy -u HTTP_PROXY -u HTTPS_PROXY -u all_proxy -u ALL_PROXY pnpm exec playwright test e2e/skill-detail-relative-links.spec.ts

Validation Notes

  • make test-frontend still fails on the local default Node v20.18.0 because Vitest/jsdom hits the known html-encoding-sniffer -> @exodus/bytes ESM mismatch; the full suite passes under node@20.19.0
  • make staging currently fails in the web container startup path with /docker-entrypoint.d/20-envsubst-on-templates.sh: can't open /etc/nginx/templates/default.conf.template: Operation not permitted; this happened after backend image build and frontend static build succeeded

Impact

  • nested relative links in previewed markdown files now open the next package file instead of leaving the in-app preview flow
  • external links, absolute links, and same-document anchors keep their previous behavior

Signed-off-by: dongmucat <1127093059@qq.com>
@dongmucat dongmucat force-pushed the fix/relative-link-nested-preview branch from ae08157 to 0134da7 Compare June 24, 2026 08:52
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