Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/views/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes

- `useViewConfig`: request the full configuration under the same cache key as `getViewConfig( kind, name )`, so a route loader that preloads it no longer triggers a second request. ([#82141](https://github.com/WordPress/gutenberg/pull/82141))
- `useView`, `loadView`. Resolve the view as a stack of layers — `defaultView`, `defaultLayouts` (for the effective type), `activeViewOverrides`, the user's preference, and the URL query params — and persist only the properties the user actually modified. Previously the whole view was persisted, so a later change to any of the lower layers stopped showing through, an override could bounce back a value the user had picked, and a partial `sort` or `layout` override marked the view as modified forever. `page` and `search` are now sourced from the URL alone, and `layout`, `groupBy` and `sort` merge leaf by leaf, so an override for one field's styles no longer wipes the other fields'. Persisted modifications that happen to coincide with the current view's base are retained on update, so a change made in one view no longer drops a pick made in another view sharing the preference. [#80832](https://github.com/WordPress/gutenberg/pull/80832)

## 1.18.0 (2026-07-14)
Expand Down
12 changes: 9 additions & 3 deletions packages/views/src/use-view-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ export function useViewConfig( {
: undefined;
return useSelect(
( select ) => {
return unlock( select( coreStore ) ).getViewConfig( kind, name, {
fields: fieldsKey,
} );
return unlock( select( coreStore ) ).getViewConfig(
kind,
name,
fieldsKey
? {
fields: fieldsKey,
}
: undefined
);
},
[ kind, name, fieldsKey ]
);
Expand Down
Loading