Skip to content

upstream 取り込み PR #10: delete dialog checkbox (#3681) + hook 補完#413

Merged
MocA-Love merged 2 commits intomainfrom
upstream/batch-10-remaining
Apr 24, 2026
Merged

upstream 取り込み PR #10: delete dialog checkbox (#3681) + hook 補完#413
MocA-Love merged 2 commits intomainfrom
upstream/batch-10-remaining

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

Summary

PR #9 マージ後の残差分: #3681 persist 'also delete local branch' checkbox in v2 delete dialog を取り込み。

もう 1 件候補の #3697 split workspace-creation router大規模 refactor (workspace-creation.ts を 24 ファイルに split) で fork 独自拡張 (baseBranchSource, PR checkout, fork note 等) と全面衝突するため、本 PR から除外。別 refactor PR で対応予定。

取り込み内容

Conflict 解消

  • dashboardSidebarLocal/schema.ts: upstream の rightSidebarOpen, rightSidebarTab, deleteLocalBranch preferences を schema に追加
  • useV2UserPreferences.ts: setter 3 種類 + RightSidebarTab type export 追加 (fork で欠落していた)
  • useDestroyDialogState.ts: useNavigateAwayFromWorkspace hook を導入し、delete 開始時に現 workspace からナビ脱出。fork の UX (toast なし・楽観削除) と共存

追加補完

useNavigateAwayFromWorkspace hook は PR #2b で取り込んだ 0bc1d0a0e (#3661) で新規追加されたが、ファイル取りこぼしがあった。upstream から以下を補完:

  • apps/desktop/.../DashboardSidebar/hooks/useNavigateAwayFromWorkspace/useNavigateAwayFromWorkspace.ts
  • apps/desktop/.../DashboardSidebar/hooks/useNavigateAwayFromWorkspace/index.ts

除外した commit

Fork 固有機能ヘルスチェック

baseline 一致:

  • 19 tRPC プロシージャ
  • ansi_up, @vscode/ripgrep, @xyflow/react
  • TERMINAL_OPTIONS, SUPERSET_WORKSPACE_NAME, moonshot-ai.kimi-code
  • desktop version 1.5.10, dmg.size=4g
  • v1MigrationState, TiptapPromptEditor

Test plan

  • bun run typecheck pass (27/27)
  • bun run lint pass
  • v2 delete dialog の "also delete local branch" チェック状態が次回開く時に復元される
  • delete 開始時に別 workspace へナビゲート
  • 既存の v1 delete dialog UX に回帰なし

残差分

本 PR マージ後:

  • #3697 split workspace-creation router — 別 refactor PR で (最大のタスク)
  • その他 upstream 継続前進分 — 都度精査

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 28 minutes and 25 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 28 minutes and 25 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8b99a74e-e5f3-4c45-8126-718cd38a55ef

📥 Commits

Reviewing files that changed from the base of the PR and between b79f97c and eed1756.

📒 Files selected for processing (6)
  • apps/desktop/src/renderer/hooks/useV2UserPreferences/useV2UserPreferences.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/hooks/useDestroyDialogState/useDestroyDialogState.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useNavigateAwayFromWorkspace/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useNavigateAwayFromWorkspace/useNavigateAwayFromWorkspace.ts
  • apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.ts
  • packages/host-service/src/trpc/router/workspace-cleanup/workspace-cleanup.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upstream/batch-10-remaining

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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03afeecd41

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// and hiding the row were swallowing the nav otherwise.
// State (deleteBranch) preserved in case we re-open on a
// decision-required error.
navigateAway(workspaceId);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Delay route jump until delete is committed

Calling navigateAway(workspaceId) before destroy(...) means users are redirected even when deletion fails in preflight/teardown (for example, dirty worktree conflict). In those cases the workspace still exists, but the current view has already been switched away, so canceling or retrying now happens from the wrong context and the user loses their place unexpectedly. The navigation should happen only after the delete has actually passed the commit point or succeeded.

Useful? React with 👍 / 👎.

Kitenite and others added 2 commits April 24, 2026 19:09
…e dialog (superset-sh#3681)

* fix(desktop): persist "also delete local branch" checkbox in v2 delete dialog

Wire the v2 delete-workspace dialog into the existing
`settings.getDeleteLocalBranch` / `setDeleteLocalBranch` tRPC pair
(already used by v1 and the Settings → Git page) so the user's last
choice is remembered across deletes instead of always defaulting to
unchecked.

* fix(desktop): persist v2 delete-branch choice via v2UserPreferences; always force

- Move the v2 delete dialog's "Also delete local branch" opt-in off
  the v1 tRPC settings singleton and onto `v2UserPreferences` — the
  same collection used for rightSidebar/link-tier prefs. The choice
  is now persisted the instant the checkbox toggles (optimistic
  update via @tanstack/db) and shared across every workspace's
  delete dialog, not per-instance.
- Drop the per-hook `deleteBranchOverride` state; read straight from
  the singleton preferences row.
- In host-service workspace-cleanup, always use `git branch -D` when
  `deleteBranch` is on — the checkbox is the user's consent, so
  silently refusing unmerged branches (the old `-d`/`-D` gate on
  `force`) just dropped the opt-in and produced confusing warnings.

* chore(desktop): drop redundant setDeleteBranch wrapper in destroy hook

Rename destructured `setDeleteLocalBranch` → `setDeleteBranch` at the
call site instead of wrapping it in a useCallback that did nothing.
Also trim a docstring line that's trivially true now that the opt-in
is a global singleton.
…orkspace + RightSidebarTab type

cherry-pick 時に不足していた部分を補完:
- apps/desktop/.../useNavigateAwayFromWorkspace/ hook を upstream から追加
  (PR #2b 取り込み時の取りこぼし)
- useV2UserPreferences に RightSidebarTab type export を復元
- useDestroyDialogState で hook を使って navigateAway を呼ぶ

typecheck / lint 全 pass。
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

@MocA-Love MocA-Love merged commit 88024d3 into main Apr 24, 2026
12 of 13 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.

2 participants