[PR #238] [MERGED] fix: refresh branch selector dropdown after chat rename #4521

Closed
opened 2026-10-22 04:08:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/238
Author: @LukaTheHero
Created: 4/25/2026
Status: ✅ Merged
Merged: 4/25/2026
Merged by: @LukaTheHero

Base: main ← Head: fix/branch-selector-rename-refresh


📝 Commits (1)

  • 88c47c5 fix: refresh branch selector dropdown after chat rename

📊 Changes

1 file changed (+10 additions, -1 deletions)

View changed files

📝 packages/client/src/hooks/use-chats.ts (+10 -1)

📄 Description

Summary

  • useUpdateChat.onSuccess only invalidated chatKeys.detail and chatKeys.list, leaving chatKeys.group (read by ChatBranchSelector via useChatGroup) stale.
  • After a rename, "Manage Chat Files" updated correctly but the new branch selector dropdown — both its current label and the list — kept showing the old name until the user switched chats and came back.
  • Now we patch the group cache directly with the returned chat (instant UI update, no flicker) and invalidate chatKeys.group as a safety net.

Fixes #234.

Test plan

  • Create a chat with 2+ branches.
  • Rename the active branch via Chat Settings → name field.
  • Dropdown selector label updates immediately to the new name.
  • Open the dropdown — the renamed branch shows the new name in the list (no chat switch required).
  • Rename a non-active branch from a different surface (e.g. Quick Switcher / Wizard) — dropdown list still reflects the new name.
  • pnpm check clean (TypeScript + ESLint + build).

Summary by CodeRabbit

  • Bug Fixes
    • Chat updates now sync immediately with the server, ensuring cached chat lists remain consistent and display the latest state without requiring additional refreshes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/238 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 4/25/2026 **Status:** ✅ Merged **Merged:** 4/25/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `fix/branch-selector-rename-refresh` --- ### 📝 Commits (1) - [`88c47c5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/88c47c56a0834d07cf061af1cf4afe1abf4adc27) fix: refresh branch selector dropdown after chat rename ### 📊 Changes **1 file changed** (+10 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/hooks/use-chats.ts` (+10 -1) </details> ### 📄 Description ## Summary - `useUpdateChat.onSuccess` only invalidated `chatKeys.detail` and `chatKeys.list`, leaving `chatKeys.group` (read by `ChatBranchSelector` via `useChatGroup`) stale. - After a rename, "Manage Chat Files" updated correctly but the new branch selector dropdown — both its current label and the list — kept showing the old name until the user switched chats and came back. - Now we patch the group cache directly with the returned chat (instant UI update, no flicker) and invalidate `chatKeys.group` as a safety net. Fixes #234. ## Test plan - [x] Create a chat with 2+ branches. - [x] Rename the active branch via Chat Settings → name field. - [x] Dropdown selector label updates immediately to the new name. - [x] Open the dropdown — the renamed branch shows the new name in the list (no chat switch required). - [x] Rename a non-active branch from a different surface (e.g. Quick Switcher / Wizard) — dropdown list still reflects the new name. - [x] `pnpm check` clean (TypeScript + ESLint + build). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Chat updates now sync immediately with the server, ensuring cached chat lists remain consistent and display the latest state without requiring additional refreshes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:08:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4521
No description provided.