Skip to content

chat: a group stays open or shut where it was put, its rows whole - #5

Merged
foxnne merged 1 commit into
mainfrom
chat/group-open-state
Oct 16, 2026
Merged

foxnne merged 1 commit into
mainfrom
chat/group-open-state

Conversation

@foxnne

@foxnne foxnne commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Fixes the last chat row of a section showing cut off at its bottom edge (seen on macOS 2026-10-16: "okay" under Agents › No folder, with the Sample header right after it). It's the same bug behind the tree flickering, changing size, and sections that won't stay closed.

Why the section came up short

Explorer.draw worked out each group row's expanded afresh every frame: open when it holds the active chat, is fizzy's open folder, or is the client's only folder. core.widgets.TreeWidget reads expanded as where the row should be. Whenever that differs from where the row is, it animates toward it (Branch.expander: init_options.expanded != self.expanded).

So a folder the person opened while that wish said "shut" called startEnd() on every frame. Each call restarted the fold, so the animation never ended. It stuck about one frame into the fold (val ≈ 0.80 in the log), with the bottom of the group clipped off and the app redrawing at full rate. A section closed by a click had the opposite problem: it popped back open the next frame, because its wish was always true.

None of the suspects listed in the report was the cause. The measured height was right, and the clip rect came from the animation's current size. That animation was stuck because it was restarted every frame.

The change

  • open: each group's open state, by row id. The wish (first_open) only applies the first time a group is drawn. After that the tree gets back what the row last was (recorded right after expander). It is the same rule the workbench file tree follows with explorerBranchIsOpen.
  • A chat that becomes active opens its section and folder once, when the active chat changes, not on every frame.
  • groupId: a section row's id is now separate from its "No folder" row's id. Both were idOf(client, "", "group"), so they would have shared one open state, and hovering one row's + already lit up the other's.

How it was seen

macOS 26, Debug. A sandbox profile (fizzy --profile <scratch>/profile) with fizzy at main (a30dcf1), and this plugin built with FIZZY_PROFILE=… zig build --fork=<that checkout>/sdk. Seeded data: Agents (pixelart: 2 chats; No folder: 3, "okay" last) and Sample (2). Driven by demo tapes (rail anchor fizzy.rail:chat.chats, then clicks on the rows), with window captures of the sidebar:

  • Before: opening Agents › No folder left it stuck mid-fold. "what next" and "hello there" showed, "okay" was hidden behind the Sample header (the reported picture). Idle after the tape ended: 1.37 s of CPU per 3 s.
  • After: the same tape shows all three rows whole, and idle is 0.00 s per 3 s. Opening pixelart as well showed all 5 Agents rows whole. Closing Agents kept it closed with Sample moved up. Re-opening it brought both folders back as they were. A temporary log showed every group animation ending at val = 1.

Not checked on Linux or Windows; nothing here is platform-specific.

🤖 Generated with Claude Code

The chats tree handed each group row an `expanded` worked out afresh every frame (open when it
holds the active chat, is the open folder, or is the only folder). The tree widget reads
`expanded` as where the row should be and animates toward it whenever it differs from where the
row is, so a folder opened by a click while that wish said shut restarted its fold every frame:
it stuck about a frame into it (val ~0.80), its last chat row cut off, the app redrawing at full
rate (~46% CPU idle in a Debug sandbox). A section closed by a click popped back open.

Now the wish only opens a group the first time it is drawn, or when a chat in it becomes active;
after that the tree is handed back what it last was. A section row also gets an id of its own:
it shared one with its "No folder" row (both `client` + `""`), which lit both rows' + together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foxnne
foxnne added this pull request to stack #12 October 16, 2026 14:53
@foxnne
foxnne merged commit 3afb24b into main Oct 16, 2026
6 checks passed
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