Skip to content

feat(web): add collapsible session sidebar - #1747

Open
wu736139669 wants to merge 1 commit into
tiann:mainfrom
wu736139669:feat/collapsible-session-sidebar
Open

feat(web): add collapsible session sidebar#1747
wu736139669 wants to merge 1 commit into
tiann:mainfrom
wu736139669:feat/collapsible-session-sidebar

Conversation

@wu736139669

Copy link
Copy Markdown
Contributor

Summary

  • add desktop controls to collapse and expand the session sidebar
  • keep a 96px compact session rail with project grouping and live status indicators
  • persist the collapsed preference locally while keeping the sessions index and mobile layout expanded
  • hide secondary row metadata and inaccessible schedule tooltip references in compact mode

Testing

  • bun typecheck
  • bun run test

@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

  • [Major] Compact mode bypasses the session preview cap and mounts the full session history (web/src/components/SessionList.tsx:1604).
  • [Minor] Search/date/unread filters remain active after their controls are hidden (web/src/components/SessionList.tsx:1792).

Summary
Review mode: initial

Two issues found in the compact session-list path. No questions required.

Testing
Not run (automation): executing PR code is disallowed for this review. GitHub integration check passed; the main test workflow was pending at review time. Missing coverage: compact preview limits/expansion and collapsing while transient filters are active.

HAPI Bot

const renderDirectoryGroup = (group: SessionGroup) => {
const isCollapsed = isGroupCollapsed(group)
const visibleGroupSessions = getVisibleGroupSessions(group)
const visibleGroupSessions = compact ? group.sessions : getVisibleGroupSessions(group)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MAJOR] Compact mode bypasses the preview cap

compact ? group.sessions : ... mounts every session in every directory instead of using the configured preview limit. Collapsed panels still retain their children, and /api/sessions has no default result limit, so a long-lived installation can turn one sidebar-collapse click into hundreds or thousands of SessionItem trees/hooks and stall the page.

Suggested fix: keep the existing preview helper in compact mode and expose an icon-only expansion affordance for hidden rows.

const visibleGroupSessions = getVisibleGroupSessions(group)

{compact && hiddenSessionCount > 0 ? (
    <button
        type="button"
        onClick={() => showMoreSessions(group)}
        aria-label={t("sessions.group.expand", { n: expandCount })}
    >
        <SessionPreviewArrowIcon direction="down" className="h-3 w-3" />
    </button>
) : null}

// it cannot suppress header actions (or re-expand on its own when sessions
// return) while no search control is rendered.
const showSearch = props.sessions.length > 0
const showSearch = !compact && props.sessions.length > 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MINOR] Hidden filters keep filtering the compact rail

Changing showSearch to false only unmounts the controls. searchQuery, the custom date range, and showUnreadOnly still feed visibleSessions, so collapsing after a search/date/unread selection can produce a silently incomplete or empty rail with no visible way to understand or clear the filter until the user expands again.

Suggested fix: ignore transient filters while compact, preserving their state for when the sidebar is expanded again.

const isFiltering = !compact && (normalizedQuery.length > 0 || timeRange !== null)

const unreadFilteredSessions = useMemo(() => {
    if (compact || !showUnreadOnly) return visibleSessions
    // existing unread filtering
}, [compact, lastSeenVersion, visibleSessions, selectedSessionId, showUnreadOnly])

@heavygee heavygee added area:web Web PWA / React client community-pr PR from non-collaborator contributor enhancement New feature or request labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:web Web PWA / React client community-pr PR from non-collaborator contributor enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants