[PR #1563] [MERGED] Restore Tauri opener link wiring #5124

Closed
opened 2026-10-22 04:13:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1563
Author: @Xelvanis
Created: 5/29/2026
Status: ✅ Merged
Merged: 5/29/2026
Merged by: @Xelvanis

Base: refactor ← Head: restore/knip-practical-wiring


📝 Commits (4)

  • 71e75e8 Restore Tauri opener link wiring
  • 56c005e Preserve update handoff on link failure
  • 89f3ebf Detect blocked browser external links
  • f125308 Preserve noreferrer on browser link popups

📊 Changes

5 files changed (+183 additions, -4 deletions)

View changed files

📝 src/features/shell/settings/components/SettingsPanel.tsx (+9 -2)
📝 src/features/shell/spotify/components/SpotifyMiniPlayer.tsx (+6 -1)
➕ src/shared/api/external-link-api.test.ts (+98 -0)
➕ src/shared/api/external-link-api.ts (+68 -0)
📝 src/shared/api/integration-utility-api.ts (+2 -1)

📄 Description

Linked issue

Follow-up to #1496.

Why this change

  • After the Knip unused-file cleanup, the full Knip report still flagged @tauri-apps/plugin-opener as unused even though the Rust plugin is installed and permissioned.
  • The practical restore path is to wire external URL flows through the existing Tauri opener binding instead of deleting the dependency.

What changed

  • Added a focused src/shared/api/external-link-api.ts wrapper for external URL opening.
  • The wrapper validates http:, https:, mailto:, and tel: URLs, uses @tauri-apps/plugin-opener in embedded Tauri, and preserves browser window.open behavior outside Tauri.
  • Routed Spotify authorization, Spotify playlist opening, and manual update release opening through the wrapper.
  • Preserved the manual-update handoff text if the release page fails to open.
  • Added focused unit coverage for browser fallback, embedded Tauri opener usage, unsupported protocols, and empty/malformed URLs.

Refactor impact

Primary owner:

Shared API runtime adapter, with shell Settings and Spotify callers.

Impact areas reviewed:

  • Settings update handoff flow
  • Spotify authorization and playlist external links
  • Tauri opener plugin permission surface
  • Browser/hosted fallback behavior
  • Knip dependency report for @tauri-apps/plugin-opener

Boundary notes:

  • Feature code calls a focused shared API wrapper instead of importing the Tauri plugin directly.
  • No engine, Rust command, remote-runtime allowlist, or HTTP dispatch changes.
  • Native opener capability already exists in src-tauri/capabilities/default.json via opener:default.

Pressure points touched:

  • None of ModeSurface, GameSurface, command registration, or import modules were touched.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Automated checks run locally:

  • pnpm test -- src/shared/api/external-link-api.test.ts passed.
  • pnpm typecheck passed.
  • pnpm lint:eslint passed.
  • pnpm check:unused passed.
  • pnpm build passed with the existing large chunk warning.
  • git diff origin/refactor...HEAD --check passed.
  • pnpm exec knip --reporter compact --no-exit-code --no-config-hints no longer reports @tauri-apps/plugin-opener as unused.

Manual/native gap:

  • Native Tauri click-through QA for the actual OS opener handoff was not run.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs were changed; this restores an existing dependency wiring path without changing documented setup or architecture guidance.

UI evidence

No screenshots included; this changes external-link handling, not visible layout.

Summary by CodeRabbit

  • Bug Fixes

    • External links (app updates, Spotify playlists, authorization URLs) now provide improved error handling with user-friendly error messages when opening fails.
  • Tests

    • Added test coverage for external link functionality, validating correct behavior in web browser and embedded application environments.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1563 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/29/2026 **Status:** ✅ Merged **Merged:** 5/29/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `restore/knip-practical-wiring` --- ### 📝 Commits (4) - [`71e75e8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/71e75e8d8a7d2b04e868de78c36240f1f115f42b) Restore Tauri opener link wiring - [`56c005e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/56c005e31f8ab87f0a0f3d22118687d4416e436d) Preserve update handoff on link failure - [`89f3ebf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/89f3ebf0ac1cde09adb3e64854b4c57417b04099) Detect blocked browser external links - [`f125308`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f125308b4c1b79f55a1725235c4704b7f19bdd84) Preserve noreferrer on browser link popups ### 📊 Changes **5 files changed** (+183 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+9 -2) 📝 `src/features/shell/spotify/components/SpotifyMiniPlayer.tsx` (+6 -1) ➕ `src/shared/api/external-link-api.test.ts` (+98 -0) ➕ `src/shared/api/external-link-api.ts` (+68 -0) 📝 `src/shared/api/integration-utility-api.ts` (+2 -1) </details> ### 📄 Description ## Linked issue Follow-up to #1496. ## Why this change - After the Knip unused-file cleanup, the full Knip report still flagged `@tauri-apps/plugin-opener` as unused even though the Rust plugin is installed and permissioned. - The practical restore path is to wire external URL flows through the existing Tauri opener binding instead of deleting the dependency. ## What changed - Added a focused `src/shared/api/external-link-api.ts` wrapper for external URL opening. - The wrapper validates `http:`, `https:`, `mailto:`, and `tel:` URLs, uses `@tauri-apps/plugin-opener` in embedded Tauri, and preserves browser `window.open` behavior outside Tauri. - Routed Spotify authorization, Spotify playlist opening, and manual update release opening through the wrapper. - Preserved the manual-update handoff text if the release page fails to open. - Added focused unit coverage for browser fallback, embedded Tauri opener usage, unsupported protocols, and empty/malformed URLs. ## Refactor impact Primary owner: Shared API runtime adapter, with shell Settings and Spotify callers. Impact areas reviewed: - Settings update handoff flow - Spotify authorization and playlist external links - Tauri opener plugin permission surface - Browser/hosted fallback behavior - Knip dependency report for `@tauri-apps/plugin-opener` Boundary notes: - Feature code calls a focused shared API wrapper instead of importing the Tauri plugin directly. - No engine, Rust command, remote-runtime allowlist, or HTTP dispatch changes. - Native opener capability already exists in `src-tauri/capabilities/default.json` via `opener:default`. Pressure points touched: - None of `ModeSurface`, `GameSurface`, command registration, or import modules were touched. ## Validation - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Automated checks run locally: - `pnpm test -- src/shared/api/external-link-api.test.ts` passed. - `pnpm typecheck` passed. - `pnpm lint:eslint` passed. - `pnpm check:unused` passed. - `pnpm build` passed with the existing large chunk warning. - `git diff origin/refactor...HEAD --check` passed. - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` no longer reports `@tauri-apps/plugin-opener` as unused. Manual/native gap: - Native Tauri click-through QA for the actual OS opener handoff was not run. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No docs were changed; this restores an existing dependency wiring path without changing documented setup or architecture guidance. ## UI evidence No screenshots included; this changes external-link handling, not visible layout. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * External links (app updates, Spotify playlists, authorization URLs) now provide improved error handling with user-friendly error messages when opening fails. * **Tests** * Added test coverage for external link functionality, validating correct behavior in web browser and embedded application environments. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1563?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:13:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5124
No description provided.