Skip to content

Ship deep links#50

Merged
saddlepaddle merged 1 commit intomainfrom
ship-deep-link
Nov 9, 2025
Merged

Ship deep links#50
saddlepaddle merged 1 commit intomainfrom
ship-deep-link

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Nov 9, 2025

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • New Features
    • Deep linking now supported in Superset Desktop using the superset:// custom protocol, enabling users to open the app directly from external URLs.
    • Added comprehensive deep linking documentation covering usage examples, security considerations, testing steps, and troubleshooting across all supported platforms.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 9, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request implements deep linking support for the Superset Desktop application. It adds protocol scheme registration in the Electron Builder configuration, handles incoming deep link URLs in the main process via a dedicated manager, exposes deep link URLs through an IPC channel, and provides a React hook for renderer-side consumption via polling.

Changes

Cohort / File(s) Summary
Documentation
apps/desktop/docs/DEEP_LINKING.md
New documentation file detailing deep linking implementation, including protocol registration, URL handling flow, usage examples, IPC channels, development workflow, and testing procedures.
Electron Configuration
apps/desktop/electron-builder.ts
Adds protocols configuration object with name and schemes (["superset"]) to enable protocol registration.
Deep Link Manager
apps/desktop/src/main/lib/deep-link-manager.ts
New module implementing DeepLinkManager class with methods to store, retrieve, and clear deep link URLs, exported as a singleton instance.
IPC Channel Definition
apps/desktop/src/shared/ipc-channels.ts
Adds new "deep-link-get-url" IPC channel mapping with void request and string | null response.
IPC Handler Registration
apps/desktop/src/main/lib/deep-link-ipcs.ts
New module exporting registerDeepLinkIpcs() function that sets up the IPC handler for the deep-link-get-url channel.
Main Process Integration
apps/desktop/src/main/index.ts
Registers PROTOCOL_SCHEME as app's default protocol client, listens for macOS open-url events, routes URLs to deepLinkManager, and initializes port before app readiness.
Window Setup
apps/desktop/src/main/windows/main.ts
Calls registerDeepLinkIpcs() during IPC setup in MainWindow lifecycle.
Renderer Hook
apps/desktop/src/renderer/hooks/useDeepLink.ts
New React hook that polls for deep link URLs via IPC with configurable interval, safely handling component unmounts.

Sequence Diagram

sequenceDiagram
    participant User as External App
    participant MainProc as Main Process
    participant Manager as Deep Link Manager
    participant IPC as IPC Channel
    participant Renderer as Renderer Process
    participant Hook as useDeepLink Hook

    User->>MainProc: Trigger deep link (open-url event)
    MainProc->>Manager: setUrl(deepLinkUrl)
    Manager->>Manager: Store URL + log
    
    rect rgb(200, 220, 255)
        Note over Hook: Poll Loop (every 1000ms)
        Hook->>IPC: invoke("deep-link-get-url")
    end
    
    IPC->>Manager: getAndClearUrl()
    Manager-->>IPC: Return stored URL + clear
    IPC-->>Hook: URL or null
    
    alt URL received
        Hook->>Hook: Log URL
        Hook->>Renderer: handler(url) callback
        Renderer->>Renderer: Process deep link
    else No URL
        Hook->>Hook: Continue polling
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Protocol registration flow: Verify PROTOCOL_SCHEME is correctly set and registered for both development and production builds
  • State management: Ensure deepLinkManager properly handles concurrent URL assignments and clearing without race conditions
  • IPC polling pattern: Confirm the polling mechanism in useDeepLink safely handles component unmounts and prevents memory leaks
  • Platform-specific handling: Verify open-url event listener works correctly for macOS and that Windows/Linux alternatives (if needed) are properly handled

Poem

🐰 Deep links now bloom in your desktop app,
URLs hoppin' through protocols, closing the gap!
With managers managing and hooks that compile,
The rabbits are racing—this code's got style!
From main process to renderer, the path's crystal clear,
hip-hop! 🎉 Your deep linking is here!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ship-deep-link

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c898e5e and 801d95b.

📒 Files selected for processing (8)
  • apps/desktop/docs/DEEP_LINKING.md (1 hunks)
  • apps/desktop/electron-builder.ts (1 hunks)
  • apps/desktop/src/main/index.ts (1 hunks)
  • apps/desktop/src/main/lib/deep-link-ipcs.ts (1 hunks)
  • apps/desktop/src/main/lib/deep-link-manager.ts (1 hunks)
  • apps/desktop/src/main/windows/main.ts (2 hunks)
  • apps/desktop/src/renderer/hooks/useDeepLink.ts (1 hunks)
  • apps/desktop/src/shared/ipc-channels.ts (2 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@saddlepaddle saddlepaddle merged commit 972835c into main Nov 9, 2025
1 of 5 checks passed
@Kitenite Kitenite deleted the ship-deep-link branch November 11, 2025 18:18
@coderabbitai coderabbitai Bot mentioned this pull request Nov 19, 2025
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