Skip to content

Fix/deep link#63

Merged
MocA-Love merged 2 commits intomainfrom
fix/deep-link
Apr 3, 2026
Merged

Fix/deep link#63
MocA-Love merged 2 commits intomainfrom
fix/deep-link

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

@MocA-Love MocA-Love commented Apr 3, 2026

Description

Related Issues

Type of Change

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

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

リリースノート

  • 新機能

    • ディープリンクナビゲーションの拡張:ワークスペースへのリンク時に、ファイルパス、行番号、列番号を指定できるようになりました。
    • ワークスペース内のタブ・ペイン・ファイルの自動アクティベーション機能を改善しました。
    • 通知からのワークスペースナビゲーション処理がより堅牢になりました。
  • 改善

    • ナビゲーション意図の状態管理システムを最適化しました。

…via a dedicated store and hydration tracking
…t daemon

The terminal-host daemon runs with ELECTRON_RUN_AS_NODE=1 and cannot
resolve the electron module. Vite's code splitting bundled electron-dependent
code (via local-db) into a shared chunk loaded by terminal-host, causing
immediate crash on startup (ELECTRON-X, ELECTRON-Y, ELECTRON-10).

Extract buildTerminalEnv and its electron/local-db dependencies into
env-terminal.ts, keeping env.ts electron-free so terminal-host/session.ts
can safely import buildSafeEnv without pulling in electron.
@MocA-Love MocA-Love self-assigned this Apr 3, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b26cf25a-e726-4ef8-9dea-60fa225fc647

📥 Commits

Reviewing files that changed from the base of the PR and between 6c007e2 and a2df13b.

📒 Files selected for processing (12)
  • apps/desktop/src/main/lib/terminal/daemon/daemon-manager.test.ts
  • apps/desktop/src/main/lib/terminal/daemon/daemon-manager.ts
  • apps/desktop/src/main/lib/terminal/env-terminal.ts
  • apps/desktop/src/main/lib/terminal/env.test.ts
  • apps/desktop/src/main/lib/terminal/env.ts
  • apps/desktop/src/main/lib/terminal/session.ts
  • apps/desktop/src/renderer/index.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx
  • apps/desktop/src/renderer/stores/deep-link-navigation.ts
  • apps/desktop/src/renderer/stores/tabs/store.ts
  • apps/desktop/src/renderer/stores/tabs/types.ts
  • apps/desktop/src/renderer/stores/tabs/useAgentHookListener.ts

📝 Walkthrough

Walkthrough

端末環境構築ロジックを新しい専用モジュールenv-terminal.tsに移行し、ディープリンク経由のナビゲーション機能を実装。新しいZustandストアで保留中のワークスペースインテントを管理し、タブ/ペーン/ファイル開封を段階的に処理。

Changes

コホート / ファイル(s) 変更内容
端末環境マイグレーション
daemon-manager.ts, daemon-manager.test.ts, env.ts, env.test.ts, session.ts
buildTerminalEnvremoveAppEnvVars../envから新しい../env-terminalモジュールへ移行。インポート パスを更新し、既存の呼び出しサイトの動作は変わらず。
端末環境新モジュール
env-terminal.ts
プロセス環境のサニタイズ、macOSのSSL証明書バンドル検出、キャッシング機構を含む新しいモジュル。buildTerminalEnvが環境変数をセットアップし、ワークスペース/テーマ/ロケール設定を統合。
ディープリンクナビゲーション ストア
deep-link-navigation.ts
新しいZustandストアで保留中のワークスペースナビゲーション意図を管理。30秒のTTL付きで、深いリンク/通知/ルート検索からのインテント追跡と処理完了フラグをサポート。
ディープリンク処理
index.tsx
ディープリンク ハンドラーの改善。consumeWorkspaceDeepLinkで クエリパラメータ(tabIdpaneIdfilelinecolumn)をパースし、ストアに保存。URL正規化を実施。
ワークスペースページ
workspace/$workspaceId/page.tsx
ディープリンク処理をクエリパラメータ駆動から保留中インテント ワークフローへリファクタリング。段階的な処理:タブ選択 → ファイル開封 → インテント クリア。パス検証と有効期限処理を追加。
タブストア拡張
stores/tabs/store.ts, stores/tabs/types.ts
hasHydratedフラグを追加して水和状態を追跡。ストレージの永続化でpartialize関数を使用して特定フィールドのみ保存。
通知ハンドリング
useAgentHookListener.ts
FOCUS_TAB通知の処理で保留中ワークスペースインテントをストアに記録。URL クエリパラメータではなくストアを経由して情報を渡す。

Sequence Diagram

sequenceDiagram
    participant Router as ルーター
    participant DeepLinkHandler as ディープリンク<br/>ハンドラー
    participant Store as ナビゲーション<br/>ストア
    participant WorkspacePage as ワークスペース<br/>ページ
    participant TabsStore as タブ<br/>ストア
    participant FileViewer as ファイル<br/>ビューア

    Router->>DeepLinkHandler: onResolved イベント
    DeepLinkHandler->>DeepLinkHandler: consumeWorkspaceDeepLink(path)
    DeepLinkHandler->>Store: replacePendingWorkspaceIntent({...})
    Store->>DeepLinkHandler: インテント保存
    DeepLinkHandler->>Router: navigate(resolvedPath)
    
    Router->>WorkspacePage: ワークスペース<br/>ページ表示
    WorkspacePage->>Store: pendingIntent 監視開始
    
    par タブ水和待機
        TabsStore->>TabsStore: hasHydrated = true
    and ペーン準備
        WorkspacePage->>WorkspacePage: タブ/ペーン処理
    end
    
    WorkspacePage->>TabsStore: 対象タブを選択
    WorkspacePage->>Store: markTabHandled()
    
    Store-->>WorkspacePage: tabHandled 更新
    WorkspacePage->>FileViewer: ファイル開封<br/>(line/column 指定)
    FileViewer->>FileViewer: パス検証
    WorkspacePage->>Store: markFileHandled()
    
    Store-->>WorkspacePage: fileHandled 更新
    WorkspacePage->>Store: clearPendingIntent()
    Store->>Store: インテント クリア
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 深いリンクの糸をたどり
ワークスペースへ舞い降りて
タブ、ペーン、ファイルと
段階を踏んで開かれゆく
環境は整い、道は拓く

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/deep-link

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@MocA-Love MocA-Love marked this pull request as ready for review April 3, 2026 23:46
@MocA-Love MocA-Love merged commit 85511b8 into main Apr 3, 2026
6 checks passed
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