feat(web): add collapsible archived section in session list#489
Open
junmo-kim wants to merge 5 commits intotiann:mainfrom
Open
feat(web): add collapsible archived section in session list#489junmo-kim wants to merge 5 commits intotiann:mainfrom
junmo-kim wants to merge 5 commits intotiann:mainfrom
Conversation
Within each machine group, archived project groups are now separated into a collapsible "Archived (N)" section that defaults to collapsed. This reduces scroll distance when working across multiple machines. The section only appears when both active and archived groups exist in the same machine. Selecting an archived session auto-expands the section.
- Fix stale closure in toggleArchivedSection: read from prev instead of render-time state - Add aria-expanded to archived section toggle button - Change ProjectGroupItem header from div to button for keyboard accessibility - Add cleanup for stale archivedCollapsed entries when groups change
…ollapse - Extract groups.find() to a single call at the top of the auto-expand effect instead of duplicating it inside setCollapseOverrides and outside - Add aria-expanded to ProjectGroupItem button for accessibility parity with the archived section toggle
There was a problem hiding this comment.
Findings
- [Major] Nested button in the project-group row introduces invalid interactive markup and an accessibility regression.
ProjectGroupItemnow renders the entire row as a<button>while still placingCopyPathButtoninside it, andCopyPathButtonitself renders a<button>. Browsers and assistive tech handle nested buttons inconsistently, so the copy affordance can become unfocusable or trigger the wrong control. Evidenceweb/src/components/SessionList.tsx:486,web/src/components/SessionList.tsx:497
Suggested fix:
<div className="group/project sticky top-0 z-10 flex items-center gap-2 px-1 py-1.5 rounded-lg transition-colors hover:bg-[var(--app-subtle-bg)]">
<button
type="button"
className="flex min-w-0 flex-1 items-center gap-2 text-left"
onClick={onToggle}
title={group.directory}
aria-expanded={!isCollapsed}
>
<ChevronIcon className="h-3.5 w-3.5 text-[var(--app-hint)] shrink-0" collapsed={isCollapsed} />
<span className="font-medium text-sm truncate flex-1">{group.displayName}</span>
<span className="text-[11px] tabular-nums text-[var(--app-hint)] shrink-0">({group.sessions.length})</span>
</button>
<CopyPathButton path={group.directory} className="opacity-0 group-hover/project:opacity-100 transition-opacity duration-150" />
</div>Summary
- Review mode: initial
- 1 finding: the new project-group header contains a nested
<button>, which is invalid HTML and a keyboard/screen-reader regression. - Residual risk: Not found in repo/docs: component coverage for the new archived-section toggle and auto-expand-on-selection behavior.
Testing
- Not run (automation)
HAPI Bot
| const { group, isCollapsed, onToggle, onSelect, api, selectedSessionId } = props | ||
| return ( | ||
| <div> | ||
| <button |
There was a problem hiding this comment.
[MAJOR] ProjectGroupItem now uses a <button> for the whole row, but CopyPathButton inside this row still renders its own <button> (web/src/components/SessionList.tsx:497). Nested buttons are invalid HTML and often break keyboard focus / assistive-tech behavior. Keep the toggle button and copy button as siblings instead of parent and child.
Suggested fix:
<div className="group/project ...">
<button
type="button"
className="flex min-w-0 flex-1 items-center gap-2 text-left"
onClick={onToggle}
title={group.directory}
aria-expanded={!isCollapsed}
>
...
</button>
<CopyPathButton path={group.directory} className="opacity-0 group-hover/project:opacity-100 transition-opacity duration-150" />
</div>Move CopyPathButton out of the toggle <button> to be a sibling, preventing invalid nested <button> HTML that breaks keyboard focus and assistive tech.
There was a problem hiding this comment.
Findings
- No additional diff-attributable issues identified in the current head.
Summary
- Review mode: follow-up after new commits
- No new findings on the latest diff.
- Residual risk: Not found in repo/docs or adjacent
SessionListtests: coverage for the archived-section toggle, auto-expanding the archived section when the selected session is archived, and cleanup of stale archived-collapse state.
Testing
- Not run (automation):
bunis not available in this runner, sobun run test web/src/components/SessionList.test.tsandbun run typecheckcould not be executed.
HAPI Bot
There was a problem hiding this comment.
Findings
- No additional diff-attributable issues identified in the current head.
Summary
- Review mode: follow-up after new commits
- No new findings on the latest diff.
- Residual risk: Not found in adjacent
SessionListtests: coverage for the archived-section toggle, auto-expanding the archived section when the selected session is archived, and cleanup of stale archived-collapse state.
Testing
- Not run (automation):
bunis not available in this runner, sobun test web/src/components/SessionList.test.tsandbun run typecheckcould not be executed.
HAPI Bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When working across multiple machines, archived project groups accumulate
in the sidebar and push active sessions far apart, requiring excessive
scrolling.
into a collapsible "Archived (N)" section (default: collapsed)
in the same machine — if all groups are archived, no separator is shown
Test plan