Skip to content

guides: the guides are a tree, their chapters folded under them - #619

Merged
foxnne merged 1 commit into
mainfrom
guides/tree
Oct 19, 2026
Merged

foxnne merged 1 commit into
mainfrom
guides/tree

Conversation

@foxnne

@foxnne foxnne commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Part of fizzyedit/plans#30 (step 2, a follow-up to #613).

What changes

The guides view drew each guide and chapter as a padded full-width button, so two guides took most of the sidebar's height. Now it's the app's tree (core.widgets.TreeWidget), drawn the way the file tree and settings draw theirs:

  • A guide is a branch: a caret, its glyph, its title, and its length at the right. Its chapters are folded under it, and the first guide starts open.
  • A chapter is a row with a play glyph and where it starts. Clicking it plays the guide from there, and the first chapter (0:00) plays from the start.
  • A guide with no chapters is a row of its own that plays it.
  • The guide playing has its glyph lit in the highlight colour.

The time is still laid out before the title, so a long title is cut short rather than the time.

SDK impact

  • None

Verified

  • Web, in the browser pane, on zig build web:
    • The tree lists the tour open, with Welcome 0:00 through Your turn 1:01, and the markdown guide folded at 0:26. It is about half the height of the old list.
    • Clicking "Editing" played the tour from 0:23.
    • Reloading with Guides as the remembered view loads fine.
  • macOS: zig build, zig build check-web, zig build check-tests-reached, scripts/check-fmt.sh.
  • Windows:
  • Linux:

🤖 Generated with Claude Code

The guides view drew each guide and chapter as a padded button, which took the sidebar's height
for two guides. It is now the app's tree, as the file tree and settings draw it: a guide is a
branch with its glyph, title and length, its chapters folded under it, each a row with a play
glyph and where it starts. The first chapter is the start. A guide with no chapters is a row of
its own. The guide playing has its glyph lit.

Part of fizzyedit/plans#30 (step 2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foxnne
foxnne merged commit 447f56d into main Oct 19, 2026
11 checks passed
@foxnne
foxnne deleted the guides/tree branch October 19, 2026 11:08
foxnne added a commit that referenced this pull request Oct 19, 2026
Part of fizzyedit/plans#30. Fixes the tree from #619.

## What changes

`TreeWidget`'s branch is drawn the way it is asked to be each frame:
when the `.expanded` it's given differs from its own state, it toggles
to match. The settings and keybind trees keep each branch's open state
themselves and pass that back. The guides view passed "open if it's the
first guide" every frame, so:

- the first guide reopened the moment it was folded;
- the last guide, once unfolded, folded and unfolded again without end.
This was the jitter.

The view now remembers each guide as the person left it, keyed by a hash
of its name. A guide never touched is open if it's the first.

## SDK impact

- [x] None

## Verified

- [x] Web, in the browser pane: the tour folds and stays folded; the
markdown guide unfolds and stays still, with two screenshots a second
apart identical.
- [x] macOS: `zig build`, `zig build check-web`, `scripts/check-fmt.sh`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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