Skip to content

fix: active-only session filter + paginated "Show N more" (closes #901)#903

Open
swear01 wants to merge 2 commits into
tiann:mainfrom
swear01:fix/issue-901-active-only-and-paginated-show-more
Open

fix: active-only session filter + paginated "Show N more" (closes #901)#903
swear01 wants to merge 2 commits into
tiann:mainfrom
swear01:fix/issue-901-active-only-and-paginated-show-more

Conversation

@swear01

@swear01 swear01 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Closes #901

Summary

Two web-only sidebar improvements for repos that accumulate many inactive sessions:

  1. "Active sessions only" toggle (Settings → Display). A persisted, default-off preference that hides inactive sessions in the sidebar. The currently-selected session stays visible even if inactive, so toggling never yanks your open session away. Mirrors the existing useSessionListStatusMode / useSessionPreviewLimit localStorage prefs.

  2. Paginated "Show N more". Previously one click expanded every hidden session at once, which is jarring in a long repo. Now each click reveals one batch (size = the existing session preview limit), and once everything is shown the button becomes "Show less" to collapse back to the initial preview.

These are complementary: the toggle is a hard filter for people who only care about live sessions, while pagination improves browsing for people who do want the full history.

Changes

  • web/src/hooks/useShowActiveSessionsOnly.ts (new) — localStorage-backed boolean pref with cross-tab sync.
  • web/src/components/SessionList.tsxfilterActiveSessionsOnly() (keeps selected), and per-group reveal-cap pagination via getNextSessionVisibleCount() replacing the binary expand.
  • web/src/routes/settings/index.tsx — toggle row in Display, reusing the existing switch style.
  • web/src/lib/locales/{en,zh-CN}.ts — new strings.

Test plan

  • Failing test added first that reproduces the issue (TDD)
  • Focused tests pass — SessionList.test.ts 29/29 (6 new: active-only filter + pagination helper)
  • tsc --noEmit clean
  • Full web suite passes — 970/970 (incl. i18n key-parity)

swear01 and others added 2 commits June 13, 2026 19:17
…nn#901)

Add a persisted 'Active sessions only' toggle in Settings -> Display that
hides inactive sessions in the sidebar while keeping the selected session
visible. Change 'Show N more' to reveal one batch (preview-limit size) per
click instead of expanding every hidden session at once, with 'Show less'
to collapse back to the initial preview.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • No issues found in the added or modified lines.

Summary

  • Review mode: initial
  • Reviewed the web-only session sidebar/settings changes against the surrounding route and session-list behavior. Residual risk: I did not execute the PR code or tests in this automation review.

Testing

  • Not run (automation)

HAPI Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web: "Active sessions only" toggle + paginated "Show N more" for repos with many inactive sessions

1 participant