Skip to content

⚡ Bolt: Optimize Home component re-renders#14

Merged
mergery[bot] merged 1 commit intomainfrom
bolt-frontend-performance-opt-11267966165271027988
Feb 9, 2026
Merged

⚡ Bolt: Optimize Home component re-renders#14
mergery[bot] merged 1 commit intomainfrom
bolt-frontend-performance-opt-11267966165271027988

Conversation

@google-labs-jules
Copy link
Contributor

Implements memoization for derived state in Home.tsx and memoizes the SliderWithInput component to prevent unnecessary re-renders during user input. Verified with TypeScript compilation and build. Note: Runtime verification was limited by missing Firebase credentials.


PR created automatically by Jules for task 11267966165271027988 started by @TytaniumDev

💡 What:
- Memoized derived deck lists (`precons`, `communityDecks`, `deckOptions`) in `Home.tsx`.
- Wrapped `SliderWithInput` component in `React.memo`.

🎯 Why:
- Typing in `Home` inputs triggered expensive recalculations and re-renders of the slider component on every keystroke.
- This optimization reduces unnecessary work on the main thread during user interaction.

📊 Impact:
- Reduces re-renders of `SliderWithInput` to near zero during typing.
- Eliminates array filtering/mapping on every render in `Home`.

🔬 Measurement:
- Verified with `npm run build --prefix frontend` (type check and build success).
- Visual verification blocked by missing Firebase credentials, but changes are standard React patterns covered by TypeScript.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions github-actions bot added the automerge Automatically merge this PR label Feb 8, 2026
@mergery mergery bot merged commit b444ea6 into main Feb 9, 2026
6 checks passed
@mergery mergery bot deleted the bolt-frontend-performance-opt-11267966165271027988 branch February 9, 2026 06:42
TytaniumDev added a commit that referenced this pull request Feb 27, 2026
…#5, #14)

- Add `ApiErrorResponse` and `ApiUpdateResponse` shared types in shared/types/api.ts
- Create api/lib/api-response.ts with errorResponse, notFoundResponse, badRequestResponse helpers
- Replace all ad-hoc NextResponse.json({ error }) patterns across 28 API route files
  with standard helper functions for consistent error shape
- Remove unused REQUIRED_DECK_COUNT re-export from api/lib/types.ts
- Add duplicate deck detection warning in POST /api/jobs response

Intentionally left unchanged:
- Sim PATCH idempotent { updated: false, reason } responses (200s for Pub/Sub)
- Recover route { status: 'ok'/'terminal'/'not_found' } success responses
- Access request approve route (returns HTML)
- Auth helpers unauthorizedResponse/forbiddenResponse (use new Response with custom headers)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TytaniumDev added a commit that referenced this pull request Feb 27, 2026
chore: standardize error responses and add duplicate deck warning (#4, #5, #14)

- Add `ApiErrorResponse` and `ApiUpdateResponse` shared types in shared/types/api.ts
- Create api/lib/api-response.ts with errorResponse, notFoundResponse, badRequestResponse helpers
- Replace all ad-hoc NextResponse.json({ error }) patterns across 28 API route files
  with standard helper functions for consistent error shape
- Remove unused REQUIRED_DECK_COUNT re-export from api/lib/types.ts
- Add duplicate deck detection warning in POST /api/jobs response

Intentionally left unchanged:
- Sim PATCH idempotent { updated: false, reason } responses (200s for Pub/Sub)
- Recover route { status: 'ok'/'terminal'/'not_found' } success responses
- Access request approve route (returns HTML)
- Auth helpers unauthorizedResponse/forbiddenResponse (use new Response with custom headers)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant