Skip to content

feat(tui): add /close-others to keep only the current chat window - #41

Merged
t0d0r merged 1 commit into
masterfrom
feature/close-others
Nov 5, 2026
Merged

t0d0r merged 1 commit into
masterfrom
feature/close-others

Conversation

@t0d0r

@t0d0r t0d0r commented Nov 5, 2026

Copy link
Copy Markdown
Owner

What

/close-others closes every chat window except the current one, at once. Window 0 always stays.

  • Same code as /close: it hands the numbers of the other chat windows to closeWins, so it behaves as /close with those numbers: a window closed: <name> notice per window in window 0, in window order; one status (closed <name>, or closed N windows: 1:#news, 3:@alice, cut after four); the layout saved once.
  • Focus: the current window stays current, as window 1. Nothing is focused, so no read receipt goes and no unread count changes, the kept window's included. The last window is dropped when it closed.
  • Nothing closes, nothing changes, the layout is not written (checked in this order):
    • any argument: /close-others takes no argument; /close 2,3-5 closes the windows given;
    • window 0: the server window has no chat; /win to a chat first (the shared chat-window error);
    • the only chat window: no other chat window to close, as information, not an error.
  • Exposure: one spelling, no short form; /help lists it after /close; Tab completes it; a start hint names it. /close Tab now stops at the prefix both commands share, and a second Tab lists both, as /clip does.

specs/ui.md (Windows with Decision lines, hint lists, commands table, short forms, Completion), docs/usage.md and todo/todo.md describe it; session/2026-11-05-close-others.md records the RED/GREEN evidence.

Tests

  • Built test first in eight slices; each failure before its code is recorded in the session note.
  • Five mutants of the new code (one per branch, plus a parser-table mutant for completion) were all caught.
  • Every existing /close list and range test passes unchanged.
  • make check and go test -race ./internal/tui/ ./internal/command/ pass; all four cases checked in the demo.

Security note

Local window layout only: no network call, no read receipt (closing focuses nothing), no new input parsing beyond refusing any argument.

/close-others closes every chat window except the current one, at once,
and keeps window 0. It collects the numbers of the other chat windows
and runs them through closeWins, the code /close 2,3-5 uses, so it
behaves as /close with those numbers: a "window closed: <name>" notice
per window in window 0 in window order, one status ("closed <name>" or
"closed N windows: 1:#news, 3:@alice", cut after four), the current
window kept as window 1, nothing focused (no read receipt, no unread
count change), the last window dropped when it closed, the layout
saved once.

Three cases close nothing, change nothing and do not write the layout,
checked in this order: any argument is the error "/close-others takes
no argument; /close 2,3-5 closes the windows given"; window 0 is the
shared chat-window error "the server window has no chat; /win to a
chat first"; the current window alone says "no other chat window to
close" as information.

One spelling, no short form. /help lists it after /close, a start hint
names it, and Tab completes it; /close Tab now stops at the prefix the
two commands share and a second Tab lists both, as /clip does.

specs/ui.md (Windows with the decisions, the hint lists, the commands
table, short forms, Completion), docs/usage.md and todo/todo.md are
updated; session/2026-11-05-close-others.md records the TDD evidence.
All existing /close list and range tests pass unchanged.
@t0d0r
t0d0r merged commit 9b82ac4 into master Nov 5, 2026
4 checks passed
@t0d0r
t0d0r deleted the feature/close-others branch November 5, 2026 20:14
t0d0r added a commit that referenced this pull request Nov 5, 2026
The Arch / Omarchy recipe builds v0.4.29: only pkgver and the tag
tarball's sha256 (dba57ab5...abd99d, the same on two downloads)
change; go.mod and go.sum are as in 0.4.28. It was built and tested in
Docker on aarch64 and x86_64 (makepkg with check, namcap, pacman -Qkk,
the desktop entry, lazygram 0.4.29), and the omarchy-pkgs validators
pass against their master 525f91b. omacom/omarchy-pkgs#2022 moved to
0.4.29 with e818f58; PR.md names it.

session/2026-11-05-release-0429.md records the release: v0.4.29 tagged
on master 9b82ac4 (/close-others, #41), published by Release workflow
run 42103409665, every asset checked against SHA256SUMS and its
provenance verified online and offline, a tampered tarball refused, the
latest installer URL installing v0.4.29 into a scratch prefix, and the
Homebrew formula at 0.4.29 (tap a294169, built from source, brew test
passed). todo/todo.md, specs/release.md and docs/arch-omarchy.md follow
the version.
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