Skip to content

Conversation

@forketyfork
Copy link
Owner

Solution:

  • Added SessionViewState and SessionInteractionComponent to own per-session UI interaction state (selection/hover/scrollback/attention) and cursor handling within UiRoot.
  • Routed mouse/scroll events through UiRoot with a FocusSession action, and reset view state on despawn/restart and when input should exit scrollback.
  • Updated renderer to consume view state for overlays, removed UI fields from SessionState, expanded UiHost with terminal sizing/mouse context, and documented the architecture change.

Issue: Review highlighted UI state stored in SessionState; user requested full refactor to align with architecture rules.

Solution: Added SessionViewState and SessionInteractionComponent to own per-session UI interaction state.
Rewired input, focus actions, and rendering to use UI-managed view state.
Removed UI fields from SessionState and updated UiHost/architecture docs.
@forketyfork forketyfork requested a review from Copilot January 19, 2026 15:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors terminal session UI state management by moving per-session UI interaction state (selection, hover, scrollback, and cursor handling) from SessionState into a new SessionViewState managed by SessionInteractionComponent in UiRoot.

Changes:

  • Introduced SessionViewState to hold per-session UI state (selection, hover, scrollback, attention)
  • Created SessionInteractionComponent to manage view states and handle mouse/scroll/cursor interactions
  • Removed UI-related fields from SessionState and relocated interaction logic from main.zig

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/ui/types.zig Added terminal sizing and mouse context fields to UiHost, added FocusSession action
src/ui/session_view_state.zig New file defining per-session UI state (selection, hover, scrollback)
src/ui/mod.zig Exported SessionViewState and SessionInteractionComponent
src/ui/components/session_interaction.zig New component handling all terminal mouse/scroll interaction and cursor logic
src/session/state.zig Removed UI fields (status, attention, scrollback, selection, hover, scroll) from SessionState
src/render/renderer.zig Updated to consume SessionViewState for rendering overlays instead of SessionState
src/main.zig Refactored to use SessionInteractionComponent; removed inline mouse/scroll/selection handlers
docs/architecture.md Documented new session view state architecture

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@forketyfork forketyfork merged commit 8b69516 into main Jan 19, 2026
4 checks passed
@forketyfork forketyfork deleted the feat/session-view-state branch January 19, 2026 15:52
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