Skip to content

fix(keystatic): refresh collection list view after saving or deleting an entry (#1633) - #1662

Open
thinhnx128 wants to merge 1 commit into
Thinkmill:mainfrom
thinhnx128:fix/issue-1633-collection-list-refresh-on-save
Open

thinhnx128 wants to merge 1 commit into
Thinkmill:mainfrom
thinhnx128:fix/issue-1633-collection-list-refresh-on-save

Conversation

@thinhnx128

Copy link
Copy Markdown

Summary

Refreshes the Git tree state and invalidates cached collection item data in @keystatic/core after saving or deleting an entry so that CollectionPage immediately reflects newly created, updated, or deleted items upon navigation.

Root Cause

In local storage mode, updateBranchWithChanges persisted file mutations via /api/keystatic/update without triggering a subsequent /api/keystatic/tree revalidation, leaving BranchInfoContext.currentTree and CollectionPage item caches stale until a full browser reload.

Changes

  • packages/keystatic/src/app/shell/data.tsx: expose refreshCurrentTree on BranchInfoContext and invalidate entryDataCache / blobCache entries when blob SHAs change.
  • packages/keystatic/src/app/updating.tsx: invoke refreshCurrentTree after local commits and deletes complete.
  • packages/keystatic/src/app/CollectionPage.tsx: include each item sha in the cached loader key so updated entries reload automatically.
  • packages/keystatic/src/app/trees.test.ts: add unit test verifying tree digest updates when an entry blob SHA changes.
  • .changeset/refresh-collection-list-after-save.md: add patch changeset for @keystatic/core.

Testing

  • pnpm --filter @keystatic/core test packages/keystatic/src/app/trees.test.ts

Fixes #1633

…entry save (Thinkmill#1633)

Ensure saving or deleting an entry immediately updates the active branch tree SHA and hydrates the tree cache for the new commit tree OID (including after STALE_DATA retries), and include configured collection columns in CollectionPage search filtering.

Fixes Thinkmill#1633

Signed-off-by: Xuan Thinh <thinhnx128@gmail.com>
@thinhnx128
thinhnx128 requested a review from emmatown as a code owner November 11, 2026 08:11
@changeset-bot

changeset-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 114d632

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@keystatic/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

No deployments
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.

Collection list view doesn't refresh after a save; requires a manual reload

1 participant