mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #274] [MERGED] fix(chat-input): enable send button immediately after branching #4539
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4539
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/274
Author: @LukaTheHero
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @LukaTheHero
Base:
main← Head:fix/branch-send-button-enabled📝 Commits (1)
b38b70afix(chat-input): enable send button immediately after branching📊 Changes
1 file changed (+13 additions, -0 deletions)
View changed files
📝
packages/client/src/components/chat/ChatInput.tsx(+13 -0)📄 Description
Summary
Closes #259.
After creating a new branch, the send button stayed disabled until the user typed at least one character (then deleted it). This was a regression from prior versions where you could branch and immediately click send to prompt the LLM to continue.
Root cause
ChatInput.tsxderivescanRetry/canContinuefromlastMessageRole, which it reads off the React Query cache viaqc.getQueryData(chatKeys.messages(activeChatId)). That call reads the cache once per render but does not subscribe to it — so when the new branch's messages finished loading, no re-render fired, and the button stayed in its disabled state. Typing produced a re-render, which re-read the cache and finally surfaced the newlastMessageRole.The pre-existing comment explicitly forbids using
useQueryhere because mixing auseQueryobserver with theuseInfiniteQueryobserver inuseChatMessageson the same key corrupts query state.Fix
Subscribe to the React Query cache for the active chat's messages key and bump a render counter when it updates. This keeps
lastMessageRolereactive without introducing a conflicting observer.Test plan
pnpm checkpasses (TS + ESLint, no new warnings introduced by this change).Notes
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.