Skip to content

Investigate: server ungroups session data that client immediately re-groups by project #203

@danshapiro

Description

@danshapiro

Opportunity

The server's session directory API flattens its internal ProjectGroup[] structure into flat SessionDirectoryItem[] for the read-model response. The client immediately re-groups them back into ProjectGroup[] via groupDirectoryItemsAsProjects() in api.ts and searchResultsToProjects() in sessionsThunks.ts.

This is unnecessary round-trip work — the server ungroups what the client immediately re-nests.

Analysis

Low-medium impact, low complexity. The server could return items already grouped by project, or include a grouped: true response variant. The main consideration is that the flat-item format was likely chosen for pagination simplicity (cursor-based paging over flat items). A grouped response would need a different cursor strategy, or the server could return both flat items and a project grouping index.

Action

Investigate and validate this opportunity. Determine the right implementation approach following TDD.

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