Skip to content

fix: render http(s) source references as external links#556

Merged
nashsu merged 2 commits into
nashsu:mainfrom
AndrewDongminYoo:fix/http-url-source-warning
Jul 15, 2026
Merged

fix: render http(s) source references as external links#556
nashsu merged 2 commits into
nashsu:mainfrom
AndrewDongminYoo:fix/http-url-source-warning

Conversation

@AndrewDongminYoo

Copy link
Copy Markdown
Contributor

Problem

Wiki pages sometimes carry an http(s) URL in their sources: frontmatter — e.g. an LLM-emitted web citation. The frontmatter panel resolves every sources: entry against raw/sources/ and, when no local file matches, renders the card with a dashed border and an amber "Source not found in raw/sources/" warning.

A URL is not a missing local file, so this flags a valid external reference as broken. The existing data model keeps sources: for local file references (ingest, web-clip, and the deep-research import in #178 all materialize content into raw/sources/), so URL entries only reach sources: via LLM output or manual edits — and today they degrade to a misleading warning rather than a usable link.

Change

  • Add resolveSourceReference() in wiki-page-resolver.ts that classifies a sources: entry as:
    • external — an http:/https: URL (validated via new URL())
    • local — resolves to a file under raw/sources/ or wiki/sources/
    • missing — neither
  • Render external sources as clickable cards opened in the system browser via tauri-plugin-opener (same pattern as the About / API-server links), with no warning icon.
  • local and missing behavior is unchanged. Non-http URL-like values (e.g. javascript:) are treated as missing, not external.

Test plan

  • npm run test:mocks — 1600 tests pass, incl. new resolveSourceReference cases (http/https external, local, missing, null source root, javascript: rejection)
  • npm run typecheck — clean
  • Manual: open a wiki page whose sources: contains an https:// URL → the card renders as an external link and opens the browser on click, with no amber "not found" warning

Wiki pages occasionally carry an http(s) URL in their `sources:`
frontmatter (e.g. an LLM-emitted web citation). The frontmatter panel
resolved every source against raw/sources/ and flagged any non-file
entry with a "Source not found" warning — but a URL is not a missing
local file, so the amber warning was misleading.

Add `resolveSourceReference()` that classifies a source as external
(http/https via URL parsing), local, or missing, and render external
sources as clickable cards opened through the system browser
(tauri-plugin-opener) instead of not-found warnings. Non-http URL-like
values (e.g. `javascript:`) stay classified as missing.
@nashsu
nashsu merged commit e93bb17 into nashsu:main Jul 15, 2026
3 checks passed
@AndrewDongminYoo
AndrewDongminYoo deleted the fix/http-url-source-warning branch July 15, 2026 06:15
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