You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MPI-159: Optimize useEffect dependencies and refactor persistence for widget parameters across the app (#53)
* feat: Add TypeScript compilation checks and ESLint to workflows
- Introduced TypeScript compilation checks in firebase-deployment.yml, lint.yml, and playwright-tests.yml to ensure type safety.
- Added ESLint step to lint.yml and playwright-tests.yml for consistent code quality.
- Removed unused imports in BreathingExercise.spec.ts and WidgetConfiguration.spec.ts for cleaner test files.
- Cleaned up widgetConfigHelpers.ts by removing unnecessary TestData import.
* docs: Update README to include CI/CD pipeline details
- Added comprehensive section on CI/CD pipeline utilizing GitHub Actions.
- Documented workflows for lint validation, Playwright tests, and Firebase deployments.
- Clarified triggers, purposes, and benefits of each workflow.
- Included local development instructions to catch issues early.
* refactor: Optimize useEffect dependencies and improve performance in Instructions component
- Simplified useEffect dependencies in Instructions.tsx to reduce unnecessary re-renders.
- Updated MainAnimationProvider to utilize useCallback and useMemo for better performance.
- Cleaned up test files by removing redundant whitespace and ensuring consistent formatting.
- Adjusted useBreathingInstructions hook to maintain necessary dependencies for time management.
* refactor: Update navigation components to use parameterized hooks
- Replaced `useNavigate` with `useNavigateWithParams` in QuickStartPreset for improved parameter handling.
- Updated ThankYouPage to utilize `NavLinkWithParams`, ensuring links maintain query parameters.
- Enhanced test cases to verify parameter preservation during navigation across various components.
- Cleaned up useEffect in useBreathingInstructions for better readability and performance.
* test: Improve visibility checks in BreathingExercise.spec.ts
- Enhanced the pause/play button test to include a wait for the absence of h1 elements and the presence of a timer element.
- Removed redundant timeout from the timer visibility check for cleaner test logic.
This project uses Firebase Hosting with three environments:
@@ -108,7 +263,7 @@ This project uses GitHub Actions for automated testing, linting, and deployment.
108
263
### 2. Playwright Tests (`playwright-tests.yml`)
109
264
-**Triggers**: Pull requests and pushes to `main`
110
265
-**Purpose**: Run end-to-end tests to ensure functionality
111
-
-**Runs**:
266
+
-**Runs:**
112
267
- ESLint validation
113
268
- TypeScript compilation
114
269
- Build application
@@ -157,11 +312,62 @@ Before pushing, run locally to catch issues early:
157
312
158
313
```bash
159
314
npm run lint # Check for linting errors
160
-
npx tsc --noEmit # Verify TypeScript compilation
315
+
npm run typecheck# Verify TypeScript compilation
161
316
npm run build # Verify build works
162
317
npm run test:e2e # Run all tests
318
+
npm run precommit # Run all checks (typecheck + lint + e2e tests)
163
319
```
164
320
321
+
---
322
+
## Widget Parameter Persistence
323
+
324
+
The application automatically preserves widget configuration parameters across React Router navigation. This ensures that custom branding and configuration (logoUrl, audioUrl, etc.) persist when users navigate between pages.
325
+
326
+
### How It Works
327
+
328
+
Widget configuration parameters are automatically extracted from URL query parameters and preserved during navigation:
329
+
330
+
-**Internal Navigation**: All internal links use `useNavigateWithParams()` hook or `NavLinkWithParams` component
331
+
-**Parameter Preservation**: These components automatically append widget config parameters to navigation URLs
0 commit comments