UI: chats sidebar search shows divider via wrong row list (index mismatch between filtered and unfiltered children) #100

Open
opened 2026-09-05 05:22:22 +00:00 by mara · 0 comments
Collaborator

Summary

Commit 200ae83a made the chats sidebar render filtered children during search (visibleChildContexts()), but the per-row divider class still computes against the unfiltered child list. Index/row mismatch when filtering hides children.

Location

  • webui/components/sidebar/chats/chats-list.html:68-69: rows iterate $store.chats.visibleChildContexts(context.id) but the divider calls $store.sidebar.hasRowDividerBefore('chat', child, childIndex, $store.chats.childContexts(context.id)).
  • Introduced in commit 200ae83a (on main via merge 5116eb4d).

Repro

  1. Create a parent chat with 3+ children arranged so a divider lands on a child (e.g. per-project label change handled by a dividerBefore row extension).
  2. Type a search term that hides an earlier child while keeping the divider child visible.
  3. childIndex (position in the filtered list) no longer matches childContexts() (unfiltered list) → dividerBefore receives wrong index/rows: dividers disappear, land on the wrong child, or appear mid-group.

Expected

Divider logic runs over the same filtered rows that are rendered.

Suggested fix

Pass the filtered list to the divider check: $store.sidebar.hasRowDividerBefore('chat', child, childIndex, $store.chats.visibleChildContexts(context.id)). Top-level rows (line 39) are unaffected since topLevelContexts() already returns the rendered list.

## Summary Commit 200ae83a made the chats sidebar render *filtered* children during search (`visibleChildContexts()`), but the per-row divider class still computes against the *unfiltered* child list. Index/row mismatch when filtering hides children. ## Location - `webui/components/sidebar/chats/chats-list.html:68-69`: rows iterate `$store.chats.visibleChildContexts(context.id)` but the divider calls `$store.sidebar.hasRowDividerBefore('chat', child, childIndex, $store.chats.childContexts(context.id))`. - Introduced in commit 200ae83a (on main via merge 5116eb4d). ## Repro 1. Create a parent chat with 3+ children arranged so a divider lands on a child (e.g. per-project label change handled by a `dividerBefore` row extension). 2. Type a search term that hides an earlier child while keeping the divider child visible. 3. `childIndex` (position in the filtered list) no longer matches `childContexts()` (unfiltered list) → `dividerBefore` receives wrong index/rows: dividers disappear, land on the wrong child, or appear mid-group. ## Expected Divider logic runs over the same filtered rows that are rendered. ## Suggested fix Pass the filtered list to the divider check: `$store.sidebar.hasRowDividerBefore('chat', child, childIndex, $store.chats.visibleChildContexts(context.id))`. Top-level rows (line 39) are unaffected since `topLevelContexts()` already returns the rendered list.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/a0-symbolics#100
No description provided.