Skip to content

fix(studio): open Markdown links in resource preview (#3723) - #3726

Open
RerankerGuo wants to merge 1 commit into
volcengine:mainfrom
RerankerGuo:fix/issue-3723-wiki-link-navigation
Open

fix(studio): open Markdown links in resource preview (#3723)#3726
RerankerGuo wants to merge 1 commit into
volcengine:mainfrom
RerankerGuo:fix/issue-3723-wiki-link-navigation

Conversation

@RerankerGuo

Copy link
Copy Markdown
Contributor

Description

Internal Markdown links rendered by Web Studio's resource preview were rewritten to /api/v1/content/download, which forced an attachment download instead of opening the linked resource in the existing preview. This change routes resolved viking:// links through Web Studio's resource navigator while preserving the download fallback for preview contexts without a navigation callback.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Refs #3723

This addresses the Web Studio navigation symptom. It does not change compile-time relation metadata generation.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Add an optional internal-resource navigation callback to FilePreview and its lazy wrapper.
  • Connect the main Playground preview and both search-preview paths to the existing resource navigator.
  • Keep complete resolved targets such as viking://resources/wiki/target.md instead of replacing them with the attachment download endpoint.
  • Add a click regression test that verifies the .md target is preserved and the resource navigator receives it.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Commands:

NODE_OPTIONS='--localstorage-file=/tmp/openviking-vitest-localstorage' pnpm test
# 31 test files passed, 98 tests passed

pnpm build
# production build succeeded

pnpm exec eslint <six changed files>
pnpm exec prettier --check <six changed files>

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Not applicable; the regression is covered by the component test.

Additional Notes

pnpm exec tsc --noEmit remains blocked by existing errors in generated SDK files and unrelated components on current main; the production Vite build passes.

Route internal viking:// Markdown targets through the existing resource navigator instead of the attachment download endpoint. Preserve download fallback behavior for previews without a navigation callback and add a click regression test.

Test: NODE_OPTIONS='--localstorage-file=/tmp/openviking-vitest-localstorage' pnpm test\nTest: pnpm build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant