fix(web): polish session search and ordering#551
Conversation
Align session search controls, hide the native search clear button, and keep collapsed session previews ordered by activity while still expanding previews for the selected session.
There was a problem hiding this comment.
Findings
- [Major] Selected sessions past the preview limit can remain hidden —
isSessionGroupExpandedtreats a missingsessions::...override as collapsed, and afalseoverride as expanded. The new effect deletes a collapsed preview override instead of setting the expanded state, so after removing selected-session promotion a deep-linked selected session beyond the first 8 rows still is not rendered. Evidenceweb/src/components/SessionList.tsx:796.
Suggested fix:const isPreviewExpanded = prev.get(sessionPreviewKey) === false if (!isPreviewExpanded) { next.set(sessionPreviewKey, false) changed = true }
Summary
Review mode: initial
One issue found: selected-session auto-expansion does not actually expand collapsed session previews because this collapse key uses inverted boolean semantics. Residual testing gap: no component/helper coverage for a selected session beyond GROUP_SESSION_PREVIEW_LIMIT becoming visible.
Testing
Not run (automation; review-only and PR code treated as untrusted).
HAPI Bot
| } | ||
| // Expand session preview so deep-linked/selected sessions past the preview limit remain visible | ||
| const sessionPreviewKey = `sessions::${group.key}` | ||
| if (prev.has(sessionPreviewKey) && prev.get(sessionPreviewKey)) { |
There was a problem hiding this comment.
[MAJOR] Selected sessions past the preview limit can remain hidden. isSessionGroupExpanded treats a missing sessions::... override as collapsed, and a false override as expanded; deleting the key here leaves the default collapsed state in place, so a deep-linked selected session beyond the first 8 rows still is not rendered after selected-session promotion was removed.
Suggested fix:
const isPreviewExpanded = prev.get(sessionPreviewKey) === false
if (!isPreviewExpanded) {
next.set(sessionPreviewKey, false)
changed = true
}
Summary
Testing
bun --cwd web typecheckbun --cwd web test --run src/components/SessionList.test.ts