Skip to content

feat: collapsible unpinned sessions within groups#311

Merged
PureWeen merged 2 commits intomainfrom
feature/collapsible-unpinned-sessions
Mar 8, 2026
Merged

feat: collapsible unpinned sessions within groups#311
PureWeen merged 2 commits intomainfrom
feature/collapsible-unpinned-sessions

Conversation

@Redth
Copy link
Copy Markdown
Collaborator

@Redth Redth commented Mar 8, 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

Redth and others added 2 commits March 8, 2026 11:36
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>
@PureWeen PureWeen force-pushed the feature/collapsible-unpinned-sessions branch from 0e73a2c to 3709b38 Compare March 8, 2026 16:37
@PureWeen PureWeen merged commit 7dfcd9a into main Mar 8, 2026
@PureWeen PureWeen deleted the feature/collapsible-unpinned-sessions branch March 8, 2026 16:40
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>
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.

2 participants