Keep cached group announcements visible after tab switches#774
Merged
1 commit merged intoJul 23, 2026
Merged
Conversation
The announcement editor can remount with React Query data already available. Resetting its draft after cached-data hydration left the controlled textarea empty, so the query reset now runs before hydration and a regression contract locks that ordering. Constraint: No new frontend test dependency; the existing suite uses node:test source contracts Rejected: Clear the query cache or disable structural sharing | both hide the state-ordering defect and add unnecessary fetch churn Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep query-key reset before cached-data hydration unless the draft lifecycle is redesigned Tested: Targeted regression 1/1; frontend test suite 64/64; TypeScript and Vite production build Not-tested: Authenticated live browser flow because no Clawith backend was running locally
Y1fe1Zh0u
added a commit
that referenced
this pull request
Jul 22, 2026
The integration branch needs this pull request alongside the other v1.11.2 candidates without changing the original PR state. Constraint: Preserve the source PR commit and merge in numeric order. Confidence: high Scope-risk: moderate Related: #774 Tested: Git merge completed without unresolved conflicts Not-tested: Combined backend and frontend suites pending
40c1f6b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
GroupTextFileEditorhydrated its controlled textarea from React Query cache before a later query-key reset effect cleared the draft. When the background refetch returned structurally equal data, React Query preserved the cached data reference, so the hydration effect did not run again and the announcement stayed blank until a full page refresh.The query-key reset now runs before cached-data hydration. This preserves unsaved-edit protection without clearing the query cache, disabling structural sharing, or adding fetches.
User impact
Switching away from the group announcement tab and returning to it no longer makes the saved announcement appear empty.
Validation
cached group announcement, received an empty string.git diff --checkpassed.Checklist