Refactor the question answer storage mechanism to support multiple pending
fields simultaneously and improve data isolation.
- Update `QuestionAnswersProvider` to process all dirty fields in a single
payload instead of just the first one found.
- Ensure all processed dirty keys are cleared from the tracking set.
- Update `TestQuestionsFlow` props to allow null `draftStorageKey`.
- Add comprehensive unit tests for `user-scoped-storage` to ensure
account isolation and correct key generation.
- Update `slider-page` mocks to include marriage config query keys.
Update `AdvisorActionsCard` to fetch real advisor data using `useMarriageAdvisorsQuery`.
The component now:
- Fetches live advisor data and handles loading states with a shimmer effect.
- Derives real avatars from the API response, falling back to provided props if no data is available.
- Dynamically calculates the extra advisor count based on the API results.
- Implements a fallback avatar for missing user profile images.
Refactor the focus synchronization logic to include pointer events and
ensure test stability when manipulating browser history.
- Add `pointerdown` event listener to `useQuestionInputFocusSync` to
improve input activation on touch/pointer devices
- Extract input activation logic into a dedicated `activateFocusedQuestionInput`
function for better readability
- Update `QuestionSheet` tests to reset window history state and use
asynchronous waiting for `pushState` calls to prevent race conditions
Enhance the user experience by allowing the browser's back button to
close active question sheets instead of navigating away from the page.
- Update `useSheetScrollLock` to manage history state using `pushState`
- Implement `popstate` event listener to trigger `onBack` callback
- Add support for an optional `onBack` option in the scroll lock hook
- Clean up redundant CSS rules related to `question-sheet-open`
- Add integration tests to verify sheet closure on `popstate` events
Update `use-sheet-scroll-lock` to improve how the keyboard shift property
and body classes are applied during input focus events.
- Change `syncKeyboardShift` to accept a boolean state instead of height
- Add check to ensure focus synchronization only triggers for active
question snap items
- Improve cleanup logic in `handleFocusOut` and `useEffect` to
correctly reset the `--question-keyboard-shift` CSS variable
Clean up import statements in `MarriageAdvisorsPage` and the
`useMarriageAdvisorsQuery` hook to improve code readability and
maintain consistent ordering.
- Reorder imports in `src/app/marriage-advisors/page.tsx`
- Fix import positioning in `src/hooks/marriage/use-marriage-advisors.ts`
Replace static advisor data with a dynamic fetch from the API using
React Query. This includes adding a new custom hook for marriage
advisors, updating query keys, and integrating with the Flutter
webview to allow opening consultant pages natively.
- Add `useMarriageAdvisorsQuery` hook
- Implement `getMarriageConsultants` API call
- Update `MarriageAdvisorsPage` to use fetched data
- Add error and empty state translations across all locales
- Integrate `postActionToFlutter` for native navigation
Refactor the marriage profile and assessment flow to use a new overview
endpoint, reducing the need to fetch full question schemas for the
initial list view.
- Implement `getFormOverview` and `useFormOverviewQuery` to fetch
high-level section metadata.
- Update `QuestionDetailClient` and `QuestionsListPage` to utilize
the overview data for rendering progress and section lists.
- Refactor `schema-adapter` to support mapping overview sections to
frontend `QuestionListItem` objects.
- Optimize proxy performance by adding TTFB metrics and improving
encoding support.
- Improve UI/UX with better overscroll behavior and viewport settings.
- Add unit and integration tests for the new schema adapter and
required steps component.
Refactor the application initialization and data fetching strategy to improve performance, reliability, and user experience, especially within the Flutter webview context.
Key changes:
- **Bootstrap & Initialization**: Implemented a `beforeInteractive` bootstrap script to handle locale correction and safe-area insets before the app becomes visible, reducing layout shift and flickering.
- **Locale Routing**: Enhanced the middleware proxy to prioritize authoritative cookie-based locales and improved `Accept-Language` header parsing to support complex device headers.
- **Assessment Progress**: Introduced a local assessment progress tracking mechanism that merges server-side completion data with local `localStorage` drafts, ensuring users don't lose progress during transitions.
- **Data Fetching**: Optimized React Query configurations by increasing `staleTime` and disabling aggressive refetching on window focus/mount to reduce unnecessary network overhead.
- **UI/UX Improvements**:
- Replaced `next/image` icon loading with an inline `UiIcon` component to eliminate per-icon network requests and ensure icons are available in the initial HTML.
- Implemented a Flutter-style skeleton shimmer animation using CSS transforms for smoother performance in the webview.
- Updated CSS variables to use `env(safe-area-inset-*)` for better mobile compatibility.
- **Refactoring**:
- Consolidated marriage-related data fetching into a unified `useFormSchemaQuery` pattern.
- Simplified component logic by removing redundant `silent-reloader` calls and manual cache-busting headers.
- Improved type safety for the Flutter bridge and window global objects.