Skip to content

feat(performance): persist and aggregate Web Vitals metrics#792

Open
MerlinTheWhiz wants to merge 938 commits into
rinafcode:mainfrom
MerlinTheWhiz:feat/web-vitals-persistence
Open

feat(performance): persist and aggregate Web Vitals metrics#792
MerlinTheWhiz wants to merge 938 commits into
rinafcode:mainfrom
MerlinTheWhiz:feat/web-vitals-persistence

Conversation

@MerlinTheWhiz

Copy link
Copy Markdown
Contributor

Description

Persists incoming Web Vitals metrics to a new web_vitals database table, exposes aggregated data via a GET endpoint, and adds poor-rate alerting when a metric exceeds the 5% threshold.

Changes:

  • Created src/lib/db/migrations/001_create_web_vitals.sql (table DDL with indexes on name, page_url, created_at, rating)
  • Created src/lib/db/migrate.ts — migration runner that tracks applied migrations in a _migrations table
  • Modified src/app/api/performance/vitals/route.ts:
    • Changed runtime from edgenodejs (required for pg access)
    • POST: validates incoming metrics, inserts a row into web_vitals, keeps existing console alerts, and fires an additional alert if poor-rate exceeds 5% over the last 500 sessions
    • GET: new handler returning aggregated metrics (avg_value, poor_rate_pct) grouped by name and page_url, with a configurable ?range=7d|30d|90d|all query parameter
  • Added migrate script to package.json

Related Issue

Closes #764

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No console errors
  • Uses Lucide icons consistently
  • Responsive design implemented
  • Starknet best practices followed

RUKAYAT-CODER and others added 30 commits May 30, 2026 20:01
…ion-program-input

Implement Certification Program support for input fields and add cert…
refactor: implement comprehensive logging standards (rinafcode#536)
…ibility

- Replace custom spinners with AccessibleLoading across all dashboard widgets and SubmitButton
- Add customization support (className, showText) to AccessibleLoading for consistent visual and screen-reader UX
- Ensure no layout or visual regressions in buttons and forms
…ogress-indicator

feat: refactor progress indicators to implement discount management (rinafcode#379)
…-states

feat: improve loading states with AccessibleLoading for better access…
refactor User Preferences : Poll Creation
Implements TTL-based in-memory response caching across the wallet
integration — NFT gallery (5 min), DeFi positions (60 s), and native
balance (30 s). Cache is invalidated on disconnect, stake, and unstake.
Adds walletCacheKeys, CACHE_TTL constants, wallet query keys, and 23
passing unit tests for the new WalletCache utility.
Implement comprehensive virtual background support for video conferences
with full backup system integration and settings management.

- Update settings schema from v2 to v3 with virtual background fields
- Add virtual background settings: enabled, type, image URL, blur intensity, color
- Implement virtual background utilities for video stream processing
- Create useVirtualBackground hook for component integration
- Add Virtual Background UI section to settings page
- Integrate virtual background with VideoConference component
- Add comprehensive unit and integration tests
- Update documentation with virtual background feature details
- Implement migration from v2 to v3 settings schema

Generated with Devin

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Add createBatcher utility (src/lib/api/batch.ts) that collects
  concurrent requests within a debounce window and sends them as a
  single batched POST, reducing network round-trips

- Add POST /api/help edge route that accepts BatchRequest[] and returns
  BatchResponse<HelpArticle>[] in one response; GET convenience endpoint
  also included

- Add useHelpDocumentation hook backed by a shared module-level batcher
  so multiple components mounting simultaneously share one network call

- Add HelpDocumentation component with collapsible articles, skeleton
  loading, error/retry UI, accessible markup, lucide icons, dark mode

- Add 11 unit tests covering batcher and hook (all passing)

Closes rinafcode#496
…inafcode#504)

- Tables: pipe-style GFM tables with thead/tbody
- Strikethrough: ~~text~~ → <del>text</del>
- Task lists: - [ ] / - [x] → checkbox list items
- Update DOMPurify allowlist to include new tags/attrs
- Add 8 new tests (29 total, all passing)

Closes rinafcode#504
This PR pushes the latest fixes for test failures and updates study group state handling.

Changes:
- Guard `scrollIntoView` in `GroupDiscussionThread` for JSDOM tests.
- Keep leaderboard and group query results in sync with persisted storage in `useStudyGroups`.
- Stabilize async validation promise handling in `AsyncValidationManager`.
- Fix path imports in `TipForm` tests for the current test environment.
- Add useAudioEnhancement hook using Web Audio API
  - Bass boost via low-shelf BiquadFilter @ 100 Hz
  - Voice clarity via peaking BiquadFilter @ 3 kHz
  - Noise reduction via GainNode attenuation
  - Lazy graph init on first toggle (respects autoplay policy)
- Add AudioEnhancement UI component with toggle + sliders
- Expose audioEnhancement via VideoPlayerContext
- Integrate into AdvancedVideoPlayer and VideoPlayer
- Add 'E' keyboard shortcut to toggle enhancement
…code#110)

- Add referral code generation and validation utilities
- Extend user schema with referral fields (referralCode, referredBy, referralCount)
- Update signup API to handle optional referral codes
- Add referral validation endpoint (/api/referral/validate)
- Update signup frontend to include referral code input field
- Add comprehensive unit tests for referral utilities
- Add integration tests for referral API endpoints
- Update e2e tests to cover referral flow scenarios
- Create detailed documentation for the referral program

Generated with Devin - Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Add MobileNavigationScanner component with camera/QR scanning
- Integrate scan button into mobile navigation
- Add jsqr library for QR decoding
- Add unit tests with ToastProvider wrapper
- Fix test mocks for jsQR and URL.createObjectURL
- Handle camera permissions and image upload fallback
- Add Conference type definition with zod schema
- Implement CRUD service functions (getConferences, addConference, updateConference, deleteConference)
- Create ConferenceManagement component with full CRUD UI
- Integrate ConferenceManagement into Profile Page
- Add 40+ comprehensive tests covering all scenarios
- Follow existing LeaderboardConference pattern for consistency
- Maintain accessibility standards (ARIA labels, keyboard navigation)
- All form fields properly labeled and validated
- Delete buttons have descriptive aria-labels
- Service layer stubbed with TODO comments for API integration
RUKAYAT-CODER and others added 20 commits June 25, 2026 16:04
…-release-notes

feat: Privacy Policy Release Notes (rinafcode#417)
…itor-material

feat: Post Editor Material Design (rinafcode#418)
…nic-signature

feat: Assignment System Electronic Signature (rinafcode#420)
- Added new analytics event types for onboarding lifecycle tracking:
  - onboarding_started: Track when user initiates onboarding
  - onboarding_step_completed: Track completion of each step
  - onboarding_completed: Track successful onboarding completion
  - onboarding_abandoned: Track when user leaves without completing

- Integrated useAnalytics hook into OnboardingPage component
- Added safe event tracking with error handling to prevent analytics failures from blocking onboarding
- Added onStepChange and onStepComplete callbacks to FormWizardController
- Track step details (id, index, title) and completion metadata
- Added comprehensive test coverage for analytics event tracking
- Verified all 7 onboarding tests pass with proper timer handling

This enables analytics teams to track user onboarding funnel completion rates and identify drop-off points.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…alytics-integration

feat: Integrate analytics tracking into user onboarding flow
Implement Vertical Pod Autoscaling for FAQ System
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@MerlinTheWhiz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Great job so far

There’s just one blocker — the workflow is failing. Could you take a look and fix it so all checks pass?

Happy to review again once that’s done.
You can pull from the main first before pushing. The workflow should pass

@MerlinTheWhiz

MerlinTheWhiz commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

@RUKAYAT-CODER It was from my edits. I've resolved the issues now, you can merge now. All green.

@MerlinTheWhiz

Copy link
Copy Markdown
Contributor Author

@RUKAYAT-CODER Please hold, don't merge yet.

@MerlinTheWhiz

Copy link
Copy Markdown
Contributor Author

@RUKAYAT-CODER You can merge now. Thanks

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Kindly resolve conflict

@MerlinTheWhiz

Copy link
Copy Markdown
Contributor Author

@RUKAYAT-CODER Very sorry for the delay. I stepped out to touch grass today. I'll get on it soon.

@MerlinTheWhiz MerlinTheWhiz force-pushed the feat/web-vitals-persistence branch from 0caf7fc to 7cc8d96 Compare June 28, 2026 16:49
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.

[Enhancement] Web Vitals endpoint acknowledges POST but never persists or alerts on metrics