Commit Graph
42 Commits
Author SHA1 Message Date
aiongg d62a71318a Dialog width: a dialog opens at least size.dialog.least wide and its paragraphs wrap at size.dialog.wrap, through ContainerProps::least_width and a new wrap_width; content that cannot wrap widens it 2026-11-12 14:32:51 +00:00
aiongg b19f52dde8 Content painters paint data colours in the component's data mode
DataMode holds the one mapping of a data colour (DataMode::color) and maps
every colour of a shape with it (DataMode::shape). ContentPainterCx gets
data_shapes for shapes whose colours are data, and its data methods
(picture, checker, checker_with, ramp) paint through the mode, sharing
data_picture and data_checker with Draw::texture and Draw::checker. A
States component's ramps, pictures and checkers in a content painter dim
while it paints its Disabled state, as its Draw's data colours do.

The histogram's bins and outlines and the notes editor's document text
paint through data_shapes.
2026-11-12 14:32:51 +00:00
aiongg 5736aded10 A disabled component dims its data colours: PaintUi::draw paints them at Opacity::DISABLED while the component paints its Disabled state, keeping each hue; one data mode in Draw beside the inactive part's disabled fill, which faces of inactive parts now take too. The icon badge paints through Draw, IconButton's own badge prop goes (IconSpec::badge is the one badge), and IconButton gets a Badge story 2026-11-12 14:32:50 +00:00
aiongg c51f6a103e Text row height role: size.row.text is one body line and space.gap.tight (compact 18, comfortable 21), at most a small control and at least the body line, for read-only display tables 2026-11-12 14:32:50 +00:00
aiongg f0c46a57a8 Glyph roles for icon-only buttons: a container sets the role its buttons show their glyph in (child_glyphs, or glyphs on one component), so the tool rail draws size.icon.lg icons resting in text.muted, the panel rail rests in text.faint and AlignBar draws size.icon.md 2026-11-12 14:32:50 +00:00
aiongg 7fcd160eca Field and number widths per control size: size.length.field and size.length.number hold sm and md, and controls read them through ControlMetrics, so a field in a small options bar is narrower than one in a dialog 2026-11-12 14:32:49 +00:00
aiongg 38fb06debd Runtime: with nothing focused, the clipboard events and edit chords of the canvas's edit set stay in egui for it 2026-11-12 14:32:49 +00:00
aiongg b55b820460 Runtime: the press rule moves only the framework's focus; the app's own widgets keep egui's surrender rule with the app's option 2026-11-12 14:32:49 +00:00
aiongg 9d2658dbc6 egui fork 5493e3aa: kittest's eframe harness runs App::raw_input_hook before every pass 2026-11-12 14:32:48 +00:00
aiongg 7c02fcef14 Runtime: a bare Tab with nothing focused in a window without focus stops is egui's, which moves its own focus 2026-11-12 14:32:48 +00:00
aiongg fbea3a0574 Runtime: with nothing focused, a canvas that keeps Tab gets the bare Tab from egui and nothing toggles 2026-11-12 14:32:48 +00:00
aiongg 0599e9862e Runtime: a component clicks by the press lifecycle; egui's click options stay the app's 2026-11-12 14:32:48 +00:00
aiongg 0d521f98a7 Runtime: egui moves focus among an app's own widgets with the arrows and the Tab it keeps 2026-11-12 14:32:48 +00:00
aiongg 0c45ae2dc0 Runtime: an Escape the key stage takes ends egui's own drag, as egui's Escape does 2026-11-12 14:32:48 +00:00
aiongg 43549ad9db Runtime: runtime::keys re-exports the types an app reads window intents with 2026-11-12 14:32:48 +00:00
aiongg 6c76c5c915 Runtime: the window's pane and menu-bar keys are commands an app binding beats
F6, Shift+F6 and F10 become the window.nextPane, window.previousPane and
window.focusMenuBar commands (NavCommand). The keymap build lists the
chords bound to them and to the chrome commands once, and the key stage
takes a press only by that list, so rebinding moves the keys and unbinding
frees them. A default chord of these commands that another command also
binds is that command's: the app's binding beats the framework's default.
Menu and palette fires of NavCommand move panes or focus the menu bar in
the focused window's next pass.
2026-11-12 14:32:48 +00:00
aiongg 9dfdb4c26f Runtime: a host declares its own egui canvas as the window's document canvas
focus::host_canvas registers the app's own egui widget as a canvas stop
through the stop registration a framework canvas uses, so a bare Tab
toggles that window's panels, and the canvas takes keys as its KeyUse says
while it has focus.
2026-11-12 14:32:48 +00:00
aiongg 263ad24c08 Runtime: copy from an egui label selection stays egui's
The focus end hook records whether egui holds a label text selection; while
it does, the key stage leaves the copy and cut events in egui's input, so
egui copies the selection. A focused framework editor still takes them.
2026-11-12 14:32:48 +00:00
aiongg a1362ea605 Runtime: an app's own focused egui widget or popup keeps Tab, Escape and the clipboard
The focus end hook records whether egui focus is on a widget no framework
component made, or an egui popup is open, while no framework press or drag
is captured. While that holds, the key stage leaves Tab, Shift+Tab, plain
Escape and egui's clipboard events in egui's input and routes nothing for
them.
2026-11-12 14:32:48 +00:00
aiongg cde64912bc Runtime: the IME engine reads and writes the IME only while a framework editor owns it
The input hook leaves IME events in egui's input, and the end hook leaves
PlatformOutput.ime alone, unless a framework editor owns the IME or the
engine's reset is pending, so an app's own TextEdit or IME reader keeps
working under the runtime.
2026-11-12 14:32:48 +00:00
aiongg 3251c6c6fb Runtime: a press on the widget that holds egui focus keeps it
classify_press compares the press target with egui's focused widget, so a
host's own focused egui field keeps its focus when pressed, as a focused
framework stop already did.
2026-11-12 14:32:48 +00:00
aiongg 9b22aa4e0f Fill propagates down a column whose width is given
A content-sized inline container shown in a `Stack` body given its width
passes that width on to its own body: its children measure and show as in
a given column, so a child that fills (a fill-width row, a list, a divider,
a picture, a side-labelled control) takes the width, and the container
takes what its content took. A content-sized mount (dialog, popover, menu),
a row, a grid or a held container stops it, so their bodies stay content
columns and measure as before.

The env carries the fact as `given_column`, set by a `Stack` body that is
not a content column and listed in the measure key's env facts. No pass,
record or measuring run is added.

Panel roots that set `fill_width()` only to span their pane now take the
default: CharacterControls, ParagraphControls, TimecodePanel,
ReorderableSections and BlendIfBar each hold a fill child, and where they
sit in a content column (BlendIfBar in the Layer Style page) the column
around them hugs them either way.

The fill_column trial shows the given column, nesting, a row stopping it,
the hug kept in a popover, and the measuring-run count against a
fill-width column.
2026-11-12 14:32:47 +00:00
aiongg 39be8c8025 Notice cards: one card width (size.notice.width), a status card's edge and title in its tone, and a toast stack measured and placed inside the body whose corner it sits at 2026-11-12 14:32:47 +00:00
aiongg 47508315ef craft-ui-shell: public embed hooks for apps with their own eframe App
shell::embed holds install (runtime plus fonts), before_input, logic and
before_ui, and CloseDecision. app::run's Driver calls the same hooks.
runtime::keys::with_window_intents is public: the host's read of the
window-level keys no component took. docs/craft-framework.md 2.2
describes the recipe and what install takes over. A trial drives its
own frame loop through the hooks alone.
2026-11-12 14:32:46 +00:00
aiongg 760669272f craft-fonts-build: cut interface faces with craft-font-subset
The subset feature uses craft-font-subset's cut_face (HarfBuzz) in place of
skera, which leaves the workspace. CFF interface faces now cut correctly, so
Error::NotTrueType goes; a cut keeps its source's extension.
2026-11-12 14:32:45 +00:00
aiongg 5bfb923ccd craft-font-subset: add the fsType embed-permission check
embed_permission reads the OS/2 fsType usage permission (installable, editable,
preview and print, restricted) and the no-subsetting and bitmap-only bits, with
the precedence cadcraft's PDF export uses; allows_subset says whether an
exported file may carry a subset.
2026-11-12 14:32:45 +00:00
aiongg 4717f13ae7 Add craft-font-subset and harfbuzz-subset-sys from font-preview-service
Moves font-preview-service's HarfBuzz subsetter into the framework as the one
font subsetter: harfbuzz-subset-sys builds the vendored HarfBuzz 15.0.0
subsetter and holds the safe wrappers, so unsafe stays in that crate (added to
design-lint's contract/unsafe-allow). craft-font-subset keeps the service's
API (subset, subset_renamed, encode_woff2, closure, codepoints) and tests, and
adds cut_face for build-time interface cuts. The facade gets the native-only
font-subset feature.
2026-11-12 14:32:45 +00:00
aiongg 84639de189 A disabled component that shows data paints its enabled look faded
Component::DISABLED picks how a disabled instance looks: the style's Disabled
state (DisabledLook::States, the default for chrome controls) or its enabled
look at Opacity::DISABLED (DisabledLook::Faded). Step 13 fades the surface,
part layers, paint, faces and paint_over of a faded component; its children
and step 14 paint outside the fade and show their own disabled look. egui
fades a shape as it is added, so a settled region replays the faded paint.

Tile, RowThumb, Swatch, PointPicker, Navigator, PreviewPane, ColorStrip,
ColorArea, PaintChip, PagePicture, PagePictures, ReadingView and DrawPad
declare Faded. The tile's disabled veil and the Disabled entries of the tile
and swatch looks go. Opacity::DISABLED is 0.5, the old disabled fade and the
old knob's disabled share.
2026-11-12 14:32:44 +00:00
aiongg 27ca0a19ba A stripe role for striped lists and tables 2026-11-12 14:32:43 +00:00
aiongg 9777ba9c83 Rows, notices and gallery story columns derive their sizes from role tokens
A list row with a thumbnail is at least a standard control and the panel padding tall (the old
thumb_row_min), a centred notice reads about 38 body sizes wide, and the stage tokens become the story
stage (size.story), whose least width also sets the gallery's story columns. A gallery card is at
least a story and its padding wide, and its height guesses come from type and control roles.
size.thumb_row goes.
2026-11-12 14:32:43 +00:00
aiongg a338de11aa Value controls derive their sizes from role tokens: dial, dead zone, switch, progress bar and thumb row thumb
The angle dial is 1.75 standard control heights across with a dead zone of 0.1 (the old dial), the brush
ellipse two dials, the switch track twice its height (the old SWITCH_ASPECT), a progress bar two grooves
thick, and a thumb row thumb as the old levels thumb from the handle sides. size.dial, hit.dead_zone,
toggle, meter and marker go.
2026-11-12 14:32:43 +00:00
aiongg 03d2526deb Slider thumbs take the knob shape role and the control glyph size; component tokens removed
The slider thumb lengths were the only component tokens. A round knob is the control's glyph across
(StyleCx::glyph, shared with the icon-only button glyph); a tab knob is the control's icon side tall.
Themes choose the shape with shape.knob; Classic sets the tab, its old 10 x 16 thumb. TokenRef
collapses into ColorToken, and the theme file's components maps go.
2026-11-12 14:32:43 +00:00
aiongg 90ec9741b4 craft::egui_fork::REV names the lockfile's egui revision, 3f56db2d 2026-11-12 14:32:43 +00:00
aiongg 73fc9dc801 Collection members run their parts, update and finish: a member's parts are sensed with it, its output gives the item event, its parts' nodes sit under its node; TabStrip's tabs are members 2026-11-12 14:32:41 +00:00
aiongg 476602d4a3 A filling story's card is as tall as its content, and content taller than the room shares it
Along a height its parent sizes from its content, a container that fills takes its content height, at most the
room it is offered. When the content is taller, the measuring run is taken back and the container is laid out as
given the room, so its list and the bar under it share it; a record of the content height lets later runs and kept
transcripts lay it out the same. room_height only offers a finite room inside a scroll: a gallery card is as tall as
its story's content, at most the view, as the old gallery's tiles were.

layout_memory::draft runs a measuring run whose hand-forwards can be taken back once its result is seen: records,
kept transcripts, the open transcript's items, leaves and inputs, and each contribution (Contribution::undo for
column widths, label control minimums and reads). steps::id::draft takes the Auto id ordinals back with it. The
shrinking row's least probe is a draft taken back that reads nothing from outside.

A scrolling collection that fills keeps to its measured height in the real run under a body sized from its content,
so a footer under it stays below its rows. The PlacesTree story keeps the old 380 pt box.
2026-11-12 14:32:40 +00:00
aiongg c897f3faf3 Collection members: a collection's items can be members of its run, sensed in its arena and painted as faces; SwatchTable's cells are members, SwatchCell goes 2026-11-12 14:32:40 +00:00
aiongg 7410239246 tools/cl: every command resolves features through feature-root, one framework build per target dir
cargo unifies features only over the packages a command selects, so a framework
crate's tests, a domain crate's tests, the gallery and the story renderer each
built their own copy of the framework and of wgpu. feature-root carries the
gallery's dependencies with every domain crate; cl selects it beside every
command's package and names the crate's own targets, so nothing of it builds.
The per-crate feature anchors go; cl check also checks a crate's bins.
2026-11-12 14:32:39 +00:00
aiongg 543ab4236e Overview: selecting a component glides its card to the top
Lazy::reveal asks its scroll body to glide until the child starts at the
view's start, run or not; the body follows the child's place on the motion
service's follow curve and a move of its own ends the glide. It replaces
Lazy::keep. The gallery's Overview passes the selected card's reveal in the
pass its cards follow the selection, in place of egui's scroll_to_rect,
which no scroll body reads.
2026-11-12 14:32:39 +00:00
aiongg 8f4490ff99 docs(craft-framework): the split UI library, the egui fork, gates and landing as the code has them
- 3.1 to 3.4: the six library crates and the craft-ui facade, with a dependency
  diagram, the crate table and the craft-win32 unsafe exception; taxonomy covers
  every crate.
- 2.1 and 2.3: the gallery profile, cl and the story renderer.
- 3.6: layout memory's kept text; the scroll extent lives beside the offset.
- 3.7: the aiongg/egui pin, its 19 commits and what landing needs.
- 7.1: the step rule of closed list controls (Entry::stepped).
- 8.2: the gates that exist.
- 9.7 to 9.9: measured series size, landing rows without the pasted step rows,
  the facade and API map in place of deprecated aliases, aliases as a question.
- Appendix B: entries for craft-behavior, each library crate and craft-win32;
  where each concept lives.
2026-11-12 14:32:39 +00:00
aiongg 64e3e6f4e5 A scroll body keeps its content extent with its offset
The extent that bounds a body's offset lived in shown memory (`BodyView`),
which is evicted soon after a body stops showing, while the offset and its
anchor live in session memory (`ScrollState`). A body shown again after a
longer hide clamped its kept offset against an extent of 0 and came back
at the top. The extent now lives in `ScrollState` beside the offset, with
the same lifetime; `BodyView` keeps the view rect.

The anchor rule runs only in the run that lays the content out for the
view: a measure run places no Lazy children, so it would clear the anchor.
2026-11-12 14:32:38 +00:00
aiongg e872978edc Overview first show runs only the cards in view
A Lazy child no pass showed yet takes the estimate its app gives
(`Lazy::new(key, estimate)`): that long along the axes its scroll area
scrolls, nothing across them, as a collection places rows it never built
by its item layout's estimate. The never-shown "always run" branch of
`lazy::decide` is gone. Gallery cards estimate their height from their
story rows.

A scroll position the framework holds is also named by content: the
first child at or after the view's start (`lazy::Anchor`, kept with the
offset in `ScrollState` and a collection's `Scrolled`). When extents
before it change, the offset follows the child and the pass runs again,
so the content in view does not move. Bound offsets keep no anchor.

Entries of the out-of-view store record their scroll area. A frame drops
only the entries an area that ran did not reach, so a hidden area (a tab
switched away) keeps its children's extents.

Trials: first show, shown again after a hide, content in view stays when
an estimate above it resolves, collection rows stay when a row above them
changes height; the gallery trial asserts each level first runs the cards
in view.
2026-11-12 14:32:38 +00:00
aiongg 3a0736c569 Docs: the framework, development workflow, design notes and migration records 2026-11-12 14:32:38 +00:00