Story/am 437 laadscherm bij lang wachten uitbreiden - #574
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the app’s loading experience by enhancing the shared PleaseWait component with optional “long wait” textual feedback (timer-based), and then wiring that enhanced feedback into many module loading states for a more informative UX during slow network calls.
Changes:
- Enhanced
PleaseWaitto optionally display timed feedback based on either RTK QuerystartedTimeStampor a mount-based timer (showFeedback). - Updated many screens/components to pass
startedTimeStamporshowFeedbacktoPleaseWait, and added consistentinset="md"usage forSomethingWentWrongin several places. - Hid stack headers for a few routes where full-screen presentation is desired.
Reviewed changes
Copilot reviewed 73 out of 73 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/waste-guide/screenConfig.ts | Hides header for recycle point map route. |
| src/modules/waste-guide/components/WasteGuide.tsx | Enables timed loading feedback while fetching address/waste guide. |
| src/modules/waste-guide/components/recyclepoints/WasteGuideSelectRecyclePoint.tsx | Passes startedTimeStamp to loading state; adds inset to error state. |
| src/modules/waste-guide/components/recyclepoints/WasteGuideRecyclePointMap.tsx | Enables timed loading feedback; adds inset to error state. |
| src/modules/waste-guide/components/recyclepoints/WasteGuideRecyclePoint.tsx | Enables timed loading feedback during active recycle point loading. |
| src/modules/waste-guide/components/calendar/WasteGuideCalendar.tsx | Adds inset to error states; enables timed loading feedback. |
| src/modules/user/components/notification-settings/NotificationSettings.tsx | Enables timed loading feedback while loading notification settings data. |
| src/modules/user/components/module-settings/ModuleSettings.tsx | Enables timed loading feedback for module settings loading UI. |
| src/modules/survey/components/DynamicForm.tsx | Passes startedTimeStamp into loading UI for survey config fetch. |
| src/modules/service/components/ServicesGrid.tsx | Passes startedTimeStamp into loading UI for service overview fetch. |
| src/modules/service/components/ServicePointMap.tsx | Passes startedTimeStamp into loading UI for service map fetch. |
| src/modules/service/components/ServicePointList.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/service/components/bottomsheet/ServiceMapLegend.tsx | Removes wrapper Box, adds inset to error state, and passes startedTimeStamp to loading UI. |
| src/modules/redirects/components/Redirects.tsx | Enables timed loading feedback on redirects loading UI. |
| src/modules/pride/screens/PrideEventDetails.screen.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/pride/components/PrideEventTypeBottomSheet.tsx | Passes startedTimeStamp into loading UI in bottom sheet. |
| src/modules/pride/components/PrideEventsList.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/pride/components/PrideEventDateBottomSheet.tsx | Passes startedTimeStamp into loading UI in bottom sheet. |
| src/modules/parking/screens/ParkingDashBoard.screen.tsx | Passes startedTimeStamp from permits hook into loading UI. |
| src/modules/parking/providers/CurrentPermitProvider.tsx | Enables timed loading feedback while loading current permit view. |
| src/modules/parking/hooks/useGetPermits.ts | Exposes RTK Query startedTimeStamp to consumers. |
| src/modules/parking/components/session/ParkingPlannedSessionsSummary.tsx | Enables timed loading feedback during planned sessions load. |
| src/modules/parking/components/session/ParkingActiveSessionsSummary.tsx | Enables timed loading feedback during active sessions load. |
| src/modules/parking/components/select-permit/ParkingSelectPermit.tsx | Adds inset to “something went wrong” state. |
| src/modules/parking/components/permit-zone/ParkingPermitZoneMap.tsx | Passes startedTimeStamp into loading UI; adjusts error UI wrapper/inset. |
| src/modules/parking/components/permit-zone/ParkingMachineSearch.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/parking/components/permit-zone/ParkingMachineList.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/parking/components/permit-zone/bottomsheet/ParkingMachineBottomSheetContent.tsx | Passes startedTimeStamp into loading UI within machine details section. |
| src/modules/parking/components/ParkingMyLicensePlates.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/parking/components/form/ParkingSessionSelectLicensePlate.tsx | Enables timed loading feedback during license plate loading. |
| src/modules/parking/components/form/ParkingSessionAddLicensePlate.tsx | Enables timed loading feedback during add-license-plate loading. |
| src/modules/parking/components/form/ParkingReceipt.tsx | Enables timed loading feedback while loading receipt/account state. |
| src/modules/parking/components/form/ParkingIncreaseBalanceReceipt.tsx | Passes startedTimeStamp into loading UI for account details fetch. |
| src/modules/parking/components/dashboard/ParkingPermitBalanceMoney.tsx | Passes startedTimeStamp into loading UI for account details fetch. |
| src/modules/notification-history/components/NotificationHistory.tsx | Passes startedTimeStamp into loading UI for notification history fetch. |
| src/modules/news/components/SelectDistrictBottomSheet.tsx | Passes startedTimeStamp into loading UI for districts fetch. |
| src/modules/news/components/NewsList.tsx | Enables timed loading feedback for list-empty loading UI. |
| src/modules/news/components/NewsHighlights.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/news/components/NewsDashboardHighlightedArticle.tsx | Passes startedTimeStamp into loading UI for highlighted article fetch. |
| src/modules/news/components/NewsArticle.tsx | Enables timed loading feedback while loading article content. |
| src/modules/news/components/liveblog/Liveblog.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/home/components/Home.tsx | Enables timed loading feedback while loading enabled modules. |
| src/modules/elections/components/PollingStationsMap.tsx | Enables timed loading feedback; adds inset to error state. |
| src/modules/elections/components/PollingStationsList.tsx | Enables timed loading feedback; adds inset to error state. |
| src/modules/contact/components/city-offices/SelectCityOffice.tsx | Passes startedTimeStamp into loading UI for city offices fetch. |
| src/modules/contact/components/city-offices/CityOffice.tsx | Passes startedTimeStamp into loading UI for city offices fetch. |
| src/modules/construction-work/components/projects/ListEmptyComponent.tsx | Enables timed loading feedback for list-empty loading UI. |
| src/modules/construction-work/components/project/ProjectWarning.tsx | Enables timed loading feedback; adds inset to error state. |
| src/modules/construction-work/components/project/ProjectNews.tsx | Passes startedTimeStamp into loading UI for project news fetch. |
| src/modules/construction-work/components/project/ProjectArticle.tsx | Passes startedTimeStamp into loading UI for project details fetch. |
| src/modules/construction-work/components/project/Project.tsx | Passes startedTimeStamp into loading UI for project details fetch. |
| src/modules/construction-work/components/article/ArticleOverview.tsx | Passes startedTimeStamp into loading UI for articles fetch. |
| src/modules/construction-work-editor/components/AuthorizedProjects.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/city-pass/screenConfig.ts | Hides header for budget and security code routes. |
| src/modules/city-pass/components/transactions/DiscountTransactions.tsx | Passes startedTimeStamp into loading UI for discount transactions fetch. |
| src/modules/city-pass/components/transactions/BudgetTransactions.tsx | Passes startedTimeStamp into loading UI for budget transactions fetch. |
| src/modules/city-pass/components/details/SecurityCode.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/city-pass/components/details/CityPassDetails.tsx | Passes startedTimeStamp into loading UI for city passes fetch. |
| src/modules/city-pass/components/Budget.tsx | Passes startedTimeStamp into loading UI for city passes fetch. |
| src/modules/burning-guide/components/BurningGuide.tsx | Enables timed loading feedback during forecast loading. |
| src/modules/boat-charging/screens/BoatChargingTermsAndConditions.screen.tsx | Enables timed loading feedback during terms loading. |
| src/modules/boat-charging/screens/BoatChargingGuestEmailConfirm.screen.tsx | Adds inset to error state. |
| src/modules/boat-charging/components/session/BoatChargingSession.tsx | Enables timed loading feedback; adds inset to error state. |
| src/modules/boat-charging/components/history/BoatChargingHistory.tsx | Enables timed loading feedback for initial history loading state. |
| src/modules/boat-charging/components/bottomsheet/BoatChargingPointDetails.tsx | Passes startedTimeStamp into loading UI; adds inset to error state. |
| src/modules/boat-charging/components/BoatChargingMap.tsx | Enables timed loading feedback; adds inset to error state. |
| src/modules/boat-charging/components/BoatChargingList.tsx | Enables timed loading feedback; adds inset to error state. |
| src/modules/boat-charging/components/BoatChargingHistorySessionDetails.tsx | Enables timed loading feedback during details loading. |
| src/modules/boat-charging/components/BoatChargingDetails.tsx | Enables timed loading feedback during combined loading state. |
| src/components/ui/feedback/PleaseWait.tsx | Adds timer-based textual feedback support (startedTimeStamp / showFeedback). |
| src/components/ui/feedback/PleaseWait.test.tsx | Adds unit tests for timer-based feedback behavior. |
| src/components/ui/feedback/PleaseWait.stories.tsx | Adds Storybook stories for 5s and 15s elapsed feedback states. |
| src/components/ui/containers/WebView.tsx | Enables timed loading feedback for WebView loading renderer. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| ) { | ||
| return 'Gegevens worden geladen' | ||
| } else if (elapsedTime >= SECOND_TIMEOUT_VALUE) { | ||
| return 'Dit duurt langer dan normaal. \n We zijn nog bezig.' |
There was a problem hiding this comment.
de tweede regel begint nu met een spatie
| return 'Dit duurt langer dan normaal. \n We zijn nog bezig.' | |
| return 'Dit duurt langer dan normaal. \nWe zijn nog bezig.' |
| } | ||
|
|
||
| const interval = setInterval(() => { | ||
| setElapsedTime(Math.abs(dayjs(countFrom).diff())) |
There was a problem hiding this comment.
Als je als unit second meegeeft, dan hoef je niet door 1000 te delen later:
| setElapsedTime(Math.abs(dayjs(countFrom).diff())) | |
| setElapsedTime(Math.abs(dayjs(countFrom).diff(dayjs(), 'second'))) |
|
|
||
| const elapsedSeconds = Math.floor(elapsedTime / 1000) | ||
|
|
||
| const feedback = useMemo( |
There was a problem hiding this comment.
ik denk dat het berekenen van de cache check (van useMemo om te kijken of de oude waarde gebruikt moet worden) meer rekenkracht kost hier dan getElapsedTimeFeedback zelf uitvoeren
Changes
Pull request overview
This PR extends the app’s loading experience by enhancing the shared
PleaseWaitcomponent with optional “long wait” textual feedback (timer-based), and then wiring that enhanced feedback into many module loading states for a more informative UX during slow network calls.Changes:
PleaseWaitto optionally display timed feedback based on either RTK QuerystartedTimeStampor a mount-based timer (showFeedback).startedTimeStamporshowFeedbacktoPleaseWait, and added consistentinset="md"usage forSomethingWentWrongin several places.Test instructions
Other notes