Repository navigation
feat: optimize rendering and stability of task components - #783
Conversation
- Introduced `useStableCallback` and `useStableValue` hooks to maintain stable identities for callbacks and values, reducing unnecessary re-renders in task-related components. - Refactored `InteractionLayout`, `ListGroup`, and `ListView` components to utilize stable callbacks and values, improving performance during task updates and interactions. - Implemented a `combineColumnQueries` function to optimize the handling of column queries in `InteractionLayout`, preventing excessive re-computation and re-renders. - Enhanced `IdDirectory` to manage avatar URLs more efficiently, preventing unnecessary updates when only the signature changes. - Added tests to ensure the stability of avatar URLs and the correct behavior of the `MemberDirectory` when handling re-signed avatars.
There was a problem hiding this comment.
Important
The new board performance spec only runs on Chromium: it opens a CDP session and measures the Long Tasks API, both Chromium-only, so the firefox, webkit and mobile-safari projects will fail at newCDPSession. One beforeEach guard fixes it.
Approach: sound — it removes the identity churn at its sources (combined query results, stable callbacks, memoized rows/cards, a directory that stops re-notifying on re-seeded avatars) rather than trimming the symptoms, and the presigned-URL cache keeps signature churn from reaching <img>.
Reviewed changes
- Combined column queries.
combineColumnQueriesnarrows each column query to{ data, dataUpdatedAt, fetchStatus }— exactly whatInteractionLayoutreads — sotasksand everything derived from it keeps its identity between renders. - New stability hooks.
useStableCallbackanduseStableValue, applied to drag/drop/click/delete handlers and to the column and group definitions every card and row receives. - Memoized leaves.
BoardCardSlotandListRowContentextracted as module-levelmemocomponents, with prop parity against the previous inline JSX verified for delete/move gating,canEdit,swimDefandsubtasks. - Single grouping pass.
ListViewbuilds every group's tasks in one memoized pass instead of afilterper group per render, preserving global order and multi-group membership. - Member directory.
IdDirectory.storeskips the swap and the subscriber notification when a re-seed only differs by a presigned signature, killing the per-page notification storm fromseedTaskPeople; the 20-minute keep window is comfortably inside the API's 1 h avatar TTL. - Stable avatars.
stableSignedUrlcaches presigned avatar URLs by signature-less path, so refetches no longer re-download every avatar or blink them back to initials. - Tests. Two directory tests for the re-sign behaviour, three for
stableSignedUrl, and the three-scenario Playwright perf spec.
Biome is clean on all changed files, tsc -b reports nothing in them, and the 79 tests across board-view, task-card, member-directory, provider-logos and view-utils pass.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Chromium-only perf spec guarded.
board-performance.spec.tsnow skips non-Chromium projects inbeforeEach, before any seeding, sofirefox,webkitandmobile-safarino longer fail atnewCDPSessionand the CDP timing budgets stay meaningful. - Stable no-swimlane def. The render-scope
noSwim/noSwimAllobjects are replaced by a single module-scopeNO_SWIMLANE, so cards in the fallback row keep a stableswimDefprop andBoardCardSlot'smemoactually applies there. No consumer mutates group defs, so sharing the singleton is safe. - Shared signed-URL helpers.
SIGNED_URL_KEEP_MSandisSignedUrl()are exported once fromprovider-logos.tsand consumed byid-directory.ts, removing the duplicated TTL constant and signature sniff. The module only has type-only imports, so the new import introduces no runtime cycle.
All three findings from the previous review are addressed and their threads resolved.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
…L handling and memoization logic
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the c199fbd delta on top of the previously approved f8a3336: the stability hook now compares structurally, the member directory refreshes cached aliases again, and the avatar URL cache became signature-age aware and bounded.
- Structural equality in
useStableValue. The JSON-stringify comparison is replaced by a recursivedeepEqual, so function-valued orundefinedfields no longer count as equal (the old comparison could pin the first value forever) and property order no longer matters. - Cached aliases refresh on lookup.
IdDirectory.storenow writes a fetched record under keys already in the cache even when they were not part of the requested batch, restoring refresh of alternate ids while unknown non-requested keys are still skipped. Lookups still notify once per chunk, so this adds no notification traffic. - Signature-age-aware avatar cache.
stableSignedUrlreadsX-Amz-Dateand keeps a fresher cached URL rather than swapping in an older-signed one. The cache is bounded at 500 entries, pruning expired entries first and clearing only as a last resort; when an avatar is uncached the input URL is returned, so it cannot flicker on data that has not been refetched. - Coverage. New cases assert that an older-signed URL cannot replace a fresh one and that a re-signed avatar is taken once the 20-minute keep window elapses.
All three threads from the first review remain resolved, and none needed action in this delta.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Fixes #781 (platform becomes very slow: avatars missing/reloading, clicks in task details delayed by seconds, whole UI redrawn when a column loads its next page).
Root causes
useQueriesresult.InteractionLayoutgot a new array every render, sotasksand everything derived from it recomputed on every commit, including when a task dialog opened.React.memocould not help and every card/row re-rendered on each commit.IdDirectory.seed()notified on unchanged data, re-rendering every member/sprint/agent subscriber after each page load.X-Amz-Signature/X-Amz-Date). Used as<img src>, each response made the browser re-download and flash every avatar.Changes
useStableCallback(stable identity, calls the latest function) anduseStableValue(keeps the previous reference while the value is structurally equal).interaction-layout.tsx:useQueriesnow uses a stablecombinefunction; the delete handler is stable.board-view.tsx: new memoizedBoardCardSlot, stable handlers and column definitions, shared empty-array defaults.list-group.tsx/list-view.tsx: new memoizedListRowContent, stable handlers and group definitions, and each group's task array is built once per task change. The home page's assigned-tasks list sharesListGroup, so it benefits too.id-directory.ts:seed()only notifies when something actually changed. Signed URLs that differ only by signature are treated as equal, and the first URL is kept for 20 minutes.provider-logos.ts:stableSignedUrlinresolveAvatarSrc, the single choke point for all avatars, so every avatar in the app keeps a stablesrc. A new upload (different path) is picked up immediately, and the kept URL is replaced well before the 1h signature expires.Tests
board-performance(feature + spec), run with 4x CPU throttling, 40 tasks per status, and avatar URLs re-signed on every response:stableSignedUrland forMemberDirectoryhandling re-signed avatars.tsc -bclean, 1731 web unit tests pass, 149 related e2e specs pass (2 skipped), and Biome shows the same warnings as before.Notes
🤖 Generated with Claude Code