@@ -256,8 +256,8 @@ export function Table({
256256 const [ { sort : sortColumn , dir : sortDirection , view : activeViewId } , setTableParams ] =
257257 useQueryStates ( tableDetailParsers , tableDetailUrlKeys )
258258
259- // Read-only mirrors for the resolve effect: it must know whether the user has
260- // already applied a filter / hidden columns without re-running when they change.
259+ // Read-only mirrors for the resolve effect and replaceFilter's echo check:
260+ // both must read the current values without re-running when they change.
261261 const filterRef = useRef ( filter )
262262 filterRef . current = filter
263263 const hiddenColumnsRef = useRef ( hiddenColumns )
@@ -418,9 +418,13 @@ export function Table({
418418 * this an open panel keeps showing the rules of the filter it replaced.
419419 *
420420 * The remount discards an unapplied draft, which is the point — the rules on
421- * screen must be the rules in effect.
421+ * screen must be the rules in effect. An incoming filter identical to the
422+ * current one is skipped entirely: the resolve effect re-applies the config
423+ * after this client's own autosave settles, and letting that echo remount an
424+ * open panel would wipe keystrokes typed since the flush and steal focus.
422425 */
423426 const replaceFilter = useCallback ( ( next : TablePredicate | null ) => {
427+ if ( JSON . stringify ( next ) === JSON . stringify ( filterRef . current ) ) return
424428 setFilter ( next )
425429 setFilterSeed ( ( seed ) => seed + 1 )
426430 } , [ ] )
@@ -588,11 +592,7 @@ export function Table({
588592 // `sort` rides the same host URL, so when the view id is inherited the
589593 // sort beside it is too — not local work, and it must not suppress the
590594 // default view's own sort.
591- const keep = inheritedParams
592- ? { ...localWork ( ) , sort : false }
593- : legacyAllWithDefault
594- ? undefined
595- : localWork ( )
595+ const keep = inheritedParams ? { ...localWork ( ) , sort : false } : localWork ( )
596596 if ( defaultView ) {
597597 appliedViewRevisionRef . current = getTableViewRevision ( defaultView )
598598 setTableParams ( { view : defaultView . id } )
@@ -864,6 +864,10 @@ export function Table({
864864
865865 const handleDeleteView = useCallback (
866866 ( viewId : string ) => {
867+ if ( views . some ( ( view ) => view . id === viewId && view . isDefault ) ) {
868+ toast . error ( 'Set another view as default before deleting this view' )
869+ return
870+ }
867871 deleteViewMutation . mutate ( viewId , {
868872 onSuccess : ( ) => {
869873 if ( viewId !== activeViewId ) return
0 commit comments