Skip to content

Tesserae 0.6.0.1

Pre-release
Pre-release

Choose a tag to compare

@mindderivative mindderivative released this 14 Nov 20:39

Fixed

  • An a11y: label or description with {{ in it is kept (T-056). A composed view works every expression out before the builder sees the spec, but the builder took any a11y: value with {{ for a binding to wire: a label such as a tree row's Bar {{ x }}, or a param that holds braces, made the view refuse the spec, and on a patch left the field unset (the label or description vanished). lower now marks the node a11y_literal: true and the view reads its a11y: values as text; a spec written by hand still has {{ }} bindings (tests/test_a11y_literal_braces.py).

  • A state rule on a popup view no longer makes Escape fail. A stylesheet rule with state: focused or state: focus_visible on a view whose root holds an anchored Overlay (ColourPicker, Menu) wrote the focused state again while that state was still notifying, when closing the layer moved the focus back to the trigger; the engine logged was written to again while still notifying and the write was lost. A state written during its own notification is now applied on the next turn.

  • A text input whose text is two-way keeps its caret while you type in the middle of it. After each edit the view set the typed text on the input again, and the engine moves the caret to the end of the text when it is given the text it already shows, so a second character typed after Home landed at the end and a Backspace deleted there (found in the configuration app, where it looked like a lost Backspace). A text the input already shows is no longer set again; a text the app sets still reaches the input.

Added

  • A composed view's sync costs what changed (T-056). Each node of a composition keeps what lower made of it and its subtree and is marked dirty, with the nodes above it, only when a signal it read changes; an unchanged node is the same dict at the next sync, and View.reconcile, the image extraction and the expansion of Window/Dock/TitleBar/view: nodes skip it by identity (the image files are read once, not at every sync). On the Configuration Application's window (235 nodes, headless): selecting a block 15.0 -> 11.0 ms (median), one committed edit 8.4 -> 5.4 ms. A VirtualList and a node with describedby/controls are lowered again every time.

  • The Configuration Application is checked against the real tesserae-shell check and schema (T-056). apps/shell_config/tests/test_shell_config_real_check.py (marker real_shell_check, on when the shell's checkout and a venv of its own with tesserae-shell from a3083ca exist; skipped with the reason otherwise) writes a new file of every type, every block the Add menu offers to every block that may hold it, every selector the builder makes, a theme with every mode, Shadows, For/If edits, calls of a user module named like a shipped one, and one sample edit of 3,073 keys, and runs the real checker on them in a scrubbed environment. It found and the application now fixes: a block of a surface or container (Monitor, Bar, Panel, Popup, a drawn block) goes into its Children { } block, made with the first one (and a block moves into one in one edit); a new module has its one layout block and offers no second; required sets of alternatives are read (Panel gets Width and Height, an SVG its Icon); a new Rule selects .new_rule, not a word that is no block; a type default in a Style has no required keys; a surface's style keys and Shadows go in its Style { }; a key a module sets is read-only outside a module file; a list of key names (Transition) is written as words; the sample of a Tooltip is not empty.

  • The Shell Configuration App, themes, stylesheets, settings, module calls, the Files area, the keyboard pass and the user guide (T-036, phase C5): a theme's token forms add and remove a mode column (Modes, a mode, a token group are in the Add list, each once); a stylesheet's rules are listed by selector (Rule Text:hovered) and a rule's form starts with a selector builder (applies to a block or module, a class or a name; target; part; state), each change one Selector: edit, the style keys narrowed to those the selector's block type takes, an unreadable selector shown as written with every style key; settings.tdl's sections are pages and the missing ones are in the Add list; a Popup named like a default popup shows that popup's values; the Add list offers the user's own modules (the Params of every file under Modules/, read with tess_dl, shown with name and type and no doc) beside the shipped ones; keys whose value is a block (Shadows, Animation, Peek, Inner_Border...) have an Add/Open button, so only the tooltip, the keys with no kind and one token keep the generic field; the Files area makes a new file from a type, duplicates, renames and deletes (to a trash folder of the state folder, never removed; Ctrl+N, F2, Ctrl+Alt+D, Delete); every pane, button and form widget has an accessible name and description, and If and For rows in the tree are named without braces (the toolkit takes a {{ in an a11y: label for a binding and drops it); a folder of more than 12 files opens its Files tree with one group open. Toolkit: View.reconcile builds on the side only what changed instead of the whole window (select 20 -> about 15 ms, edit 15.4 -> about 9 ms in the configuration app). The acceptance criteria are in tests (test_shell_config_acceptance.py, test_shell_config_a11y.py); the user guide, with pictures, is guide/shell-config.md.

  • The Shell Configuration App, check, the Problems list, saving and the file watch (T-036, phase C4): tesserae-shell check --json runs on a worker thread after each save (10 s timeout, never in a frame) and its findings are listed with an icon and a word and file:line:column; clicking one selects the block and the key it points at. "Apply as I edit" (remembered in the app's state folder) writes each commit, undo, redo and structure edit at once (typing once it rests) and asks a running shell to reload; the status line shows status --json; a Reload shell button. A file changed on disk by another program asks Reload or Keep and is never overwritten, the app's own saves never ask; a failed save leaves the old file whole and names the cause. Everything is reachable from the keyboard (F5, Ctrl+Shift+R, A, L, U; F6 reaches the Problems area).

  • KeyChordField writes media and hardware keys by their X names without the XF86 prefix (T-036, phase C4): AudioRaiseVolume, AudioLowerVolume, AudioMute, AudioMicMute, AudioPlay, AudioPause, AudioStop, AudioNext, AudioPrev, MonBrightnessUp and MonBrightnessDown. Recording one of those keys writes the name (the engine's audio_volume_up, media_track_next, ... are read), and typed text takes the XF86 form too and is written back canonically (tess_ui.key_chords).

  • The Shell Configuration App edits an If and a For (T-036, phase C4, part 0): selecting one shows its condition, or its variable, list and key, as editable rows written through tess_dl's with_condition, with_items, with_key and with_variable; only the bytes of that part change, tess_dl's refusal is shown under the row, and renaming a variable says it does not rename its uses. The recorded schema is 1.2 (the popups section is typed).

  • The Shell Configuration App, add, remove, move, duplicate, undo (T-036, phase C3): the Structure area has buttons, a menu (a right click in the area, the Menu key or Shift+F10) and shortcuts for Add child (a list of the selected block's allowed_children, then the shipped modules where it takes module calls; the new block has its required keys only and is laid out by tess_dl.format_block, a Name is the type and a number no block of the file has), Remove, Move up and down (past the next block, If or For), Move to (a list of the blocks the schema lets hold it, the keyboard's way to another parent) and Duplicate (the copy's Name becomes Name_Copy, Name_Copy_2, so names stay unique). Each is one tess_dl edit, one undo step, changes only its own lines and leaves the selection on the block it was on; a button is dimmed where the action cannot be done, and an edit tess_dl refuses (a block inside an If or For) says so in the status line. The model keeps the selection as a place counted in blocks, Ifs and Fors only, since an edit can take a comment away with a block; a copied or moved multi-line block is dedented before Block.with_child indents it again. Undo and redo keep the focus on the form field that held it, and a field that loses its focus while the form is rebuilt no longer writes what it held back.

  • The Shell Configuration App, the toolkit widgets in the form (T-036, phase C2b): the form registry now has the shipped widgets for the kinds that fell back to a TDL text field: icon is the IconPicker (over the built-in icons and the configuration folder's Icons/ folder when it has one, found through the toolkit's file system), font the FontList, key_chord the KeyChordField (written Ctrl+Alt+Shift+Meta+Key; text that is not a chord is refused), and list the ListEditor with the schema's item kind (text, name, number or whole with the key's range, bool, enum with its choices, colour), its length, unique and one_or_list; a list whose item kind has no row says why and stays a TDL field. The token button is the shipped TokenButton (the tokens of the groups the key accepts, preferred_tokens first, writes $group.name), replacing the app's own simple popup. The coverage test's fallback list is now only the kinds with no kind, shadows, block and tooltip.

  • The Shell Configuration App, the form (T-036, phase C2): the Form area beside the Structure tree, generated from the schema: the selected block's keys in the schema's groups (an opened group builds its rows), one row each with the widget of the key's kind (switch, choice list, number with range and step, length with units, one or four sides, the shipped ColourPicker, text with the schema's pattern, a path with the shipped FileDialog, the generic TDL field), a token button, an expression toggle for a key with a slot, a reset that removes the property, the default as the placeholder and a marker on an absent required key. Also settings sections, module calls and theme token groups with a column for each mode. A widget registry maps a kind to a widget and a coverage report lists the keys that got the generic field with a reason. Every edit is one tess_dl edit, so only its line changes.

  • The Shell Configuration App, first part (T-033, phase C1): apps/shell_config/ is a package of its own (tesserae-shell-config, import tess_shell_config, command tesserae-shell-config). A window with Files, Structure (the toolkit's Tree, If and For as nodes) and Text areas over the shell's configuration folder, a schema reader for tesserae-shell schema --json (an unknown major version is refused), the shell-command layer, and lossless open and save: a file opened and saved unchanged is byte for byte the same, a save goes through a temporary file and a rename, and the first save keeps the old content in the app's state folder. tools/tests_for.py, tools/ci_plan.py, tools/mypy_ratchet.py and the real-session guard (now tests/real_session.py) cover it, and CI has a Python 3.14 job for its tests.

  • ColourPicker (#298): a colour picker, inline or (popup: true) behind a swatch that opens it in a layer. A square of saturation and value, a hue strip, an alpha strip, a hex field (#rrggbb or #rrggbbaa), red, green, blue and alpha number fields and a row of the theme's colour roles. value is two-way text, '#rrggbb' (or '#rrggbbaa' when the alpha is below 1, lowercase): a value set and read back is the same text, and the hue is kept through a grey or a black, so a drag to a corner and back does not drift. Text typed in the hex field that is not a colour leaves the value as it was and draws the field in the error colours. on_change runs after each change the user makes; open is two-way; Escape and a press outside close the popup. The arrow, Page Up, Page Down, Home and End keys move the square and the strips, Tab goes square, hue, alpha, the fields, the swatches, and a screen reader gets sliders in percent and degrees. The pieces are also widgets of their own (ColourArea, ColourStrip, ColourField, ColourSwatches, and colour_area, colour_strip, colour_field and colour_swatches in tess_ui.widgets), and tess_ui.colour has the text and hue, saturation, value conversions.

  • FileDialog (#299): a file and folder dialog inside the app, a modal panel over a scrim, for mode: open (one file, or several with multiple), mode: save (a folder and a name, which asks "Replace file?" before it answers when the file is there) and mode: folder. A path bar (type a path and press Enter; one that is not a folder says so under the list), the folders of the path as buttons, Back, Forward, Up, Home and Refresh; a list of folders first and then files, each sorted without regard to case, with their sizes and times; filters ({label, patterns}, with an All files choice after them) that hide the files that do not match and never a folder; a switch for the names that start with a dot (off unless show_hidden); New folder when saving or choosing a folder; root to keep it inside a folder (a symlink in it that leads out does not escape); a filename and, for a name with no extension, the extension of the type in use. value is two-way text, the absolute path (a list when multiple), written when OK is pressed; on_accept and on_cancel are handlers. The keyboard works in the list: Up, Down, Page Up, Page Down, Home and End, Enter, Backspace, Alt+Left and Alt+Right, Ctrl+A, Shift and Ctrl with a press, and typing a name's start. It builds only the rows in view (a VirtualList) and reads one folder at a time, so a folder of ten thousand files opens at once. A folder that cannot be read (permission denied, gone, or a file) is a message in red and the dialog stays where it was. Nothing is read from the disk until it opens. The disk is reached through tess_ui.filesystem (filesystem.use() swaps it), the rules are in tess_ui.file_browser.FileBrowser (no window), and tess_ui.file_dialog.FileDialogRequest opens the dialog from a ViewModel and hands the paths to a callback. The view drives a new control that draws nothing, widget: FileBrowser. File dialog.

  • IconPicker (#300): a searchable grid of icons, inline or (popup: true) behind a button that shows the icon and its name and opens the grid in a layer under it. The icons are the curated set of tess_ui.icons and the .svg and .png files of an optional icons_folder (read through tess_ui.filesystem, once when the grid opens; a folder that cannot be read is a message under the grid and the built-in icons stay). value is two-way text: a built-in icon's name, or a file's name with its extension. The search keeps the icons whose name has every word typed (arrow back finds arrow_back). The grid is virtual (rows in view and three past each edge; a file is read for its picture only when its row comes into view; an SVG that is not one, or that carries a document type, is a plain file glyph). The search field has the focus when a popup opens and Up, Down, Page Up, Page Down and Enter work from it; in the grid the arrows, Home, End (Ctrl for the whole grid), Page Up, Page Down, Enter and Space. A pick writes value, calls on_change and closes a popup (close_on_pick: false keeps it open); Escape and a press outside close it and the focus returns to the button. New: the IconBrowser control (it draws nothing; tess_ui.icon_controls, with the window-less IconBrowser model), the base tess_ui.mind the Configuration Application's other widgets share, and FileSystem.read_bytes.

  • FontList (#301): a searchable list of the installed font families, inline or (popup: true) behind a button that shows the family in its own face and opens the list in a layer under it. The families come from tess_ui.font_families: fc-list : family by default (a read-only subprocess given five seconds, run once; lines split on newlines and commas, trimmed, de-duplicated and sorted without regard to case), or any function given to font_families.use. A machine with no fc-list, or where it fails or lists nothing, gets a text field for the family's name (with the reason under it) in place of the list. A row is shown in its own family only when the engine can draw it (fonts.available_families()), and in the ordinary face otherwise. value is two-way text; the search keeps the families that have every word typed; the list is virtual (seven thousand families open at once); the search field has the focus when a popup opens and Up, Down, Page Up, Page Down and Enter work from it, and in the list the arrows, Page Up, Page Down, Home, End, Enter and Space. A pick writes value, calls on_change and closes a popup (close_on_pick: false keeps it open); Escape and a press outside close it and the focus returns to the button. New: the FontBrowser control (it draws nothing; tess_ui.font_controls, with the window-less FontBrowser model) and tess_ui.font_families.

  • KeyChordField (#302): a field for a keyboard shortcut, an outlined text field and a button that records. The chord is text, Ctrl+Alt+Shift+Meta+Key: the modifiers held in that order and one key last, a named key in title case (Ctrl+Shift+F1, Alt+Left, Meta+Space). Press the button (or focus it and press Enter or Space) and the next key press is the chord: Escape on its own cancels, Backspace on its own clears, a modifier on its own never finishes it and only shows what is held (Press keys Ctrl+Shift+), and a key that no chord can have is named under the field while the recording goes on. A chord can also be typed: it is read when Enter is pressed or the field is left, in any case and the usual names (control + return is Ctrl+Enter), and rewritten in the canonical form; text that is not a chord is refused in the error colours and value stays. value is two-way text (a value the app sets is shown as it is and never rewritten) and recording is two-way too. New: the ChordRecorder control (it draws nothing; tess_ui.chord_controls) and tess_ui.key_chords (normalise, from_event).

  • ListEditor (#303): an editor for a list of items of one kind. value is a Python list, two-way, and item_kind is text (a text field), number (a spin box bounded by least and most; a whole number stays an int when step is whole), bool (a switch), enum (a button that opens a menu of choices, plain values or {value, label}) or colour (a swatch that opens the colour picker in a popup). Each item is a row with its widget and Move up, Move down and Remove buttons, and an Add button appends the kind's default (empty text, the least number or 0, false, the first choice, black); min_items stops Remove (with a message under the list) and max_items stops Add. A text row writes when Enter is pressed or the field is left, the others when they change; an edit writes a new list in which only the edited item differs, and on_change is called. A list the app sets is shown as it is and never rewritten: an item that does not fit the kind is shown as the nearest value (0, the first choice, black) and left alone until that row is edited. Each item has an identity that stays with it when it moves, so a row keeps what is in it. Tab reaches every widget and button, Enter or Space press one; a screen reader hears a group, a list and items named by label and their place. The mind is widget: ListModel (tess_ui.list_controls; the model is ListModel there too, with no window). Not built: Alt+arrow keys (a handler cannot choose between three calls by the key), dragging a row, mixed kinds, and turning the list into TDL text.

  • TokenButton (#304): a button that picks a theme token from a searchable list in a layer under it. The tokens are data you give it: tokens is a list of {name, ref, kind, value, doc} (ref is what a pick writes, such as $color.primary, and is a $ and the name when left out; a token with no name or a repeated ref is left out), groups is more tokens in named sets ([{name, tokens}]; a row says its group before its doc) and preferred lists names or refs first, in that order. A row is the name, a line with its group and doc, and the value: a swatch for a colour token (kind: colour or color with a '#rrggbb' or '#rrggbbaa' value), the value as text for any other. The button shows the ref it holds, with a swatch when it is a colour token it knows; a ref that is none of the tokens is kept and shown as it is. value is two-way text: a pick writes the ref, calls on_pick and closes the layer (close_on_pick: false keeps it open). The search keeps the tokens with every word typed in their name, ref, group or doc (any case, any order; a name that starts with the first word comes first) and is empty each time the list opens, which opens scrolled to the held token. The list is virtual (the rows in view and three past each edge). The keyboard: Enter on the button, or Down, opens it with the search focused; Up, Down, Page Up and Page Down in the field move the cursor and Enter picks; Tab goes on to the list (arrows, Page Up, Page Down, Home, End, Enter, Space); Escape and a press outside close it and the focus goes back to the button. A screen reader hears a button named "label: ref" that is expanded while open, a group, a list of items named "name: value" and selected for the held one. The mind is widget: TokenList (tess_ui.token_controls; TokenList there is the model, with no window). Not built: a tree by dotted names, previews for kinds other than colour, and tokens read from the theme or the Shell (the app passes them).

Changed

  • A change to a view's signals composes its window once, not once per signal (T-036, phase C4, part 2): the window's one effect (ComposedView._sync: lower the whole composition, build it on the side, patch the nodes) ran at once for every signal and every for: or if: region that changed under one write, ten times for one selection in the Configuration App (about 14 ms each at 260 nodes). Effect takes deferred=True: such an effect that is told while a write or a batch is still notifying runs once after it, when everything that write set off has settled (the write has still not returned when it runs, so a caller sees the result at once, and it runs also when another subscriber raised). The window's effect is deferred. Also: the four spec expanders (Window, Dock, TitleBar, view:) no longer each copy the whole spec on a sync (one copy), and a reading frame no longer searches a list for each read it records. In the Configuration App: selecting a block 210 ms -> 20 ms, one committed edit 21 ms -> 16 ms, a closed menu is no longer part of the window.

  • Tesserae needs tesserae-engine 0.6.7, one exact release (it was 0.6.0). 0.6.2 sizes an unsized text node to its text (get("width") reads "fit-content", not "auto", and a fit width is the text plus 2 px), and 0.6.4 rejects a shader that declares a function named sd_circle, sd_box, sd_round_box, sd_round_union, sd_smooth_union or sd_coverage. 0.6.3 and 0.6.5 add PopupWindow options Tesserae does not use. 0.6.6 adds wrap and overflow to a text_input. 0.6.7 changes every text input's keys: Ctrl+Left/Right and Ctrl+Backspace/Delete act by word, Ctrl+Home/End in a multiline input go to the start or end of the text, and a double click selects a word (a headless test that clicks one input twice must window.advance(1000) between the clicks). The size, label, widget, layout, overflow and keepalive tests passed on 0.6.5; the full suite passed on 0.6.7.