mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-27 17:58:07 +00:00
The statusbar subscribed to `$focusedSessionState` — a projection of `$sessionStates`, which is republished on every message delta — but reads only three fields off it. Every token therefore re-ran useStatusbarItems and rebuilt all ~9 item objects, and since StatusbarItemView was not memoized, one changed item (the running timer) re-rendered the whole bar. Adds `useStoreSelector` beside the existing `useSessionSlice`, the same narrowing idea for a scalar instead of a keyed array: subscribe to the store, but bail out unless the selected value changes. Applies it to the three fields the statusbar actually reads, and memoizes StatusbarItemView. Measured over five concurrent streaming tabs (`render-churn`): total renders 78,385 -> 21,701 (-72%) wasted renders 10,432 -> 6,112 (-41%) TooltipContent 2,304 -> 143 (-94%) StatusbarItemView 2,174 -> 0 |
||
|---|---|---|
| .. | ||
| bootstrap-installer | ||
| desktop | ||
| shared | ||