Skip to content

Fix dead dropdown menu actions after base-ui migration (Delete chat, Pin, Sign out)#186

Merged
chloeilabs merged 1 commit into
mainfrom
fix/delete-chat-menu-onclick
Jun 16, 2026
Merged

Fix dead dropdown menu actions after base-ui migration (Delete chat, Pin, Sign out)#186
chloeilabs merged 1 commit into
mainfrom
fix/delete-chat-menu-onclick

Conversation

@chloeilabs

Copy link
Copy Markdown
Owner

What

Restores the dropdown menu actions that silently stopped working after the base-ui migration: Delete chat, Pin chat, and Sign out.

Why

Commit d82421b ("Consolidate UI primitives onto base-ui (drop radix-ui)") moved dropdown menus onto base-ui's Menu.Item. base-ui menu items fire onClick and have no onSelect propDropdownMenuItem spreads props straight through, so any leftover onSelect={...} is silently ignored and the handler never runs.

Three menu items were missed in the migration and kept Radix's onSelect:

  • src/components/nav-threads.tsxDelete chat (the reported bug) and Pin chat
  • src/components/nav-user.tsxSign out

So clicking "Delete chat" did nothing.

Change

Swap onSelectonClick on the three affected items. The handlers ignore the event argument, so the swap is type-safe, and base-ui's closeOnClick defaults to true so the menu still closes after the action.

- onSelect={() => { onDeleteThread(thread.id); ... }}
+ onClick={() => { onDeleteThread(thread.id); ... }}

Verification

  • eslint --max-warnings=0, prettier --check, pnpm typecheck — all pass
  • pnpm test157/157 pass
  • Live browser (local dev, signed in): clicking Delete chat now sends DELETE /api/threads → 204, removes the thread from the sidebar, and deletes the row from Postgres. Other threads are untouched.

Reviewer notes

  • Sign-out is the identical one-line fix but was not clicked in-browser (it would end the test session).
  • Worth grepping for any other onSelect on base-ui menu items in future migrations — it fails silently with no type error.

🤖 Generated with Claude Code

…Pin, Sign out)

The base-ui migration (d82421b) moved dropdown menus onto base-ui's
Menu.Item, which fires onClick and has no onSelect prop. Three menu items
were left using Radix's onSelect, so base-ui silently ignored them and the
handlers never ran — most visibly, "Delete chat" did nothing.

Switch the affected items to onClick:
- nav-threads.tsx: Delete chat and Pin chat
- nav-user.tsx: Sign out

The handlers ignore the event argument, so the swap is type-safe, and
base-ui's closeOnClick defaults to true so the menu still closes.

Verified: eslint (--max-warnings=0), prettier, typecheck, and 157 unit
tests pass. Live browser test: clicking Delete chat now sends
DELETE /api/threads (204), removes the thread from the sidebar, and
deletes the row from Postgres.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chloei Ready Ready Preview, Comment Jun 16, 2026 4:05am

@chloeilabs chloeilabs merged commit a57dea3 into main Jun 16, 2026
6 checks passed
@chloeilabs chloeilabs deleted the fix/delete-chat-menu-onclick branch June 16, 2026 04:10
@chloeilabs chloeilabs mentioned this pull request Jun 16, 2026
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.

1 participant