Skip to content

fix(desktop): Databaseサイドバーをワークスペースごとにスコープ化#76

Merged
MocA-Love merged 7 commits intomainfrom
fix/database-sidebar-workspace-scope
Apr 4, 2026
Merged

fix(desktop): Databaseサイドバーをワークスペースごとにスコープ化#76
MocA-Love merged 7 commits intomainfrom
fix/database-sidebar-workspace-scope

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

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

Summary

  • database-sidebar.tsのストアをフラット構造からRecord<workspaceId, WorkspaceDatabaseState>に再設計し、DB接続・アクティブ接続・クエリ履歴をワークスペース単位で分離
  • 全アクションにworkspaceIdを第一引数として追加
  • v5→v6マイグレーションで既存データを_unassignedキーに移行し、後方互換性を維持
  • DatabasesView.tsxDatabaseExplorerPane.tsxを新しいワークスペーススコープAPIに適合

Closes #74

Test plan

  • ワークスペースAでDB接続を追加し、ワークスペースBには表示されないことを確認
  • ワークスペースBで別のDB接続を追加し、A側に影響しないことを確認
  • 各ワークスペースのactiveConnectionIdが独立して動作することを確認
  • クエリ履歴がワークスペース単位で分離されることを確認
  • 既存データがマイグレーション後に_unassignedとして全ワークスペースで表示されることを確認
  • DatabaseExplorerPane内での接続一覧が正しくワークスペーススコープされることを確認

Summary by CodeRabbit

リリースノート

  • New Features

    • GitHubワークフロー実行時にカスタム入力フィールドをサポート(テキスト/数値/選択肢/ブール)
    • ワークフロー実行ログをタブで開いて閲覧可能に(失敗ジョブ位置の特定、ログ詳細への遷移)
    • ワークフロー実行状況を定期ポーリングでリアルタイム監視
  • Refactor

    • データベース接続・クエリ履歴をワークスペース単位で管理するように変更(既存データの移行対応)
    • アクションログタブにワークフロー実行IDを保持する拡張

- YAMLパースでworkflow_dispatch inputsを抽出(choice/boolean/string/number対応)
- dispatch APIにinputsパラメータを送信
- WorkflowRunCardにView logsボタンを追加し既存ActionLogsPaneでログ表示
- Configure/Runボタンを横並びレイアウトに改善
ActionLogsPaneStateにrunIdを追加し、workflow dispatchから開いた場合は
getWorkflowRunJobsを3秒ポーリングしてjobリストを動的に更新する。
途中でjobが増えるワークフローでも再オープン不要になる。
DB接続・アクティブ接続・クエリ履歴がグローバル共有されていた問題を修正。
ストアをRecord<workspaceId, State>構造に再設計し、v5→v6マイグレーションで
既存データを_unassignedキーに移行。

Closes #74
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 4, 2026

📝 Walkthrough

Walkthrough

GitHub Actions ワークフローの YAML 解析で workflow_dispatchinputs を抽出して dispatch 時に渡せるようにし、ワークフロー実行ジョブの取得・ポーリングを追加。ActionLogs タブ/ペインに runId を伝播。データベース接続ストアをワークスペース単位に移行。依存に js-yaml を追加。

Changes

Cohort / File(s) Summary
GitHub Actions: サーバー側 tRPC と YAML パース
apps/desktop/src/lib/trpc/routers/workspaces/procedures/git-status.ts
ワークフロー YAML をパースして workflow_dispatchinputs(name/description/required/default/type/options)を抽出し、supportsDispatch と共に返す。dispatchGitHubWorkflowinputs?: Record<string,string> を受け取りフォームで送信。新クエリ getWorkflowRunJobs を追加し GH API のジョブ一覧を検証・正規化して返す。
UI: ワークフロー実行・入力フォーム・ログ閲覧
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx
ワークフローごとの入力 UI(choice/boolean/text)を追加。入力値を収集して dispatchGitHubWorkflow に渡す。実行済みランに対して「View logs」を追加し、getWorkflowRunJobs を取得して ActionLogs タブを開くフローを実装。
ActionLogs タブ/ポーリング統合
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/ActionLogsPane/ActionLogsPane.tsx, apps/desktop/src/renderer/stores/tabs/store.ts, apps/desktop/src/renderer/stores/tabs/types.ts, apps/desktop/src/renderer/stores/tabs/utils.ts, apps/desktop/src/shared/tabs-types.ts
ActionLogsPaneState に optional runId?: number を追加。addActionLogsTab 等のタブ作成 API に runId を通す。ActionLogsPanerunId 時に getWorkflowRunJobs を3秒間隔でポーリングし、全ジョブが非-pending になれば停止(以降はバックグラウンド)。ポーリング結果を優先してジョブ表示を切替。
データベースストア → ワークスペーススコープ化
apps/desktop/src/renderer/stores/database-sidebar.ts, apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/DatabasesView/DatabasesView.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/DatabaseExplorerPane/DatabaseExplorerPane.tsx
Zustand ストアをフラット構造から workspaces: Record<string, WorkspaceDatabaseState> に移行。_unassigned バケットと v5→v6 のマイグレーションを追加。ワークスペーススコープのセレクタ useDatabaseConnections / useDatabaseActiveConnectionId / useDatabaseQueryHistory を導入し、既存コンポーネントは workspaceId を注入するラッパーで呼び出すように変更。
タブストア周りの型とユーティリティ更新
apps/desktop/src/renderer/stores/tabs/types.ts, apps/desktop/src/renderer/stores/tabs/utils.ts, apps/desktop/src/renderer/stores/tabs/store.ts, apps/desktop/src/shared/tabs-types.ts
addActionLogsTab と関連ユーティリティに optional runId?: number を追加し、ActionLogsPaneState.actionLogs.runId を含めてタブ/ペイン生成を流す変更を適用。
依存追加
apps/desktop/package.json
js-yaml (^4.1.1) を dependencies に、@types/js-yaml (^4.0.9) を devDependencies に追加。

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant UI as RepositoryPanel UI
    participant tRPC as tRPC Client
    participant Backend as Git Status Router
    participant GitHub as GitHub API
    participant Store as Tabs Store

    User->>UI: Click "Run" / provide inputs / Click "View logs"
    UI->>tRPC: dispatchGitHubWorkflow(workspaceId, workflowId, ref?, inputs?)
    tRPC->>Backend: dispatch request (form inputs)
    Backend->>GitHub: gh api .../dispatches
    GitHub-->>Backend: 204 accepted
    Backend-->>tRPC: dispatch response

    alt View logs / open run
        UI->>tRPC: getWorkflowRunJobs.fetch(workspaceId, runId)
        tRPC->>Backend: request run jobs
        Backend->>GitHub: gh api .../runs/{runId}/jobs
        GitHub-->>Backend: jobs payload
        Backend-->>tRPC: parsed jobs
        tRPC-->>UI: jobs
        UI->>Store: addActionLogsTab(workspaceId, jobs, failedIdx?, runId)
    end
Loading
sequenceDiagram
    actor ActionLogs as ActionLogsPane
    participant tRPC as tRPC Client
    participant Backend as Git Status Router
    participant GitHub as GitHub API

    ActionLogs->>tRPC: getWorkflowRunJobs (enabled when runId)
    loop every 3s while any job.status == "pending"
        tRPC->>Backend: fetch run jobs
        Backend->>GitHub: gh api .../runs/{runId}/jobs
        GitHub-->>Backend: updated jobs
        Backend-->>tRPC: parsed jobs
        tRPC-->>ActionLogs: updated jobs
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 YAML の葉っぱ嗅ぎ分けて
ボタンでぴょんとワークフロー走らせる
ポーリングで待って、ログを掘り当て
ワークスペースごとに整頓したよ
🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning PRに含まれるGitHubワークフロー実行・監視機能の追加(git-status.ts、RepositoryPanel.tsx等)はissue #74のスコープ外であり、Databaseサイドバーのスコープ化とは直接関連がない。 ワークフロー実行機能の変更を別のPRに分離し、このPRをDatabaseサイドバーのワークスペーススコープ化のみに限定することを推奨する。
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PRタイトルはデータベースサイドバーのワークスペーススコープ化という主な変更を明確に要約しており、実装内容と一致している。
Description check ✅ Passed PR説明はテンプレート構造に部分的に従い、要約とテストプランは充実しているが、必須の『Type of Change』セクションと『Testing』セクションが形式的に不完全である。
Linked Issues check ✅ Passed PR変更はリンク済みissue #74の要件「Databaseタブの状態をワークスペースごとに分離する」を完全に満たしており、接続・アクティブ接続・クエリ履歴のワークスペーススコープ化とマイグレーション実装が含まれている。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/database-sidebar-workspace-scope

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.

配列を返すセレクタが毎回新しい参照を生成し、zustandの等値チェックが
常にfalseとなりMaximum update depth exceededが発生していた。
shallow comparatorと安定した空配列参照で修正。
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
apps/desktop/src/renderer/stores/database-sidebar.ts (1)

151-156: getWorkspace ヘルパーで毎回新しいオブジェクト参照を返す可能性があります。

emptyWorkspaceState をそのまま返すと、Zustand のセレクタ最適化において毎回同じ参照が返されるため問題ありませんが、将来的にこのヘルパーが拡張される場合は注意が必要です。現状は問題ありません。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/desktop/src/renderer/stores/database-sidebar.ts` around lines 151 - 156,
getWorkspace currently returns state.workspaces[workspaceId] ??
emptyWorkspaceState; ensure you keep returning the shared emptyWorkspaceState
constant (do not create a new object or clone) so selectors keep stable
references; if you later need to extend or mutate the returned workspace, change
call sites to create a copy only when modifying (or explicitly clone inside a
new function) to preserve selector optimization for getWorkspace and avoid
returning a fresh reference each call.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx`:
- Around line 361-366: workflowInputValues is a single shared Record so inputs
bleed between workflows; change its shape to map by workflow id (e.g.,
useState<Record<number, Record<string,string>>>({})) and update
setWorkflowInputValues usage to read/write under workflow.id, and when
dispatching or calling the Run handler (check usages that reference
expandedWorkflowId and any run/dispatch functions), only send the payload from
workflowInputValues[workflow.id] and guard dispatches with expandedWorkflowId
=== workflow.id to avoid sending another workflow's inputs.
- Around line 591-598: The code currently sends inputs with empty-string values
(inputs -> filteredInputs -> dispatchWorkflowMutation.mutateAsync), which
prevents distinguishing "omitted" vs empty; change the filtering so that before
calling dispatchWorkflowMutation.mutateAsync you construct filteredInputs by
removing any key whose value is exactly "" (and also drop null/undefined), e.g.
transform inputs into an object that only includes entries with non-empty
values, then pass that as inputs; keep existing workflowRef.trim() logic and
ensure required-field validation is performed separately (i.e., do not rely on
this filter to enforce requiredness).
- Around line 629-643: The current logic prevents opening the ActionLogs tab for
runs with no jobs because the jobs.length === 0 check returns early; instead,
allow creating the tab when a runId exists so ActionLogsPane can poll for jobs
itself. Remove or change the early-return branch around getWorkflowRunJobs.fetch
so addActionLogsTab(workspaceId, jobs, failedIdx >= 0 ? failedIdx : undefined,
runId) is called even if jobs is an empty array (you may still show a
non-blocking toast but do not abort creating the tab). This touches
getWorkflowRunJobs.fetch result handling and the call to addActionLogsTab and
relies on ActionLogsPane to handle runId-based polling.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/DatabasesView/DatabasesView.tsx`:
- Around line 856-862: The addConnection callback currently returns a forced
cast undefined as SavedDatabaseConnection when workspaceId is missing, which is
unsafe; update addConnection (and similarly addQueryHistoryItem) to either throw
an explicit error early when workspaceId is undefined (so callers never receive
an invalid SavedDatabaseConnection) or change the callback signature/return type
to SavedDatabaseConnection | undefined and propagate that type to callers;
locate the functions addConnection and addQueryHistoryItem and the call to
storeAddConnection and adjust the control flow and types accordingly so no
undefined is cast to SavedDatabaseConnection.

---

Nitpick comments:
In `@apps/desktop/src/renderer/stores/database-sidebar.ts`:
- Around line 151-156: getWorkspace currently returns
state.workspaces[workspaceId] ?? emptyWorkspaceState; ensure you keep returning
the shared emptyWorkspaceState constant (do not create a new object or clone) so
selectors keep stable references; if you later need to extend or mutate the
returned workspace, change call sites to create a copy only when modifying (or
explicitly clone inside a new function) to preserve selector optimization for
getWorkspace and avoid returning a fresh reference each call.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4517d24a-e939-48c0-a5d9-011ef2d66a65

📥 Commits

Reviewing files that changed from the base of the PR and between feb35ce and 99b3266.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • apps/desktop/package.json
  • apps/desktop/src/lib/trpc/routers/workspaces/procedures/git-status.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/ActionLogsPane/ActionLogsPane.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/DatabaseExplorerPane/DatabaseExplorerPane.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/DatabasesView/DatabasesView.tsx
  • apps/desktop/src/renderer/stores/database-sidebar.ts
  • apps/desktop/src/renderer/stores/tabs/store.ts
  • apps/desktop/src/renderer/stores/tabs/types.ts
  • apps/desktop/src/renderer/stores/tabs/utils.ts
  • apps/desktop/src/shared/tabs-types.ts

Comment on lines +361 to +366
const [expandedWorkflowId, setExpandedWorkflowId] = useState<number | null>(
null,
);
const [workflowInputValues, setWorkflowInputValues] = useState<
Record<string, string>
>({});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

ワークフロー入力が別 workflow 間で混線します。

workflowInputValues が 1 つの共有 Record<string, string> のままなので、A の Conf を開いた状態で B の Run を押すと、B にも A の入力が渡ります。入力値は workflow.id ごとに保持するか、少なくとも expandedWorkflowId === workflow.id のときだけその workflow の値を dispatch しないと、別 workflow に不正な payload を送ります。

Also applies to: 1251-1258

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx`
around lines 361 - 366, workflowInputValues is a single shared Record so inputs
bleed between workflows; change its shape to map by workflow id (e.g.,
useState<Record<number, Record<string,string>>>({})) and update
setWorkflowInputValues usage to read/write under workflow.id, and when
dispatching or calling the Run handler (check usages that reference
expandedWorkflowId and any run/dispatch functions), only send the payload from
workflowInputValues[workflow.id] and guard dispatches with expandedWorkflowId
=== workflow.id to avoid sending another workflow's inputs.

Comment on lines +591 to 598
const filteredInputs =
inputs && Object.keys(inputs).length > 0 ? inputs : undefined;
const result = await dispatchWorkflowMutation.mutateAsync({
workspaceId,
workflowId,
ref: workflowRef.trim() || undefined,
inputs: filteredInputs,
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

空欄 input をそのまま送ると「未指定」を表現できません。

この分岐は key 数しか見ていないので、設定 UI を一度開いた workflow は未入力の optional field まで "" で送られます。空欄は payload から落として、required だけ別途バリデーションしないと、省略と空文字が区別できません。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx`
around lines 591 - 598, The code currently sends inputs with empty-string values
(inputs -> filteredInputs -> dispatchWorkflowMutation.mutateAsync), which
prevents distinguishing "omitted" vs empty; change the filtering so that before
calling dispatchWorkflowMutation.mutateAsync you construct filteredInputs by
removing any key whose value is exactly "" (and also drop null/undefined), e.g.
transform inputs into an object that only includes entries with non-empty
values, then pass that as inputs; keep existing workflowRef.trim() logic and
ensure required-field validation is performed separately (i.e., do not rely on
this filter to enforce requiredness).

Comment on lines +629 to +643
const jobs = await trpcUtils.workspaces.getWorkflowRunJobs.fetch({
workspaceId,
runId,
});
if (jobs.length === 0) {
toast.error("No jobs found for this workflow run");
return;
}
const failedIdx = jobs.findIndex((j) => j.status === "failure");
addActionLogsTab(
workspaceId,
jobs,
failedIdx >= 0 ? failedIdx : undefined,
runId,
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

ジョブ未生成の run で View logs が失敗します。

ActionLogsPanerunId があれば自前でジョブをポーリングできますが、ここで jobs.length === 0 を弾いているせいで queued 直後の run を開けません。空配列でも runId 付きでタブを作れば、そのままジョブ出現を待てます。

💡 修正例
 		try {
 			const jobs = await trpcUtils.workspaces.getWorkflowRunJobs.fetch({
 				workspaceId,
 				runId,
 			});
-			if (jobs.length === 0) {
-				toast.error("No jobs found for this workflow run");
-				return;
-			}
 			const failedIdx = jobs.findIndex((j) => j.status === "failure");
 			addActionLogsTab(
 				workspaceId,
 				jobs,
 				failedIdx >= 0 ? failedIdx : undefined,
 				runId,
 			);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/RepositoryPanel/RepositoryPanel.tsx`
around lines 629 - 643, The current logic prevents opening the ActionLogs tab
for runs with no jobs because the jobs.length === 0 check returns early;
instead, allow creating the tab when a runId exists so ActionLogsPane can poll
for jobs itself. Remove or change the early-return branch around
getWorkflowRunJobs.fetch so addActionLogsTab(workspaceId, jobs, failedIdx >= 0 ?
failedIdx : undefined, runId) is called even if jobs is an empty array (you may
still show a non-blocking toast but do not abort creating the tab). This touches
getWorkflowRunJobs.fetch result handling and the call to addActionLogsTab and
relies on ActionLogsPane to handle runId-based polling.

マイグレーション後の_unassigned内の接続を削除・更新できない問題を修正。
removeConnection, updateConnection, removeQueryHistoryItem,
clearQueryHistoryForConnectionが_unassignedバケットも操作するように変更。
addConnectionの重複チェックも_unassignedを含めるよう修正。
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/DatabasesView/DatabasesView.tsx (1)

856-900: エラーハンドリングの一貫性がありません。

addConnectionaddQueryHistoryItemworkspaceId が未定義の場合に例外をスローしますが、他のラッパー関数(updateConnection, removeConnection, removeQueryHistoryItem, clearQueryHistoryForConnection, setActiveConnectionId)は null または undefined を返して静かに失敗します。

例えば、removeConnection(3001行目で使用)が静かに失敗すると、ユーザーが「削除」ボタンをクリックしても何も起きず、混乱を招く可能性があります。

♻️ 一貫したエラーハンドリングの提案
 const removeConnection = useCallback(
-  (id: string) =>
-    workspaceId ? storeRemoveConnection(workspaceId, id) : undefined,
+  (id: string) => {
+    if (!workspaceId) {
+      console.warn("removeConnection called without workspaceId");
+      return;
+    }
+    return storeRemoveConnection(workspaceId, id);
+  },
   [workspaceId, storeRemoveConnection],
 );

同様のパターンを updateConnection, removeQueryHistoryItem, clearQueryHistoryForConnection, setActiveConnectionId にも適用し、少なくとも警告をログに出力することで、デバッグを容易にすることを検討してください。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/DatabasesView/DatabasesView.tsx`
around lines 856 - 900, 他のラッパー関数(updateConnection, removeConnection,
removeQueryHistoryItem, clearQueryHistoryForConnection, setActiveConnectionId)が
workspaceId 不在時に静かに null/undefined を返すため一貫性がないので、addConnection /
addQueryHistoryItem と同様に workspaceId が無い場合は明示的に例外を投げするか、少なくとも processLogger.warn
で警告を出すよう修正してください;該当するラッパー(updateConnection → storeUpdateConnection,
removeConnection → storeRemoveConnection, removeQueryHistoryItem →
storeRemoveQueryHistoryItem, clearQueryHistoryForConnection →
storeClearQueryHistoryForConnection, setActiveConnectionId →
storeSetActiveConnectionId)内で workspaceId チェックを追加し、存在しなければ throw new Error("...
called without workspaceId") もしくは logger を呼ぶ形に揃えてください。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/DatabasesView/DatabasesView.tsx`:
- Around line 856-900: 他のラッパー関数(updateConnection, removeConnection,
removeQueryHistoryItem, clearQueryHistoryForConnection, setActiveConnectionId)が
workspaceId 不在時に静かに null/undefined を返すため一貫性がないので、addConnection /
addQueryHistoryItem と同様に workspaceId が無い場合は明示的に例外を投げするか、少なくとも processLogger.warn
で警告を出すよう修正してください;該当するラッパー(updateConnection → storeUpdateConnection,
removeConnection → storeRemoveConnection, removeQueryHistoryItem →
storeRemoveQueryHistoryItem, clearQueryHistoryForConnection →
storeClearQueryHistoryForConnection, setActiveConnectionId →
storeSetActiveConnectionId)内で workspaceId チェックを追加し、存在しなければ throw new Error("...
called without workspaceId") もしくは logger を呼ぶ形に揃えてください。

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b54ec52f-bb2d-4d34-b4b1-cba1228719fb

📥 Commits

Reviewing files that changed from the base of the PR and between 9011935 and 6a5c35c.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/DatabasesView/DatabasesView.tsx
  • apps/desktop/src/renderer/stores/database-sidebar.ts
✅ Files skipped from review due to trivial changes (1)
  • apps/desktop/src/renderer/stores/database-sidebar.ts

@MocA-Love MocA-Love merged commit 3128483 into main Apr 4, 2026
14 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.

[bug] Databaseタブがワークスペースごとになっておらず、すべてのタブで共有されてしまっている

1 participant