Skip to content

Commit 00524e0

Browse files
mortenasloclaudeAThraen
authored
feat(sidebar): group bulk actions, empty-area quick menu, sort (#40)
* feat(groups): bulk actions in group right-click menu Adds Remote control all, Sleep all, Start all, and Close all entries to both the group-strip tab and the inline group-header context menus. Items enable/disable based on live vs dormant member counts. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(sidebar): empty-area quick menu, bulk actions, sort sessions Sidebar right-click on empty space (header, session list, group strip, empty terminal grid) now shows a shared quick menu with: - New session / New group - Bulk actions submenu — Wake all dormant, Sleep all, Close all - Group display mode toggle (None / FilterStrip / InlineHeaders) - Expand / collapse all group sections - Session row icons mode (OnHover / Always / Hidden) - Show git branch / worktree clusters toggles - All settings… The legacy + group footer button is removed; group creation flows through "New group…" in the same menu. New sort button in the SESSIONS header (left of +). Opens a direction-aware menu: Name, Folder, Last active, Git ▸ (Branch, Dirty, Repo). Re-clicking the active field flips direction; switching fields picks the field's natural starting direction. Direction glyph lives in the MenuItem icon slot so it column-aligns. Sessions without live git info sink to the bottom of git-based orderings. ShellSession gains a LastActivityAt timestamp updated when a session becomes the active one, persisted via the existing state.json path. SessionManager.SortSessions exposes a one-shot Sort(Comparison). Visual polish: vertical filter strip now has a hairline divider between All/Ungrouped and the user groups; Ungrouped glyph changed from "∅" to "□" so it reads as the hollow companion to the "▦" All glyph. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(sort): backfill LastActivityAt from CreatedAt for legacy sessions LastActivityAt was initialized to DateTime.UtcNow, which fires when System.Text.Json deserializes a pre-PR state.json that doesn't carry the key — every legacy session loaded as "active right now" and sorted to the top of "Sort by Last active" in load order rather than reflecting real activity. Initialize to default (DateTime.MinValue) as a sentinel; SessionManager. LoadFromState then backfills from CreatedAt for any session that comes back from disk without the field. SessionManager.CreateSession sets it explicitly on the new-session path so new sessions still get a real timestamp. --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Allan Thraen <allan@codeart.dk>
1 parent 7f3f813 commit 00524e0

4 files changed

Lines changed: 480 additions & 34 deletions

File tree

src/CodeShellManager/MainWindow.xaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,24 +250,30 @@
250250
</Border>
251251

252252
<DockPanel Grid.Column="1">
253-
<Border DockPanel.Dock="Top" Padding="12,8,8,8" BorderThickness="0,0,0,1"
254-
BorderBrush="#313244">
253+
<Border x:Name="SidebarHeader" DockPanel.Dock="Top" Padding="12,8,8,8" BorderThickness="0,0,0,1"
254+
BorderBrush="#313244" Background="#181825">
255255
<Grid>
256256
<Grid.ColumnDefinitions>
257257
<ColumnDefinition Width="*"/>
258258
<ColumnDefinition Width="Auto"/>
259+
<ColumnDefinition Width="Auto"/>
259260
</Grid.ColumnDefinitions>
260261
<TextBlock Grid.Column="0" Text="SESSIONS" Foreground="#6c7086" FontSize="10"
261262
FontWeight="Bold" VerticalAlignment="Center"/>
262-
<Button Grid.Column="1" Content="+" Style="{StaticResource ToolBtn}"
263+
<Button Grid.Column="1" x:Name="SortSessionsButton" Content="" Style="{StaticResource ToolBtn}"
264+
ToolTip="Sort sessions" Click="SortSessionsButton_Click"
265+
Width="26" Height="24" FontSize="13" Foreground="#cdd6f4"
266+
VerticalAlignment="Center" Margin="0,0,2,0"
267+
Padding="0,0,0,1"/>
268+
<Button Grid.Column="2" Content="+" Style="{StaticResource ToolBtn}"
263269
ToolTip="New Session (Ctrl+T)" Click="NewSession_Click"
264270
Width="26" Height="24" FontSize="16" Foreground="#a6e3a1"
265271
VerticalAlignment="Center" Margin="0,0,2,0"
266272
Padding="0,0,0,2"/>
267273
</Grid>
268274
</Border>
269275
<ScrollViewer VerticalScrollBarVisibility="Auto">
270-
<StackPanel x:Name="SidebarSessionList" AutomationProperties.AutomationId="SidebarSessionList" Margin="6,6"/>
276+
<StackPanel x:Name="SidebarSessionList" AutomationProperties.AutomationId="SidebarSessionList" Margin="6,6" Background="Transparent"/>
271277
</ScrollViewer>
272278
</DockPanel>
273279
</Grid>

0 commit comments

Comments
 (0)