Skip to content

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

Open
UtkarshUsername wants to merge 12 commits into
pingdotgg:mainfrom
UtkarshUsername:fix/add-unpin-confirmation
Open

feat(web): add toggleable confirmation before unpinning a thread#7313
UtkarshUsername wants to merge 12 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
Client-only UX setting with a false default; no auth, data, or unpin API changes.

Overview
Adds optional confirmation before unpinning a thread, matching archive/delete. New confirmThreadUnpin client setting defaults to off, so current one-click unpin stays unless the user enables it.

When on, sidebar unpin and the thread action menu show a dialog with the thread title before calling unpinThread. General settings gets a searchable toggle with reset.

Reviewed by Cursor Bugbot for commit a8788b9. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add toggleable confirmation before unpinning a thread

  • Adds a new confirmThreadUnpin boolean to ClientSettingsSchema (default false) and its patch schema in settings.ts
  • When enabled, both the sidebar attemptUnpin callback in Sidebar.tsx and the 'unpin' handler in useThreadActionMenu.ts show a confirmation dialog (including thread title) before calling unpinThread
  • Exposes a toggle in the General settings panel in SettingsPanels.tsx with reset support and a searchable entry in settingsSearch.ts
  • Behavioral Change: unpinning now prompts a confirmation dialog when confirmThreadUnpin is true; canceling aborts the unpin. The setting defaults to false, preserving existing behavior unless explicitly enabled

Macroscope summarized a8788b9.

@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: 85013f9f-5e27-4e20-ae9c-7d425d40f184

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

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.

@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

@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 aee3bb5. 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: Not approved

Macroscope's review found this PR not approvable — This PR introduces a new user-facing feature (toggleable confirmation dialog before unpinning threads) with new settings, UI controls, and dialog workflows. While well-scoped and defaulting to off, new feature capabilities warrant human review.

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 from 377efb2 to 57ba837 Compare August 20, 2026 12:26
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
@UtkarshUsername
UtkarshUsername force-pushed the fix/add-unpin-confirmation branch 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
Comment thread apps/web/src/components/settings/SettingsPanels.tsx
- 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
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 21, 2026 08:41

Dismissing prior approval to re-evaluate af7a94c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 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.

1 participant