feat: collapsible unpinned sessions within groups#311
Merged
Conversation
When a group has both pinned and unpinned sessions, unpinned sessions can be collapsed into a summary row showing 'N more sessions'. Pinned sessions always remain visible. This provides two levels of collapse: group-level (existing) and unpinned-within-group (new). - Add UnpinnedCollapsed property to SessionGroup (persisted) - Add ToggleUnpinnedCollapsed to CopilotService.Organization - Split session rendering into pinned (always visible) and unpinned (collapsible) passes with toggle sub-header - Add CSS for unpinned toggle row - Add 3 tests for the new functionality Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When expanded, label says 'N unpinned sessions' instead of 'N more sessions' since the sessions are already visible. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0e73a2c to
3709b38
Compare
arisng
pushed a commit
to arisng/PolyPilot
that referenced
this pull request
Apr 4, 2026
## Summary
Adds a second level of collapse within sidebar groups. When a group
contains both pinned and unpinned sessions, the unpinned sessions can be
collapsed into a compact **"N more sessions"** toggle row, keeping
pinned sessions always visible.
### Problem
Groups with many sessions (especially provider plugin groups) clutter
the sidebar. Users need a way to keep important sessions visible while
hiding the rest without collapsing the entire group.
### Solution
**Two-level collapse:**
1. **Group level** (existing) — collapse/expand the entire group via the
group header chevron
2. **Unpinned level** (new) — within an expanded group, collapse/expand
just the unpinned sessions
**Behavior:**
- If a group has **both pinned and unpinned** sessions, a clickable
toggle row appears between them: `▶ 5 more sessions` / `▼ 5 more
sessions`
- Pinned sessions are **always visible** regardless of the unpinned
collapse state
- If a group has **only pinned** or **only unpinned** sessions, all
sessions render normally (no toggle row)
- The collapse state persists in `organization.json` via
`SessionGroup.UnpinnedCollapsed`
### Changes
- **`SessionOrganization.cs`** — Added `UnpinnedCollapsed` property to
`SessionGroup`
- **`CopilotService.Organization.cs`** — Added
`ToggleUnpinnedCollapsed()` method
- **`SessionSidebar.razor`** — Split the session rendering loop into
pinned-first and unpinned-second passes with toggle sub-header. Uses
helper methods (`GetFilteredSessions`, `HasUnpinnedToggle`,
`CountUnpinned`) to avoid Razor `@{}` block parser issues at deep
nesting levels.
- **`SessionSidebar.razor.css`** — Styled the unpinned toggle row
(indented, muted, compact)
- **Tests** — 3 new tests: default value, JSON round-trip serialization,
toggle behavior
### Testing
- All 2108 tests pass (2105 existing + 3 new)
- Build succeeds on Mac Catalyst
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Shane Neuville (HE/HIM) <shneuvil@microsoft.com>
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
Adds a second level of collapse within sidebar groups. When a group contains both pinned and unpinned sessions, the unpinned sessions can be collapsed into a compact "N more sessions" toggle row, keeping pinned sessions always visible.
Problem
Groups with many sessions (especially provider plugin groups) clutter the sidebar. Users need a way to keep important sessions visible while hiding the rest without collapsing the entire group.
Solution
Two-level collapse:
Behavior:
▶ 5 more sessions/▼ 5 more sessionsorganization.jsonviaSessionGroup.UnpinnedCollapsedChanges
SessionOrganization.cs— AddedUnpinnedCollapsedproperty toSessionGroupCopilotService.Organization.cs— AddedToggleUnpinnedCollapsed()methodSessionSidebar.razor— Split the session rendering loop into pinned-first and unpinned-second passes with toggle sub-header. Uses helper methods (GetFilteredSessions,HasUnpinnedToggle,CountUnpinned) to avoid Razor@{}block parser issues at deep nesting levels.SessionSidebar.razor.css— Styled the unpinned toggle row (indented, muted, compact)Testing