Skip to content

Selecting a group tab doesn't restore focus to the last active session in that group #137

Description

@AThraen

Symptom

Sometimes, clicking a group tab in the sidebar (FilterStrip mode) filters the session list to that group, but the terminal view does not jump back to the session that was active in that group last time — so the user has to scroll/search through the filtered list to find and re-select it manually.

Suspected area

MainWindow.xaml.cs's group-tab click handling (around the _vm.ActiveGroupId = groupId assignment near line 2737) sets the active group filter but doesn't appear to also call FocusSessionCommand to restore whichever session was last active within that group. Related state: MainViewModel.ActiveGroupId / EffectiveActiveGroupId, AppSettings.FilterGridByActiveGroup.

A fix likely needs to track "last active session per group" (e.g. a Dictionary<groupId, sessionId> updated whenever ActiveSession changes) and, when a group tab is selected, look up and focus that session if it's still present/visible — falling back to the first session in the group if none is remembered or it no longer exists.

Repro

  1. Have multiple groups, each with 2+ sessions.
  2. Make session B active within Group 1 (not the first session in that group).
  3. Switch to Group 2, then back to Group 1.
  4. Expected: session B is active/focused again. Actual: sometimes a different session (e.g. the first in the list) is shown, requiring a manual scroll/click to get back to B.

Reported by the maintainer while using the app day-to-day; not yet root-caused or reproduced with an isolated test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions