Skip to content

Inkeep OSS Sync#624

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jul 14, 2026
Merged

Inkeep OSS Sync#624
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

Copybara-translated commits for Inkeep OSS Sync. Rebase-merge this PR so the prepared commits land directly on public main.

…d of OS browser (#617) (#2624)

* [wip] claim work on fix-issue-617-external-links

* test(link-authoring): RED tests for #617 — external links must reach the OS browser from every window

* fix(desktop): attach external-link safety net at the window factory (#617)

Move attachAssetSafetyNet from the two index.ts call sites (openProject,
openEphemeralFile) into WindowManager.attachSafetyNet, so every editor
window created by any factory path (spawn + ephemeral + attach, including
the restart -> recreate window) inherits the deny+OS-delegate net. Closes
the creation-path coverage gap where a net-less window could render an
external link in a child OpenKnowledge window.

Adds two optional deps (openExternal, openAsset) to WindowManagerDeps,
wired from index.ts; a truthy-both guard keeps existing unit harnesses
that inject neither dep unaffected.

* fix(app): route WYSIWYG external link clicks through the desktop bridge (#617)

internal-link.ts handlePrimary case 'external' now calls openExternalUrl
(bridge-first, window.open web fallback) instead of openHashHrefInNewTab,
so a desktop click reaches the OS default browser instead of Electron's
default new-window (an in-app child BrowserWindow). Symmetric with the
graph view. The isSafeNavigationUrl gate stays because openExternalUrl
does not filter schemes.

* fix(app): route sibling external-link surfaces through the bridge (#617)

Migrate the remaining renderer external-open surfaces off
openHashHrefInNewTab onto openExternalUrl (bridge-first, window.open web
fallback), so every editor external-link click reaches the OS browser
rather than depending on the main-process net:

- wiki-link.ts WYSIWYG [[wikilink]] external branch (gate already present)
- wiki-link-source.ts source-mode [[wikilink]] external branch (gate ADDED
  — openExternalUrl does not filter schemes, unlike openHashHrefInNewTab)
- internal-link-helpers.ts navigateToMarkdownTarget external branch, split
  out from the asset fallthrough with an isSafeNavigationUrl gate ADDED

Unit pins: wiki-link.external-open.test.ts mounts the real WikiLink
NodeView and drives handlePrimary; internal-link-helpers.test.ts pins
navigateToMarkdownTarget's external routing (bridge / web / unsafe). The
CM6 source-mode click handlers gate on posAtCoords (null in jsdom) so
their event-plumbing stays Playwright-covered, per convention.

* fix(open-knowledge): address local review — changeset, catch bridge rejections, test cleanup + coverage (#617)

* refactor(app): internalize the external-link scheme gate in openExternalUrl (#617 review)

Address cloud review: make the isSafeNavigationUrl security gate structural
rather than repeated at 7 call sites. openExternalUrl now refuses unsafe
schemes internally (defense-in-depth), so no caller can route a
javascript:/data: scheme to window.open by forgetting the check. Dropped the
5 redundant imperative caller-gates; kept the 2 that use the boolean for
control flow (link chips falling through to their edit panel). Also added the
missing .catch to dispatchExternalLinkClick (While-You're-Here).

* docs(app): refresh stale scheme-gate comments after gate internalization (#617 review)

* docs(app): refresh remaining graph-view scheme-gate comments (#617 review)

GitOrigin-RevId: 07baa786f1bc6333053f9e4c4bd6ee6e5af19147
@inkeep-oss-sync inkeep-oss-sync Bot merged commit f5dd24b into main Jul 14, 2026
@inkeep-oss-sync inkeep-oss-sync Bot deleted the copybara/sync branch July 14, 2026 14:59
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