digdir / dialogporten-frontend

Brukergrensesnitt for Dialogporten
https://digdir.github.io/dialogporten-frontend/
MIT License
4 stars 2 forks source link

Improve Query Parameter Consistency and State Persistence Across Navigation #1317

Closed seanes closed 2 weeks ago

seanes commented 1 month ago

Description

Navigation with query parameters is inconsistently handled, leading to various issues (cf. #1298, #1244, and #1314). These issues may also impact #1304 and #1315.

Proposed Solution

  1. Centralize Hydration and Rehydration State from Query Parameters
  1. Use Query Parameters Contextually

Retain only relevant query parameters when navigating between routes. For example, navigating from /?party=PARTY_URN&search=hello to /saved-searches should keep party=PARTY_URN, but discard search=hello.

  1. Improve Handling for Page Refreshes and Back Navigation
  1. User is at / (inbox).
  2. User navigates to /drafts.
  3. User applies filter A => URL updates to /drafts?filterA=valueOfFilterA.
  4. Additional filters update the URL but do not affect the back navigation, which would return to /.

Benefits

Complexity that makes the design brittle or hard to implement should be avoided in favor of a robust solution.

This should be thoroughly tested through Playwright tests.

Additional Information

No response

### Tasks
- [x] fix: improve query parameter consistency and state persistence across navigation
- [x] https://github.com/digdir/dialogporten-frontend/issues/1347
- [x] https://github.com/digdir/dialogporten-frontend/issues/1346
- [ ] https://github.com/digdir/dialogporten-frontend/issues/1355
seanes commented 1 month ago

@LeifHelstad @mbacherycz Thoughts on this?

LeifHelstad commented 1 month ago
LeifHelstad commented 2 weeks ago

Jeg ser på denne som en "feature" der alle "Stories" (#1346, #1347, #1355) er levert og testet i sprint 10. Siden alle Stores er testet OK anser jeg Featuren som helhet også som OK. Test passed.