Skip to content

Add an opt-in floating panel to replace the banner and bottom bar - #2647

Merged
max-sixty merged 17 commits into
mainfrom
floating-panel
Oct 12, 2026
Merged

max-sixty merged 17 commits into
mainfrom
floating-panel

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Adds an opt-in floating panel that replaces the banner and bottom bar with one card hovering over the bottom of the page. Classic chrome stays the default; nothing changes for anyone who hasn't opted in. It lands so work can continue from main: the behavior is in place, but the appearance needs an overhaul before it's offered to anyone (TODO #28, and the status line at the top of notes/floating-panel/GOAL.md).

Turning it on

?lf-chrome=floating (or classic) sets the preference, which prepaint.js keeps in the user store as root.lfChrome (mode, Minimal/Moderate display, resting row) and applies before first paint. An lf-sample window takes chrome="floating|classic", else the viewer's preference.

Where to look

  • skills/leaf/assets/runtime/floating-panel.js: the panel. One card whose height tweens between views (menu, Threads with search and filters, a thread through the Leaf reader, Questions answered inline, versions, layout), a resting row holding the comment field (which shows the agent's status while empty), and folding to the leaf mark.
  • skills/leaf/assets/styles/floating-panel.css: its styles, imported by chrome.css; theme.css zeroes the banner's room and reserves the row's.
  • banner-toolbar.js: every registerBannerControl now declares a row (label, value, group, press), which both chromes read; page commands declare a menu group. banner.js, the version picker, mirrors.js and application.js expose the readings and the reply-box hook the panel needs, so it presents existing controls rather than re-implementing them.
  • tests/browser/test_render_floating_panel.py: one test per journey; the feature gallery's "The floating panel (experimental)" section shows a window sample in each chrome.

notes/floating-panel/GOAL.md holds the spec, the approved prototype (commit 446de2cb2), and every intended departure from it.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 16 commits October 12, 2026 09:48
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The panel's Threads view searches and filters (All, Unread, Drafts, Resolved) in
an inventory of one height, and a thread opens inside the panel: its messages,
read-marking through the page's read tracker, and news held behind a reserved
New reply control. The field replies there; the line above it names where the
words go and settles the thread. A page comment opens its new thread, keyed by
its attempt. In this chrome the page's comment box is the panel's field (`c`,
Resume writing), and the Threads and Questions doors open the panel's views.
Counts in the resting row keep their room so news moves nothing. The
`lf-chrome` parameter leaves the address with the bootstrap's other marks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Questions view lists what waits on the user, on the agent, and what is
done, as the publisher's queues. Each ask offers its widget's own Decision
controls (choicesOf, questions/view.js), approval its approval, a to-do its
Done, and a prose ask its thread. An answered card stays where it stood,
at its height, saying its answer with Undo, until the view closes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Versions view lists the picker's versions with Compare and the page's
approval with its reason; every route that opens the versions menu opens
it instead. A gesture's next step, such as Exit Draw mode, stands in the
resting row's counts while the gesture holds it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The panel registers as the page's primary thread presentation and gives the
open thread's messages an outlet, so Leaf draws them there with reactions,
rewrites, read marks, held news and agent-authored widgets, and the t walk
and notice links open a thread about the whole page in the panel. A thread
anchored to a passage keeps its card beside the words. The status peek
fades in place rather than rising, which moved its words under no input.

Tests cover answering a question inline and undoing it, version travel and
approval from Versions, a mode's exit step in the row, and t opening a page
thread in the panel; the held-news test now reads Leaf's own notice.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…s, a terse status

While the field holds words or the caret, it takes the whole row and the counts move
up to the line naming where the words go, as the prototype seats them, so a press that
takes the caret away no longer moves Back from under the finger. On a phone a count is
its number beside an icon. A pointer opening a view stands in the view, not on a
ringed first row. The dark panel lifts off the page; a thread's top edge fades;
Threads fits its rows and holds that height; the leaving view fades before the arriving
one shows; notices stand centred at the window's head; Versions keeps one line a row.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…only for words

The view going away fades where it stood on close too, so the shrinking box never
shows an empty ground. Folding to the leaf and back tweens the box's width about its
centre. The counts move up beside the destination only once the field holds words,
so a click into the field moves nothing; the first word makes the room.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…' chrome

The panel names its field as the open thread's reply destination when it registers
as the thread presentation (createPrimaryReader's `replyBox`), so Resume writing and
every reply route land in the editor that holds the draft. Asking to write unfolds a
panel folded to the leaf. A menu row's press receives the standing the panel held when
the reader stepped in (`readStanding`), so a command that acts where they stood, such
as Align current item at top, still finds it. Share's row presses the Copy link
control with its own notices. A window sample reads with the chrome its element names
(`chrome`), else the reader's own, carried in the sample's settings. The test
registrations of banner controls declare the row every control now declares.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The panel lands behind its preference, off by default, so work on it can
continue from main; the user doesn't like its look yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The folded state still shows active Questions and news counts, and a draft can leave its destination line visible. That misses the leaf-only state specified in notes/floating-panel/GOAL.md: this rule hides only empty chips. Hide the rest of the panel whenever it rests as a mark.

…chromes in the gallery

The folded panel showed what waited beside the leaf, though folding asks for the mark
alone; it now hides the counts and any destination line too. Folding and unfolding no
longer tween the box's width: the tween moved every centred control, and on CI its last
frame landed outside the press's input window as a shift nobody asked for. The panel's
input-modality reading observes focus.js's input stream rather than adding a keydown
listener beside the register. The feature gallery shows a window sample in each chrome,
which the corpus floor asks of lf-sample's chrome attribute.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 0b87c62 into main Oct 12, 2026
4 checks passed
@max-sixty
max-sixty deleted the floating-panel branch October 12, 2026 20:31
leaf-agent added a commit that referenced this pull request Oct 12, 2026
The experimental floating panel added in #2647 caused two failures in
[main CI run
38309698019](https://github.com/max-sixty/leaf/actions/runs/38309698019).
Its card and peek shadows used fixed colors outside the scheme's
`--shade` token, and its mode rule named `.lf-chrome` outside the chrome
stylesheet's scope. The former left dark-scheme elevation out of the
shared color contract; the latter exposed a private chrome class to page
styles.

This moves the mode rule inside `@scope (.lf-chrome)` and uses `--shade`
for both elevation shadows. The generated chrome sheet is rebuilt with
the source.

The two failed assertions passed before this push:
`test_every_shadow_the_layer_lifts_a_box_with_is_cast_in_the_scheme_s_own_ink`
and `test_a_coined_class_cannot_reach_the_chromes_rules`.
`test_the_panel_folds_to_the_leaf_and_stays_folded` also passed,
checking the opt-in panel after the selector move. This PR addresses the
floating-panel cause; the run's sort-film and composer failures are
separate.

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 13, 2026
…2696)

Rebuilds the opt-in floating panel (`?lf-chrome=floating`, from #2647)
to the look the user chose in a design playground. The user's verdict on
#2647's version was that it "doesn't seem elegant generally, nor that
consistent with our aesthetic. The menus are quite bad, very large
spacing. Things like 'layout' should not need to be selectable in a
menu". Classic chrome stays the default; this is the base for the work
in `TODO.md` #28.

### What the panel is now

- **Three sizes, set by what the user does rather than a setting.**
Folded is the leaf in the window's corner, with a badge for what waits
on the user and a dot for threads with news. The row holds the leaf, the
field and marks with counts for Questions and Threads, plus a pen for
Annotations. Opened is a view above the row: Questions, Threads, a
thread, Versions, or a group of the page's controls. The Layout row and
the Minimal/Moderate displays are gone; the `lfChrome` preference keeps
only `rest`.
- **The field holds the status.** The empty field says what the agent is
doing, whose turn a thread is, or what a passing notice says. Notices no
longer stand at the window's head (`--lf-notice-seat: panel`).
- **The leaf's menu is a small list**, one line per row, each with its
shortcut. The toolbar row contract (`banner-toolbar.js`) gains
`shortcut`.
- **Look:** the page's own ground with a hairline ring, 12px corners, a
compact width (540px), 13/12px sans in two inks, and the page's serif
for questions.
- **Motion moves no layout.** The box changes size in one step; a
separate surface layer follows its outline by a clip-path animation, so
the shift watch sees nothing travel.
- **Keyboard:** `.` folds and unfolds (`panel.floating.fold`). Escape
clears a search, then closes the menu, then a view, through a `floating
panel` rung on the page's ladder, wherever focus is.
- Annotations leaves out Select element, which the page starts on
selection or `s`.

### Review guide

`skills/leaf/assets/runtime/floating-panel.js` and
`skills/leaf/assets/styles/floating-panel.css` are rewrites; their
headers state the contract. `chrome.css` is regenerated. The rest is
small: `banner-toolbar.js` (`shortcut`), `keyboard/touch-controls.js`
and `keyboard/shortcut-bar.js` (rows supply it), `keyboard/register.js`
(rung and command), `prepaint.js` (drops `display`), and `icons.js`
(`down`, `search`).

### Testing

`tests/browser/test_render_floating_panel.py` covers sending and
replying, filters, folding, Questions, Versions, modes, routes into a
thread, Send standing in for the counts, and writing from any size. Each
assertion added here fails against the commit before it. Those tests and
the shift watch pass with the CPU slowed tenfold. `pnpm run
test:runtime` passes.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 13, 2026
… persistent otherwise (#2699)

In the glossary, **Standing** means one thing: the user holding a
destination or a control inside it (a standing target, ending a
standing). Across the tree "standing" was also an ordinary adjective for
things that are in force, current, open or lasting ("the standing log",
"a standing report", `standing_approvals`, `--standing`), which collided
with that term. This rewords every such use and renames the identifiers
with all their callers, leaving "standing" to mean only where the user
is. The glossary gains an **In force** row and a line saying so.

**Replacements, one word per meaning**
- not withdrawn or retracted → **in force** (`InForce`,
`StateProjection.in_force`, `approvals_in_force`, the per-verb
`inForce`); the served field keeps its name `stands`
- the latest value or reading → **current**
- still owed, or a surface on screen → **open** / **active**
- a server or environment that outlives sessions → **persistent** (CLI
`--standing` → `--persistent`, service.json `"lifetime": "persistent"`);
always-present chrome → **fixed**
- a preference → **lasting**; a dispatch → **recurring**; otherwise
**existing**, **present**, **in place**, **permanent**

**Behavior changes**
- `leaf server start --persistent` replaces `--standing`, and refusals
and the lifetime line say "persistent".
- One `server.read_service(page_dir)` now reads `service.json` for every
caller, returning nothing unless the record has its required fields and
a lifetime this Leaf knows. A record an older Leaf wrote with
`"lifetime": "standing"` is therefore no service (root AGENTS.md,
"Stage"), A server that older Leaf started still holds its lease, so
`leaf server stop` and a re-vendor detect it from the lease, delete the
record and wait for it to exit; until then `server start` refuses as
before. A server started persistently before this change is re-served
with `--persistent`.
- Visible wording: "Current text matches this version", the reaction
scope "On a reaction", the margin contribution key `"reactions"`, and
the eval surface `action-in-force` (with its metrics).

**Fixes for journey tests main had broken.** Editing these test files
selects them, and each already failed on main:
- `test_a_comment_box_moves_home_when_a_panel_comes_to_cover_its_seat`
(since #2613 made the Threads dialog's envelope zero-size): it now
checks the dialog is open and its panel visible, as #2639 did for a
sibling.
- `test_each_sampled_focus_ring_is_shown_whole_in_its_surface` (since
#2647): the floating panel's focus rule declares `--lf-focus-ring:
floating-panel`.
-
`test_an_aimed_press_does_only_what_the_outline_promised[release-notes]`
(since #2670 put a Web Awesome Copy control in `lf-draft`):
`elementFromPointAcross` stepped into the control's own shadow tree and
took its internal `id="copy-button"` for a page element, so the aim and
the press both targeted it and no comment landed. The hit test now
enters only shadow roots a widget declares with `x-shadow`, as
`passages.js`'s header already says; the aim takes the `lf-draft`.
-
`test_a_first_complete_read_does_not_repaint_an_already_undone_settlement`
(since #2649 made decision commands wait for the first complete read):
the race it guards moves one read later, so the page takes its first
read before the held Accept and undo; renamed `test_a_complete_read_…`,
assertions unchanged.

The sweep is generated by a script of exact edits plus identifier rules,
so a newer `main` is regenerated rather than conflict-resolved. Root
`AGENTS.md`'s maintainer section ("a standing preference", line 13) is
unchanged.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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