Skip to content

UIIN-3626: Item reorder changes are lost if holdings accordion is collapsed before 'stop item movement' invoked#2992

Merged
mariia-aloshyna merged 1 commit intomasterfrom
UIIN-3626
Mar 31, 2026
Merged

UIIN-3626: Item reorder changes are lost if holdings accordion is collapsed before 'stop item movement' invoked#2992
mariia-aloshyna merged 1 commit intomasterfrom
UIIN-3626

Conversation

@mariia-aloshyna
Copy link
Copy Markdown
Contributor

Purpose

This PR prevents unnecessary item refetches when reopening Holdings accordions and preserves unsaved item reordering state across accordion collapse/expand in Instance details.

Approach

  • Updated useHoldingItemsQuery caching strategy to reuse data for identical requests:
  • query key now includes full searchParams (stable request identity)
  • defaulted to staleTime: Infinity and refetchOnMount: false to avoid remount refetch for unchanged params
  • Added test in useHoldingItemsQuery.test.js to verify no refetch occurs on unmount/remount with the same request.
  • Updated HoldingAccordion rendering behavior:
  • keep items content mounted after first open
  • hide/show content on collapse/expand instead of unmounting
  • This preserves local DnD/order-management state so unsaved reordered items do not reset when the accordion is toggled.

Refs

https://folio-org.atlassian.net/browse/UIIN-3626

Screenshots

Screen.Recording.2026-03-30.at.16.01.20.mov

@github-actions
Copy link
Copy Markdown

Jest Unit Test Results

    1 files  ±0    321 suites  ±0   9m 4s ⏱️ +24s
1 434 tests +1  1 415 ✅ +1  19 💤 ±0  0 ❌ ±0 
1 448 runs  +1  1 429 ✅ +1  19 💤 ±0  0 ❌ ±0 

Results for commit 112db14. ± Comparison against base commit a869c8d.

@sonarqubecloud
Copy link
Copy Markdown

@mariia-aloshyna mariia-aloshyna merged commit 48d1ef9 into master Mar 31, 2026
25 of 26 checks passed
@mariia-aloshyna mariia-aloshyna deleted the UIIN-3626 branch March 31, 2026 11:22
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.

3 participants