Skip to content

Make the session sidebar clickable - #19

Merged
tdwd merged 4 commits into
mainfrom
sidebar-clicks
Oct 7, 2026
Merged

tdwd merged 4 commits into
mainfrom
sidebar-clicks

Conversation

@tdwd

@tdwd tdwd commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

In the session view, a click on a sidebar card selects that session (as ^g j does, so moving between live agents stays attached), and a second click in a row opens it. The wheel over the sidebar moves the cursor; over the pane it still goes to the agent.

  • The sidebar keeps its place between frames (Model.sidebarTop), so a double click cannot land on a card that scrolled. The selected card is always shown whole.
  • The session view is now drawn at the terminal's height. Below eight rows it used to be taller than the terminal, and clicks landed a card off.

Four commits. The first two and the last change no behaviour: the sidebar built as recorded lines (byte-identical render), sessionCard moved unchanged to card.go, and window moved into the tests that are its only caller.

Checked by hand in a real tmux with default settings: one click switches sessions and keeps the keyboard attached.

tdwd added 4 commits October 7, 2026 07:31
The sidebar was drawn as plain strings, so nothing could say which
session a cell of it stands for. It is now built the way the dashboard
columns are: sidebarLines records each card line as standing for its
row in Model.rows (hitRow), and sidebarWindow lays those lines into the
column. renderSidebar draws from them.

No behaviour change. The rendered sidebar is byte-identical at every
cursor position, with the prefix armed and not, on a list long enough
to clip at both edges, and with no sessions.
sessionCard and its comments move unchanged from sidebar.go to card.go.
The sidebar is about to gain its windowing and hit testing, and the
card, which is most of the file, is a separate job: what one session
looks like, not where the column scrolls to.

No behaviour change.
A click on a sidebar card selects that session through landOn, as ^g j
does, so a click from one live agent to another stays attached. A
second press in a row on the same card opens it, as on the dashboard,
and any key or other press between the two breaks the pair. The wheel
over the sidebar moves the cursor; over the pane it still goes to the
agent.

The sidebar now keeps its place between frames (Model.sidebarTop), as
the project list does, so a double click cannot land on a card that
scrolled under the pointer. A card is several lines, so the window
brings the selected card's last line into view and then its first, and
a card that fits is shown whole.

The session view is now drawn at the terminal's height. The pane was
drawn at the agent terminal's five-row minimum, so a terminal shorter
than eight rows got a frame taller than itself, and every card was
drawn a row above where a click resolved it.

README, architecture and backlog 9 describe the sidebar, and the Known
friction entry saying it takes no clicks is gone.
The sidebar was window's last caller outside tests; it now lays out
with windowed and draws with fill, so the mouse can read the same
layout. window moves to util_test.go, where the windowing tests still
use it, and the comment and architecture sentence that described it as
the other half of windowed now describe windowed and fill.

No behaviour change.
@tdwd
tdwd merged commit e856d66 into main Oct 7, 2026
3 checks passed
@tdwd
tdwd deleted the sidebar-clicks branch October 7, 2026 18:57
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.

1 participant