Skip to content

"Show All" button in DirectoryGroup never expands beyond INITIAL_SESSIONS_SHOWN #150

Description

@edspencer

Bug

In packages/web/src/client/src/components/all-chats/DirectoryGroup.tsx, sessionsToShow is hardcoded to filteredSessions.slice(0, INITIAL_SESSIONS_SHOWN) with no local state to track whether the user clicked "Show all".

Clicking the button calls loadMoreGroupSessions(encodedPath), which fetches more sessions from the server and updates the store — but the rendering slice cap never changes. The user can never see more than 10 sessions per directory group regardless of how many are loaded.

Steps to Reproduce

  1. Open All Chats page
  2. Find a directory group with >10 sessions
  3. Click "Show all N sessions"
  4. Observe: still only 10 sessions displayed

Expected

After clicking "Show all", all locally-loaded sessions should be rendered. If there are more on the server, fetch and display those too.

Fix Direction

Add a local showAll state flag. When showAll is true, render filteredSessions unsliced. The "Show all" click should first expand locally-loaded sessions, and only fetch from the server when hasMoreOnServer is true.

File

packages/web/src/client/src/components/all-chats/DirectoryGroup.tsx ~line 72-80

Origin

PR #144 CodeRabbit review

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions