Skip to content

feat(web): add toggleable confirmation before unpinning a thread - #7313

Merged
shivamhwp merged 14 commits into
pingdotgg:mainfrom
UtkarshUsername:fix/add-unpin-confirmation
Aug 28, 2026
Merged

shivamhwp merged 14 commits into
pingdotgg:mainfrom
UtkarshUsername:fix/add-unpin-confirmation

Conversation

@UtkarshUsername

@UtkarshUsername UtkarshUsername commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

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

image
unpin.mp4

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included screenshots for any UI changes
  • I included a video for animation/interaction changes

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+p route through confirmAndUnpinThread, which shows the thread title and only calls unpinThread if 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

  • Adds confirmThreadUnpin boolean field (default false) to ClientSettingsSchema in settings.ts and allows patching via ClientSettingsPatch.
  • Implements confirmAndUnpinThread in useThreadActions.ts using requestThreadUnpinConfirmation to prompt the user via localApi.dialogs.confirm when enabled; cancellations result in a no-op.
  • Swaps unpinThread for confirmAndUnpinThread in ChatView.tsx, Sidebar.tsx, and useThreadActionMenu.ts.
  • Adds a settings toggle in SettingsPanels.tsx under General, with search indexing in settingsSearch.ts and reset-to-default support.
  • Behavioral Change: all unpin entry points now route through confirmAndUnpinThread; with confirmThreadUnpin left at its default false, behavior is unchanged, but any caller still invoking unpinThread directly bypasses the confirmation.

Macroscope summarized 08c0935.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0f69bbc-f71c-4c24-ab81-09b2f173eb58

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 17, 2026
Comment thread apps/web/src/components/Sidebar.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/web/src/components/settings/SettingsPanels.tsx
@macroscopeapp

macroscopeapp Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 08c0935

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.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 17, 2026
@UtkarshUsername
UtkarshUsername force-pushed the fix/add-unpin-confirmation branch 2 times, most recently from 36e2c21 to fd5028e Compare August 21, 2026 08:18

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread apps/web/src/components/Sidebar.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 21, 2026 08:41

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
@UtkarshUsername
UtkarshUsername force-pushed the fix/add-unpin-confirmation branch from a892ade to 7efdd19 Compare August 24, 2026 14:02
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Aug 28, 2026
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 18, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 18, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 18, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 18, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 18, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 18, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 18, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 18, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 19, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 19, 2026
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>
juliusmarminge added a commit that referenced this pull request Sep 21, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants