diff --git a/.jules/bolt.md b/.jules/bolt.md index d0b0a9997..ade2b5813 100644 --- a/.jules/bolt.md +++ b/.jules/bolt.md @@ -19,3 +19,6 @@ **Learning:** When using a dictionary purely to track the presence of keys (e.g. `has_sent_message[key] = True`), checking for presence with `.get(key, False)` carries unnecessary semantic and memory overhead. Sets in Python provide a cleaner `key in set_name` syntax for boolean presence checks and slightly reduced memory footprint, while maintaining O(1) time complexity. **Action:** When tracking unique occurrences or boolean presence of items where the value itself doesn't carry additional information, use a `set` and its `.add()` and `in` operators instead of a `dict` mapping to `True` or `False`. +## 2025-02-12 - Memoizing My Tasks view inside JSX +**Learning:** Inline mapping of arrays inside JSX in large React components causes O(N) recalculation on every render. Although the `kanbanBoard` in `TasksLayout` was properly memoized, the `myTasksBoard` list was still mapped inline in the React return block, causing main thread blocking when other layout state (like search) was updated. +**Action:** Always verify that *all* conditional array map rendering blocks are properly wrapped in a `useMemo` hook with all necessary external variables and setters in the dependency array (e.g. `[filteredTicketTasks, setSelectedTaskId, setViewMode]`) to prevent state changes in unrelated components from causing a bottleneck. diff --git a/frontend/src/components/TasksLayout.tsx b/frontend/src/components/TasksLayout.tsx index 034aa6911..d163b518d 100644 --- a/frontend/src/components/TasksLayout.tsx +++ b/frontend/src/components/TasksLayout.tsx @@ -306,6 +306,28 @@ export function TasksLayout() { [ticketTasks], ); + // β‘ Bolt: Wrap My Tasks list in useMemo to prevent O(N) re-renders + // π― Why: Mapping over potentially large lists of tasks blocks the main thread during unrelated state updates. + const myTasksBoard = useMemo(() => ( +
μλͺ μΈμ μ μ°κ²°λ λ΄ μμ μ΄ μμ΅λλ€.
+ )} +μλͺ μΈμ μ μ°κ²°λ λ΄ μμ μ΄ μμ΅λλ€.
- )} -