Skip to content

Commit d873fae

Browse files
docs(mobile): scope the recycler estimate claim and document the sidebar divider
Two audit callouts on exact e8d01cc, both wording rather than behavior: - The pool warning is mitigated for the seeded short-list regime, not eliminated: after first layout the full drawDistance applies, so a sudden expansion past the pooled headroom (~25+ items at once) still creates a container on demand, dev-only, one pass ahead of the measured-height pool growth. The constant's comment now says that, and drops a formula that described the post-layout span rather than the initial seed. - The sidebar deliberately does not consume the per-item showTrailingDivider stamp: it never passed the prop even before the list was recycled, so its hairline under every row is the status-quo look, and changing it is out of scope for a perf PR. The stamp still rides the shared items (Home needs it); the sidebar's cost is the occasional divider-only invalidation that re-renders identically. Commented at the render site.
1 parent e8d01cc commit d873fae

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

‎apps/mobile/src/features/home/HomeScreen.tsx‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,18 @@ interface HomeScreenProps {
141141
const ESTIMATED_THREAD_ROW_HEIGHT = 72;
142142
// v2 rows are mixed-height: settled slim rows run ~60dp, single-line cards
143143
// measured ~74dp on device (252px on the Pixel 10 Pro screenshot), two-line
144-
// cards ~94dp. The estimate seeds the recycler's container count:
145-
// `ceil(contentSpan / estimate)`, which LegendList clamps to the content span
146-
// while the list is shorter than viewport + 2x drawDistance. An estimate at
147-
// or below the average row height keeps that count above the item count, so
148-
// a shelf-expand re-layout (which transiently demands slightly more
149-
// containers than there are items) finds one pooled instead of logging the
150-
// dev-mode "no unused container available" warning and creating one on
151-
// demand. An estimate tuned to the tallest card (~92) fires that warning on
152-
// every short/expanded list, so the average wins; oversized cards self-correct
153-
// through LegendList's measured spans, and long lists pool 3x the estimated
154-
// container count regardless.
144+
// cards ~94dp. The estimate seeds the recycler's initial container count,
145+
// `ceil((scrollLength + 2 * INITIAL_DRAW_DISTANCE) / estimate)` with the
146+
// initial draw distance capped at 50, so an estimate at or below the average
147+
// row height starts the pool at or above the item count for the short lists
148+
// that LegendList otherwise keeps pooling to exactly its item count — that is
149+
// what stopped the dev-mode "no unused container available" warning on the
150+
// seeded short-list device passes. It is a mitigation, not an elimination:
151+
// after first layout the full drawDistance applies, and a sudden expansion
152+
// past the pooled headroom (~25+ items appearing at once) still creates a
153+
// container on demand with the dev-only warning one pass ahead of the
154+
// measured-height pool expansion. The old tallest-card estimate (~92) fired
155+
// that warning on every ordinary shelf expand, so the average wins.
155156
const ESTIMATED_THREAD_LIST_V2_ROW_HEIGHT = 72;
156157
const PRE_LIQUID_GLASS_BOTTOM_TOOLBAR_HEIGHT = 44;
157158
/**

‎apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,14 @@ function ThreadNavigationSidebarPane(
910910
case "v2-thread": {
911911
const thread = item.item.thread;
912912
const scopeKey = scopedProjectKey(thread.environmentId, thread.projectId);
913+
// Intentional difference from Home: the sidebar never passed
914+
// `showTrailingDivider` even before this list was recycled, so its
915+
// hairline draws under every row. Home consumes the per-item divider
916+
// stamp to suppress dividers at section boundaries; changing the
917+
// sidebar's long-standing look is out of scope here. The stamp still
918+
// rides on the shared items (Home needs it), which costs this pane
919+
// the occasional divider-only invalidation that re-renders
920+
// identically.
913921
return (
914922
<ThreadListV2Row
915923
onNewThreadOnBranch={props.onNewThreadOnBranch}

0 commit comments

Comments
 (0)