Skip to content

⚡ Bolt: [performance improvement] Add React.memo to NotificationListItem#419

Merged
ClarusIubar merged 2 commits into
mainfrom
bolt-notification-list-item-memo-2732828983021961273
Jun 13, 2026
Merged

⚡ Bolt: [performance improvement] Add React.memo to NotificationListItem#419
ClarusIubar merged 2 commits into
mainfrom
bolt-notification-list-item-memo-2732828983021961273

Conversation

@ClarusIubar

Copy link
Copy Markdown
Contributor

💡 What: Wrapped NotificationListItem with React.memo().

🎯 Why: To prevent unnecessary O(N) re-renders of all notification items when the parent NotificationPanel re-renders due to unrelated state changes (e.g., busyId or unreadCount).

📊 Impact: Reduces reconciliation overhead for the notification list.

🔬 Measurement: Verifiable via React DevTools Profiler by interacting with notifications and observing that unmodified items do not re-render.


PR created automatically by Jules for task 2732828983021961273 started by @ClarusIubar

Co-authored-by: ClarusIubar <101549899+ClarusIubar@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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.

@ClarusIubar

Copy link
Copy Markdown
Contributor Author

검토 결과: 방향은 유용하지만 원본 상태 그대로는 효과가 약했습니다.

보강한 내용:

  • .jules/bolt.md 제거
  • NotificationListItem에는 busyId 대신 isBusy boolean만 전달해 inactive item이 false -> false로 유지되게 수정
  • useNotificationPanelActions handler를 useEventCallback으로 안정화해 parent rerender 때 callback props가 매번 바뀌지 않게 수정
  • render-marker 기반 unit test 추가: 다른 알림이 busy 상태가 되어도 inactive notification item은 다시 render되지 않음을 고정

검증:

  • npm.cmd run test:unit -- notification-list-render
  • npm.cmd run lint
  • npm.cmd run typecheck
  • npm.cmd run build
  • git diff --check
  • UTF-8 integrity check

이제 단순 memo 추가가 아니라 실제 shallow compare가 작동하는 prop 경계가 생겼으므로 merge 가치가 있습니다.

@google-labs-jules

Copy link
Copy Markdown
Contributor

검토 결과: 방향은 유용하지만 원본 상태 그대로는 효과가 약했습니다.

보강한 내용:

  • .jules/bolt.md 제거
  • NotificationListItem에는 busyId 대신 isBusy boolean만 전달해 inactive item이 false -> false로 유지되게 수정
  • useNotificationPanelActions handler를 useEventCallback으로 안정화해 parent rerender 때 callback props가 매번 바뀌지 않게 수정
  • render-marker 기반 unit test 추가: 다른 알림이 busy 상태가 되어도 inactive notification item은 다시 render되지 않음을 고정

검증:

  • npm.cmd run test:unit -- notification-list-render
  • npm.cmd run lint
  • npm.cmd run typecheck
  • npm.cmd run build
  • git diff --check
  • UTF-8 integrity check

이제 단순 memo 추가가 아니라 실제 shallow compare가 작동하는 prop 경계가 생겼으므로 merge 가치가 있습니다.

Acknowledged. Thanks for providing the additional context and showing how to make the optimization effective by stabilizing props (isBusy boolean instead of raw ID, and callback stabilization). Understood that a simple React.memo needs proper prop reference stability and granularity to actually prevent re-renders.

@ClarusIubar ClarusIubar merged commit 206a716 into main Jun 13, 2026
6 checks passed
@ClarusIubar ClarusIubar deleted the bolt-notification-list-item-memo-2732828983021961273 branch June 13, 2026 04:33
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.

1 participant