developer playground

Leaf feature gallery

Try Leaf’s working features on one synthetic page. Each section names a feature and provides a live example.

Use the contents spine or Map to find a feature; each eyebrow lists its element names. Press a to move through Asks. Hover over a margin Button for its label, or Tab into a group and use ← / → and Enter. Changes persist on reload.

Leaf chrome · lf-toc · lf-ask · lf-options · lf-option

Asks: decisions and answers

An lf-ask is one complete Ask: its heading names the question, and one nested widget owns the answer. This sample uses lf-options, which records a choice Leaf can replay as page state. The banner shows completed/total. Press a for the next Ask waiting on you; open Asks, or press g then Shift+A, to review every active Ask and its current answer.

Which map should the sample team carry?

Street map Trail map

The top bar also shows the status line, Threads, the version picker, Map (g then Shift+M), All keyboard shortcuts (? twice), and All leaves when another Leaf page is live.

lf-suggestion · lf-old · lf-new

Suggestions: proposed text changes

Accept applies the proposed text; Reject keeps the original. Undo reverses either decision.

Replace. The sample meeting starts at nine.ten. Insert. Bring a notebook. A pencil is useful too. Delete. The room is upstairs. Please arrive an hour early.

Undo a proposal while keeping its choice

Pick a route inside the proposal, accept the proposal, then use its Undo Button. The proposal becomes undecided again; your route remains chosen. Reload to check that both decisions survive.

Keep the practice walk indoors.

Take the practice walk outside.

Which route should the walk follow?

Through the garden Along the river

lf-draft

Drafts: editable passages and history

Edit opens a draft. Save records the new text; Cancel closes the editor. Changes lists saved versions, and Restore reapplies one.

Write a different invitation here. Try a few lines to see the editor grow.

Picked up means the saved edit entered an agent turn. The receipt and top bar derive their words from the same delivery, turn, and work evidence.

The sample workshop is in the blue room.

Thread Button · inline thread · Threads panel

Threads: anchored conversations

With Threads closed, a Thread Button or marked passage opens the conversation inline; t moves to the next inline card and T to the previous one. Open Threads while one is focused, including with g T, and the same thread stays focused in the panel. Its count shows how many conversations share that passage.

An existing conversation. The sample agenda has room for one more topic. Open the speech-bubble Button, reply, then resolve the thread.

Pasted images. That conversation includes an image supplied by its companion thread log, outside this document. Click the image to inspect it in Leaf’s Image preview. Paste a screenshot into its reply box to see the thumbnail Leaf keeps in the draft without exposing image Markdown.

A resolved conversation. The room has a projector. Its earlier question is resolved. Open Threads in the top bar, expand Resolved, and try Reopen to bring its Button back to the page.

A clean passage. Select some of these words, or Alt-click this paragraph, to start a comment. Type into the floating field and send it. Your comment becomes another thread Button at this passage.

Reaction Button · reaction picker

Reactions: short verdicts on a passage

Select words and press R to add a reaction. A square Button shows a saved reaction; press it to remove that reaction.

1 · ok · settled. The spare key is with reception.

2 · no · wrong. This sample claims Tuesday follows Thursday.

3 · lost · unclear. Bring the thing from the other place.

4 · cut · too long. At this point in time, we can now begin.

5 · more · needs detail. The exercise involves a map.

6 · this · look here. The side entrance closes early.

Action · Disclosure · Button-shaped status · Lifecycle state

Buttons: action, disclosure, and status

One shared target. Use the courtyardcovered terrace for the practice session. Accept and Reject act immediately; Thread and ⋯ disclose more; reaction marks are settled actions. Delivery statuses below report what already happened without offering another press.

lf-ask · lf-options · lf-option

Decisions: answers in context

A recorded answer stays visible in the widget that owns it; the page map adds no second status.

Where should the sample group meet?

At the door At reception

Approve version · Design mode · Draw mode · Requests

Reader workflows: approval, interface comments, and requests

Approve version · Undo

Sign-off: approve a version

Approve version records approval for the current version. Press z to undo it.

Design mode · interface comment

Design mode: comment on the interface

Press l, then click Street map. Leaf opens a comment about lf-option · bg-choice-street without choosing the option. Press Escape to leave design mode.

Draw mode · drawing comment

Draw mode: point with a freehand mark

Press w and draw anywhere across the page. Start over this guide or in its margin to anchor the comment here; empty space with no item alongside comments on the page whole. Send the drawing alone or add words first.

lf-command · lf-task · lf-agent · lf-worktree · lf-operations · lf-operation

Requests: send instructions to the host

lf-operations is the answer widget inside an lf-ask when its answer should make the host act. Leaf records one typed, one-shot instruction; the host carries it out and returns a receipt. Failure reopens the Ask, while success closes it. A refused send shows Retry and Cancel.

Ready request No request has left this seat yet. gallery-ready Owns the disposable sample branch.

What should the sample host do?

Restart the sample worker Preserve its fictional branch and begin a fresh attempt. Drop the sample worker Archive the fictional branch.

lf-diff · lf-source · lf-num

External data: live values, snapshots, and provenance

lf-diff · inline Thread

Inline diff threads: line comments in review context

The seeded Thread follows its added line. Reply or resolve in place. Close the file to move the Thread to the page margin, then reopen it to return the conversation to the diff.

lf-source

Source: live and captured data

The live view follows the latest data. The snapshot stays on its first capture. Their captions show the file, capture label, and line range.

Live binding.

Captured snapshot.

lf-num

Num: provenance and stale data

This Num stores 184 ms, its timestamp, and the command that produced it. Because the source has a newer update, version check reports that the measurement is behind its source.

Default package

Default presentation elements: widgets for structured evidence

These shipped widgets use synthetic data so each feature has a focused example.

lf-metrics · lf-metric · lf-chart

Metrics and Chart: values and trends

Metrics show individual values. A Chart compares the values across runs.

checks complete open failures sample duration
run, baseline, candidate
1, 4, 5
2, 7, 9
3, 9, 12

lf-diagram · diagram package

Diagram: structure, shape, and state

Diagram nodes keep their authored shapes and can use Leaf’s semantic color tokens. A plain click leaves the drawing alone. Alt-click a declared node to comment on that box alone, or press s to choose the same target.

flowchart LR
  Request([Request]) --> Choice{Valid?}
  Choice -->|yes| Success[(Stored)]
  Choice -->|no| Retry([Retry])
  Retry -.-> Request
  classDef done fill:var(--ok-tint),stroke:var(--ok),color:var(--ok-ink)
  classDef warning fill:var(--warn-tint),stroke:var(--warn),color:var(--warn-ink)
  class Success done
  class Retry warning

lf-code · lf-gloss · lf-note · lf-tree

Code, Gloss, Note, and Tree: technical evidence

Gloss explains a marked term such as walking skeleton. Code adds line numbers and Notes; Tree shows file structure.

def route(weather):
    if weather == "rain":
        return "covered terrace"
    return "courtyard"
The branch exists only to make the highlighted walkthrough visible.
gallery/
  index.html  +20 -1
  data.json  +2
  media/
    after.png

lf-compare · lf-variant · lf-chip

Compare, Variants, and Chips: parallel alternatives

Compare gives each Variant the same frame. Chips label short attributes.

power: noneweight: low Paper map Easy to annotate and fold. power: dailyweight: medium Tablet map Searchable and backlit.

lf-milestones · lf-milestone · lf-timeline · lf-event

Milestones, Timeline, and Events: state and history

Milestones show planned, active, and completed work. A Timeline orders Events by time.

Survey the route Marked the crossings. Walk the route Checking the covered section. Write the note Rain started The open path became slippery. Route changed The sample moved under cover. Walk resumed

lf-tabs · lf-tab

Tabs: saved panel selection

Tabs switch between panels and remember the selected panel after reload.

The current sample route is under review.

The earlier route crossed the courtyard.

lf-specimen · lf-shot · lf-options · lf-option · lf-swipe-deck · lf-swipe-pile · lf-swipe-card

Specimen and Shot: fiction and before/after images

Paper signs Nothing to charge. Display signs Easy to update. Keep the explicit expiry bound

The card's pile carries its recorded classification.

Specimen labels invented content. Press the Shot Button or image to switch between before and after.

Version picker · Change Button

Version changes: comparison evidence

Open the version picker and press Δ beside v1. The Change Button appears by the edited passage and opens its comparison.

The sample walk follows the river to the footbridge.

lf-board · lf-column · lf-card · delivery Buttons

Board and delivery state: work and handoff state

Drag the card to Tried, or use its grip with Enter and the arrows. Sent, Picked up, and Active report agent handoff. A refused send offers Retry and Cancel.

Check the sample route An agent’s live work claim can put an Active Button here.

To ask for a refinement, comment on the sample that shows it and say what should change. Plain experiment clicks do not request implementation work.

Inspect the page and find what to edit

Move the card, submit a draft, or add an option above. Run leaf page state PAGE against this preview's page directory. Its content keeps your exact words, selected options, and card order; source locations and edit routes distinguish authored content from reader decisions and captured data. Change unrelated source wording and inspect again: those reader choices survive without copying them into HTML. Use --thread ID to inspect a frozen conversation.