learning_ai_notes/web
saravanakumardb1 3c4d46f3ad fix(web): resolve the 5 actionable React-compiler lint advisories
Web lint warnings reduced from 20 → 15 by fixing the categories that
flag real architectural smells rather than the canonical
fetch-on-mount setState pattern.

Real fixes:

1. web/src/lib/use-theme.ts — replace useEffect + setState mount-sync
   pattern with React.useSyncExternalStore. The hook now subscribes to
   browser storage events, returns a stable snapshot for SSR, and uses
   a manual storage-event dispatch so same-document setters refresh
   correctly. Eliminates the cascading-render advisory and gains free
   cross-tab theme sync.

2. web/src/lib/use-keyboard-shortcuts.ts — move ref assignment from
   render time into a useEffect. Fixes the 'Cannot access refs during
   render' advisory without behavior change.

3. web/src/components/NoteEditor.tsx — move onSaveRef.current = onSave
   from render time into a useEffect for the same reason.

4. web/src/app/(app)/reviews/page.tsx — wrap handleDecision and
   handleBatchDecision in useCallback so the useEffect that depends
   on them no longer re-subscribes the keydown listener on every
   render. Fixes both react-hooks/exhaustive-deps warnings and the
   underlying perf bug they pointed at.

5. web/src/app/(app)/prompts/page.tsx — wrap loadTemplates in
   useCallback declared before the useEffect that calls it. Fixes
   the 'Cannot access variable before it is declared' advisory.

Remaining 15 warnings are React-compiler runtime hints about
fetchData().then(setData) patterns inside useEffect, which is the
canonical fetch-on-mount pattern shown in React's own docs. Resolving
them properly requires Suspense + use() or risky startTransition
wraps; both are out of scope and tracked under future tech debt.

Verified:
- pnpm --filter @notelett/web run typecheck: passes
- pnpm --filter @notelett/web run lint: 0 errors, 15 warnings (down 5)
- pnpm run verify: backend 380/380, web 96/96, mobile 97/97
2026-05-23 00:20:02 -07:00
..
e2e test(ui): add review visual smoke 2026-05-06 13:28:57 -07:00
public feat: implement WEB_AI_FAST_ROADMAP (web + backend + docs) 2026-03-31 13:00:36 -07:00
scripts chore(web): add bundle analysis gate 2026-05-05 12:45:20 -07:00
src fix(web): resolve the 5 actionable React-compiler lint advisories 2026-05-23 00:20:02 -07:00
test-results chore: update dependencies 2026-03-29 10:50:57 -07:00
.env.example fix(platform): align mcp service urls 2026-05-05 09:19:11 -07:00
.gitignore feat(notes): scaffold product surfaces and backend MCP slices 2026-03-10 08:53:07 -07:00
Dockerfile fix: Update docker configuration for production deployment 2026-05-12 08:20:12 +00:00
eslint.config.mjs fix(lint): clear production lint blockers 2026-05-05 14:04:49 -07:00
next-env.d.ts fix(workspace): canonicalize common-plat path to ../learning_ai_common_plat 2026-05-22 15:08:30 -07:00
next.config.ts fix(web): prepare Vercel build and standalone runtime 2026-03-31 06:05:16 +00:00
package.json chore(web): add bundle analysis gate 2026-05-05 12:45:20 -07:00
playwright.config.ts ci(web): add playwright e2e job 2026-05-05 13:27:12 -07:00
tsconfig.json feat(repo): migrate notelett workspace to pnpm 2026-03-22 15:50:54 -07:00
vitest.config.ts fix(web): add Next.js module mocks for Vitest — all 14 tests pass (was 10/14) 2026-03-29 01:03:11 -07:00