Skip to content

code-coach review: ActivateGroup conditional RebuildDocumentPane — 1 advisory suggestion #4

@psmon

Description

@psmon

Source

  • Mode 2 pre-commit review on the conditional RebuildDocumentPane fix
  • Underlying bug: clicking the same workspace sidebar button (or the
    CLI+ sidebar button on return from Settings) called ActivateGroup,
    which always called RebuildDocumentPaneterminalDocPane.Children.Clear(),
    destroying the user's split-pane Document→Pane mapping. Fix only
    rebuilds when the active group index actually changes.

Verdict

Commit approved — 0 must-fix, 0 should-fix, 1 advisory suggestion.

Suggestion

S-1 — Per-group split-layout persistence

File: Project/AgentZeroWpf/UI/APP/MainWindow.xaml.cs:1366-1410

When the user does switch to a different workspace group,
RebuildDocumentPane still runs and the new group's tabs appear in a
single LayoutDocumentPane. If the user previously built a split layout
in that group, it doesn't come back — they have to rebuild it manually
every time they leave and return.

To preserve per-group split layouts across switches, the AvalonDock
state would need to be serialized per group (XmlLayoutSerializer)
on group-switch-out, and deserialized on group-switch-in. Beyond a
single fix; should be a dedicated feature. Possibly tied to
AppWindowState persistence so split layouts survive app restarts.

Closes-when

  • Per-group AvalonDock layout serialization (or explicit
    docs/decision that group-switch resets the split layout by design)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions