feat(web): add toggleable confirmation before unpinning a thread - #7313
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
One finding: the new unpin setting is reset by "Restore defaults" but never reported as changed, so the restore affordance stays disabled and silently omits it. Details inline.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit aee3bb5a12e6c3edf1641096d1f82ec821e6f230. Configure here.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, opt-in web UX safeguard with a false-by-default client setting, backward-compatible persistence, focused tests, and no server or sensitive-domain changes. Existing unpin behavior remains unchanged unless a user explicitly enables the confirmation option. You can add or adjust custom eligibility rules. Learn more. |
36e2c21 to
fd5028e
Compare
There was a problem hiding this comment.
Reviewed the new "Unpin confirmation" setting and its two call sites. The settings row itself composes the shared SettingsRow / Switch / SettingResetButton primitives correctly and the restore-defaults wiring is now complete. Two consistency issues remain, both in apps/web/src.
Posted via Macroscope — UI Consistency
Dismissing prior approval to re-evaluate af7a94c
Accidental unpin from the thread context menu moves the thread out of the pinned section with no way to undo. Show a confirmation dialog that names the thread and defaults to Cancel, matching the existing archive and delete patterns. Applied to both the Sidebar context menu and the chat header action menu.
Matches the delete confirmation pattern by explaining the consequence: 'This will move the thread out of your pinned section.'
The confirmation was only in the context menu switch/case, leaving the pin icon click path uncovered. Move it into attemptUnpin so both the right-click context menu and the pin icon button are guarded.
The chat header action menu called unpinThread directly without the confirmation dialog added to attemptUnpin. Apply the same guard here so both unpin paths are covered.
- Return early when confirmThreadUnpin is enabled but thread/API lookup fails (prevents bypassing the confirmation on stale context menus) - Add confirmThreadUnpin to changedSettingLabels so Restore defaults button enables and the confirmation dialog lists it when dirty - Add settings.confirmThreadUnpin to memo dependency array
- Skip only the dialog when local api is unavailable; fall back to a generic title when the thread lookup misses, so the confirmation setting can never swallow the unpin action (matches confirmAndDeleteThread) - Move unpin-confirmation catalog entry above archive-confirmation so settings search results match rendered row order
a892ade to
7efdd19
Compare
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-13 rebase onto main (2 commits). Main reverted the auto-settle opt-in (#8596 undoing #8321), so the branch drops the ported autoSettleMode machinery and returns to sidebarAutoSettleOnMerge with settling-by-default, keeping only the v2 shell-shape delta in threadSettled. The unpin confirmation (#7313) merges into the v2 thread-actions hook, and the mobile list tests re-sync to main's reverted semantics in v2 shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Closes #6929
What Changed
Added a toggle to ask for confirmation before the "Unpin thread" action fires. The dialog shows the thread name (Unpin thread "Thread Title"?), a description and defaults to Cancel. The user must explicitly confirm to proceed. The confirmation toggle is turned off by default.
Why
The unpin action previously took effect immediately, making it easy to misclick while navigating the thread context menu. Pinned threads are usually curated deliberately, so an accidental unpin means losing a thread from a carefully organized list with no undo. A confirmation step matches the existing pattern used for archive and delete, and prevents accidental disruption.
UI Changes
unpin.mp4
Checklist
Note
Low Risk
Opt-in UX guard around unpin with default false; no auth, data, or server contract changes beyond a new client setting field.
Overview
Adds an optional Unpin confirmation setting (
confirmThreadUnpin, default off) so unpinning can require an explicit dialog before the thread leaves the pinned section.When enabled, sidebar unpin, thread context menu, and
mod+shift+proute throughconfirmAndUnpinThread, which shows the thread title and only callsunpinThreadif the user confirms (or skips the dialog when the setting is off or dialogs are unavailable). Settings → General gets a searchable toggle with reset/dirty tracking, and user docs note the shortcut behavior.Pinning and the underlying unpin mutation are unchanged; behavior stays immediate unless the user turns the setting on.
Reviewed by Cursor Bugbot for commit 08c0935. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add toggleable confirmation before unpinning threads in web app
confirmThreadUnpinboolean field (defaultfalse) toClientSettingsSchemain settings.ts and allows patching viaClientSettingsPatch.confirmAndUnpinThreadin useThreadActions.ts usingrequestThreadUnpinConfirmationto prompt the user vialocalApi.dialogs.confirmwhen enabled; cancellations result in a no-op.unpinThreadforconfirmAndUnpinThreadin ChatView.tsx, Sidebar.tsx, and useThreadActionMenu.ts.confirmAndUnpinThread; withconfirmThreadUnpinleft at its defaultfalse, behavior is unchanged, but any caller still invokingunpinThreaddirectly bypasses the confirmation.Macroscope summarized 08c0935.