Skip to content

Releases

Tesserae 0.6.3

Choose a tag to compare

@github-actions github-actions released this 17 Nov 06:30
cc5c908

Changed

  • Tesserae runs on TEL 0.2.0 (tesserae-el==0.2.0), which has no template form: the text around slots is split by Tesserae. TEL is an expression language only now (Template, compile_template, fill_template, the codes template-unclosed and template-empty and the {{ }} delimiter are gone from it). The TDL front end already reads a slot as its own piece, so a text with slots goes to the view as tess_ui.tel.Parts (the literals and each slot's expression text, with where that text starts in the file) and tess_ui.tel.compile_template(parts) compiles every slot with compile_expr; nothing writes {{ }} between the front end and the node any more, and no text is searched for delimiters. For a view, a stylesheet or a theme in TDL the behaviour is the one of 0.6.2: a value that is one slot keeps its type, a slot with text around it or several slots make text (None is nothing), the names and reads of a text are the union over its slots, and an error in a slot names that slot's line and column. What an author can meet:
    • The step budget is each slot's. A text of three slots may take three times max_steps (the limit that errors with limit-steps); it was one budget for the whole text. The 2000 characters of source and the 1 MB of text still count for the whole text (limit-source, limit-string).
    • A message that quotes a slot spells it as written. got '<| x |>' where it said got '{{ x }}' (a name, a Window_Region, a tooltip placement given a slot).
    • An object of the application's in text says its own class. a Settings cannot be used in text (value-not-plain, "read one of its attributes instead") where TEL said a _Host cannot be used in text.
    • A {{ }} in a Python dict is no longer an expression. App(stylesheet_spec={...}) and RuleSheet.of({...}) with "{{ h / 2 }}" as a style value are refused (style 'height' has {{ }} in its text, and {{ }} is not a slot): a stylesheet is read from TDL, where the value is Height: <| h / 2 |>; a dict spec that must hold an expression takes the Parts the front end makes.
    • The mapping the front end gives holds a slot as Parts, not as {{ x }}. load_tdl_file, load_marked_tdl and load_marked_tdl_stylesheet return a str subclass whose text is what the file says (Battery <| level |>%); the JSON schemas' pattern for an expression is <| (it was {{). Code that checked the mapping for {{ checks isinstance(value, Parts).
    • An unclosed or empty slot is a TDL error, as it was. This <| has no |> on its line and This slot is empty come from tess_dl before TEL sees anything, so template-unclosed and template-empty never reached an author.
  • API of tess_ui.tel: compile_template(parts, *, limits=) takes a Parts (it took text and an origin and returned None for text without {{); Slot and Parts are new; Template, NestedTemplate and Expr keep their methods and attributes.

Tesserae 0.6.2

Choose a tag to compare

@github-actions github-actions released this 16 Nov 01:16
c937eb9

Changed

  • The colour parser and the image decoder are tesserae-utils' (tesserae-utils[image]>=0.2.2,<0.3, import tess_utils). Colour strings parse to the same values and fail with the same messages as before. Images change in three ways: Image, image() and a cursor's src: load PNG, JPEG, GIF and WebP only (BMP, TIFF, ICO and the other formats Pillow read are refused), the file's EXIF orientation is applied (a photo that was stored sideways is shown upright), and the error text for a file that cannot be read is the shared one (cannot decode image '<path>': cannot read the image: ...).

Removed

  • tess_ui.tokens.parse_color and tess_ui.images.decode_image. Use tess_utils.parse_color and tess_utils.decode_image_file(path), which returns (width, height, rgba) (decode_image returned (rgba, width, height)).

Tesserae 0.6.1

Choose a tag to compare

@mindderivative mindderivative released this 15 Nov 23:34
c0407ad

Removed

  • YAML is no longer read. A view, a stylesheet and a theme are TDL (*_View.tdl, *_Stylesheet.tdl, *_Theme.tdl) and nothing else. Every loader (open_view, load_stylesheet, load_theme, App(stylesheet=), App(custom_theme=), hot reload) refuses a .yaml or .yml name with one message: Tesserae no longer reads YAML, write the file as TDL (tesserae migrate-tdl in tesserae-ui<0.6.1), see Migrating from YAML. A name that is not found says so too when a Name_View.yaml is in the project. The shipped .yaml twins of Tesserae's views, stylesheets and default theme are gone, and so is TESS_UI_SHIPPED.
  • The converter. tesserae migrate-yaml and tesserae migrate-tdl (and the tess_ui.migrate* modules) are removed; they live on in tesserae-ui<0.6.1, which is what Migrating from YAML uses.
  • The Python API that opened a YAML view file: App.load, App.build_view, App(window_view=), View(path), tess_ui.instantiate, tess_ui.Component, tess_ui.Repeater, tess_ui.overlays.ViewDialog, tess_ui.spec.load_view and ViewWatcher. Open a view with app.open_view, repeat a node with For, and show a view in a dialog with a modal Overlay in a view (the table in Migrating). A per-screen stylesheet= on load is gone with it; App(stylesheet=) is the app's stylesheet.
  • The *_Component.yaml and *_Style.yaml file kinds. A project no longer has a Components/ folder of fragments, component: and include: do not read a project's files, and a rule's style: cannot name a *_Style.yaml file. The built-in fragments the Python widget factories used (tess_ui.spec.fragments) and their expander (tess_ui.spec.expand, expand_components_to_spec) are gone too: the factories call the views Tesserae ships.

Changed

  • Expressions and handlers run on TEL, the Tesserae Expression Language (tesserae-el==0.1.2, import tess_el), and tess_ui.expr is gone (piece 11b). The grammar, the functions and the limits are the same; what an author can meet: d.get() on a Signal that holds a dict is the dict's own get (it needs a key; write d), and n.get() on a plain value now gives the value; the name _ is refused; a template text over 2000 characters is refused as a whole (the limit counts the text, not each <| |> part); a Signal inside a list or a dict (rows[0] + 1, d.k + 1) is no longer read in the middle of an expression (rows[0].get() + 1 works; an expression that ends in one still reads it); a method that is not allowed (items.append(x), x.bit_length()), str.format, isinstance(x, (int, str)), a ** with a literal exponent over 64 and a call of something that is not a function now fail when the view loads, not when the expression runs; an action in a handler is a step of its own or the whole value of a Set (ok = copy(text)), not part of a bigger expression; each step of a handler has its own evaluation budget; the error wording changed (the method 'append' is not available, the range is over 100000 items, an unknown function has no allowed: list, only did you mean) and every ExprError has TEL's code (unknown-name, call-not-function, method-not-available, bad-call, limit-range, ...). See Migrating.
  • The engine is tesserae-engine 0.6.8 (was 0.6.7), the release the whole suite was run on.
  • pyyaml is no longer a dependency. The Python widget factories read no YAML. A project that read YAML itself installs pyyaml on its own.
  • The Python widget factories are calls of the views Tesserae ships. button(), icon_button(), fab(), extended_fab(), split_button(), button_group(), card(), list_item(), chip(), badge(), divider(), link(), text(), accordion_header(), tree_node(), date_picker_day(), period_selector(), search_bar(), toolbar(), top_app_bar(), status_bar(), menu_item() and the actions, rows and panels of the dialog, menu, snackbar, popover and side sheet are built from Button, IconButton, Fab, Card, ListItem, Chip, Badge, Divider, Accordion, TreeNode, DatePickerDay, PeriodSelector, SearchBar, Toolbar, TopAppBar, StatusBar and MenuItem, with Tesserae's own rules (Button_Stylesheet.tdl, ...), so a factory widget and the same view in a TDL file look and behave alike. A caller sees the same functions, arguments, parts (.part("label")), Signals and callbacks, and ids name and name.part; what changed is listed in Migrating. The shipped views gained what the factories need: Card and Toolbar take Bare (only the surface, for nodes a Python widget adds itself), Badge takes Flat (the root is the mark), SearchBar takes Trailing_Icons (a list) and shows no leading icon when leading_icon is empty, and a StatusBar's notes are keyed by their position, not their text.
  • Python 3.14 is the minimum, and tesserae-dl is a dependency (it was an optional extra): TDL is read by tess_dl, which needs 3.14.

Tesserae 0.6.0.1

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 t...

Read more

Tesserae 0.6.0

Choose a tag to compare

@mindderivative mindderivative released this 04 Nov 03:53

Tesserae's Python packages take the tess_ prefix the other Tesserae projects use: Tesserae's own is tess_ui (#295) and the engine's is tess_re (#296). It is a new release series, so the first line of a file moves from tesserae: 0.5 to tesserae: 0.6. This is the release of the two steps below, 0.5.1.10 and 0.5.1.11, which were not published on their own.

Changed

  • tesserae is tess_ui and tre is tess_re, and nothing is left under the old names. from tesserae import App is from tess_ui import App; import tre is import tess_re; after the upgrade the old names are a ModuleNotFoundError. The environment variables follow (TESSERAE_* is TESS_UI_*, the engine's TRE_* is TESS_RE_*), and so do the editor schemas (tess-ui-*-schema.json) and the logger (tess_ui). Migrating lists every change and how to find the places in your code.
  • Tesserae needs tesserae-engine 0.6.0, one exact release (it was 0.5.8). A project that imports the engine itself changes tre to tess_re; every name inside the engine is unchanged.
  • The first line of a file is tesserae: 0.6. The shipped views, stylesheets and theme, the project templates, the examples and every whole-file block in the docs say it, and tesserae new, tesserae add screen and tesserae migrate-yaml write it. A file you wrote that says tesserae: 0.5 is refused with written for Tesserae 0.5: run tesserae migrate-yaml, and the command now does that: it moves the first line of every view, stylesheet and theme of the older line to 0.6, and changes nothing else in the file (a comment after the value, Windows line ends and a byte order mark stay). tesserae migrate-yaml alone reports what it would move, and --write moves it. The view language is the one of 0.5: nothing but the first line differs. A file with no first line still loads, with a note in the log; the key is meant to be required from a later line.

Fixed

  • App.run(keepalive=True) returns after the window closes on macOS (#297). With tesserae-engine 0.5.9 and later (found on 0.6.0), the keep-alive callback that queues itself again kept run() from returning on macOS once the last window had closed: the engine runs queued callbacks while no window is open, and the loop never got to its exit. The keep-alive callback, and the frame counter behind TESS_UI_FRAMES_REPORT, now stop when the main window closes. It was found by running the one failing test on GitHub's macOS runners with the engine at 0.5.8, 0.5.9, 0.5.10 and 0.6.0; 0.5.8 passes. Your own callback that queues itself with thread_handle().call_soon has the same problem on macOS until the engine is fixed: stop it when the window closes. The engine was asked to fix its side (design/tre-requests/exit-with-a-requeuing-callback.md, tess-re#260).

Unchanged

  • The PyPI names (tesserae-ui, tesserae-engine), the tesserae command and python -m tess_ui, the .tesserae/ folder tesserae schema --project writes to, and the repository mindderivative/tess-ui.

Known

  • A callback of your own that queues itself with thread_handle().call_soon can keep run() from returning on macOS after the last window closes, with tesserae-engine 0.5.9 and later; stop it when the window closes. Asked of the engine: tess-re#260.
  • Verified in CI on Ubuntu, Windows and macOS; not on real macOS or Windows hardware.

Tesserae 0.5.1.9

Choose a tag to compare

@mindderivative mindderivative released this 03 Nov 20:48

The PyPI name is tesserae-ui again. The repository stays mindderivative/tess-ui.

Changed

  • Install with pip install tesserae-ui. The rename to tess-ui (0.5.1.8) is taken back: the package keeps the name it was first published under, as the other Tesserae packages keep theirs (tesserae-engine is tre). The import name (import tesserae) and the tesserae command are the same, and so is everything in a project. tesserae new installs tesserae-ui into the project's virtual environment again, and the messages that name the package say tesserae-ui: pip install tesserae-ui[build] for tesserae build, and the upgrade hint for a file written for a newer series.
  • If tess-ui is installed, switch: pip uninstall tess-ui, then pip install tesserae-ui. The two hold the same tesserae package, so they must not be installed together. The release that was published as tess-ui (0.5.1.8) is the same code, and this repository's release workflow publishes tesserae-ui only. The note in 0.5.1.8 that tesserae-ui gets one more release and no more no longer holds.
  • Unchanged: the repository, the docs address and the editor schemas' $id still say tess-ui; they name the repository and its Pages site, not the package.

Tesserae 0.5.1.8

Choose a tag to compare

@mindderivative mindderivative released this 02 Nov 09:23

The first release as tess-ui (the PyPI name was tesserae-ui) from mindderivative/tess-ui. It also carries 0.5.1.1 to 0.5.1.7, which were never published on their own: everything below is new since 0.5.1. If tesserae-ui is installed, pip uninstall tesserae-ui first, then pip install tess-ui.

0.5.1.8

The PyPI name is tess-ui (it was tesserae-ui), and the repository is mindderivative/tess-ui (it was mindderivative/tesserae).

Changed

  • Install with pip install tess-ui. The import name (import tesserae) and the tesserae command are the same, and so is everything in a project. tesserae new installs tess-ui into the project's virtual environment, and the messages that name the package say the new name: pip install tess-ui[build] for tesserae build, and the upgrade hint for a file written for a newer series.
  • If tesserae-ui is installed, switch: pip uninstall tesserae-ui, then pip install tess-ui. The two hold the same tesserae package, so they must not be installed together. tesserae-ui gets one more release, the same code with a note at the top of its PyPI page, and no more after that.
  • The repository and the docs moved. The repository is https://github.com/mindderivative/tess-ui (GitHub redirects the old addresses of the repository and its issues) and the docs are at https://mindderivative.github.io/tess-ui/ (Pages does not redirect, so the old address is gone). The editor schemas' $id is an address in the docs, so tesserae-*-schema.json now name https://mindderivative.github.io/tess-ui/schema/...; a yaml.schemas setting that names the schema files by path is not affected.

0.5.1.7

#294: a file whose content is another kind says what it looks like.

Fixed

  • A view that holds a stylesheet or a theme says so. Brand_View.yaml with styles: used to give only a node needs a 'widget:' (its keys are: styles); it now goes on with this looks like a stylesheet: name it Brand_Stylesheet.yaml. A theme's seed:, dark:, colors:, typography: or components: says a theme and Brand_Theme.yaml. Only the root of the file is judged: a nested node with styles: is a mistake in the node, not in the file's name.
  • A stylesheet or a theme that holds a view says so, and a stylesheet that holds a theme. Brand_Stylesheet.yaml with widget: or seed: is refused when it is loaded, as <path>: this looks like a view: name it Brand_View.yaml; the same for a rule sheet (a stylesheet has only 'styles:', not 'widget' (this looks like a view: name it ...)), a theme file (unknown field ... (this looks like a view: ...)) and a dict given to App(stylesheet_spec=) or custom_theme_spec=, where there is no file name and the hint says <Name>.
  • The hint is decided from the root keys alone and always says "looks like". widget: is a view; a theme key is a theme and wins over styles:, which a theme may hold too; styles: alone is a stylesheet. A file that looks like none of them, and the older syntax (kind:, component:, view:, include:), keep their messages.

Stylesheet and theme files and what is checked describe it.

0.5.1.6

#293: a name that is not found says where the file is.

Fixed

  • A view, theme or stylesheet kept in the wrong folder is named in the error that says it was not found. Extra_View.yaml in Themes/ used to give only no view called 'Extra' (Extra_View.yaml) in Views under <root>: add the folder to App(search=[...]) or pass the file's path; the message now goes on with found Themes/Extra_View.yaml: views are read from Views/ (or add Themes to App(search=[...])). Two files with that name are both listed.
  • A file with the same name under another kind's suffix is named as what it is. Asking for the theme Brand when only Views/Brand_View.yaml exists adds found Views/Brand_View.yaml, a view, not a theme.
  • A name that is nowhere gives the same message as before. The project is walked once, only when a name is not found, with the folders a recursive=True search skips (hidden folders, virtual environments, node_modules and the rest); the walk took 5 ms on this repository.

Finding files by name and what is checked describe it.

0.5.1.5

#292: the first line of a Tesserae file.

Added

  • A view, stylesheet or theme may start with tesserae: 0.5, the release series it was written for (the first two numbers of Tesserae's version). It is read before anything else in the
    file, and nothing else in the file sees it (not a node's properties, a stylesheet's styles: or a theme's fields). It must be the first line: a tesserae: under a comment, a blank line
    or --- is an error that names the line it is on. A value that is not a release series says to write tesserae: 0.5; a newer series says to upgrade, an older one to run
    tesserae migrate-yaml. It is optional in this series: a file without it loads, and the log says once, at the info level, that it has none. A later series will require it.
    The first line describes it.
  • Every file Tesserae ships or writes has it: the 90 shipped views and stylesheets, the default theme, the five project templates (tesserae new, tesserae add screen), the examples,
    the whole-file blocks in the docs, and everything tesserae migrate-yaml writes (the key, then the file's own comments). tools/stamp_language.py --write puts it on the shipped files and
    changes its value when a new series is started.
  • A mapping read from such a file keeps working: yaml.safe_load of a stylesheet or theme file with the key, given to App(stylesheet_spec=), custom_theme_spec= or RuleSheet.of, is accepted.
  • The editor schemas allow the key (tesserae-widget-schema.json, tesserae-stylesheet-schema.json, tesserae-theme-schema.json), checked with the real YAML language server.

Changed

  • A schema modeline (# yaml-language-server: $schema=...) cannot be used in a file that starts with the key. The server reads a modeline only from the comments before the first key (tried on the
    real server: line 1 applies, under the key or beside it does not). Such a file takes its schema from the yaml.schemas setting that tesserae schema --project prints.
  • migrate-yaml writes a translated file with a block-style top level (widget: Rect, not {widget: Rect}), since a flow mapping cannot follow the first line.

0.5.1.4

Changed

  • Tesserae now asks for exactly tesserae-engine 0.5.8 (it was 0.5.7 or newer, below 0.6). A new tre release could reach a fresh install the day it came out, and 0.5.8 did: it changed hit testing so that a press on a rounded shape must land inside the shape. Tesserae's own tests had pressed 5 px in from the corner of a rounded button, which is outside it; four of them failed, and now press the middle. The whole suite passes on 0.5.8 (8404 tests). A newer tre is tried by the maintainer before this moves.

0.5.1.3

#288: a stylesheet rule's part:.

Fixed

  • A rule's part: that names no node of the widget is an error that names the nearest one. widget: Card with part: heading used to match nothing and say nothing (the docs index example had exactly that mistake). It now fails where the stylesheet is read, with the file, line and column: Card has no part 'heading', did you mean 'headline' (parts: actions, body, headline, picture, subhead, text). A part is a named node in the view's own YAML. This covers the app's stylesheet (App(stylesheet=) or stylesheet_spec=) and a project's <View>_Stylesheet.yaml; a built-in widget has no parts, so a rule that names one for Splitter or Container says has no parts. A rule for a view that is not found is still not checked. The stylesheets Tesserae ships are checked against the shipped views by a test.

0.5.1.2

#289: style.placement or style.offset with no style.anchor.

Fixed

  • placement or offset without an anchor is an error at the node. style: {placement: above} used to be accepted and did nothing (the node stayed in the flow), so a forgotten anchor gave no hint. The view now fails when it is built, naming the node: Rect 'root.dot': style.placement does nothing without style.anchor (name the node to sit against, or parent). The check is on the style a node ends up with, so a rule that gives only placement still works for nodes that give the anchor (and the other way round); an anchor: that is an expression and works out to nothing still returns the node to the flow.

0.5.1.1

The documentation audit (#287): every page checked against the code, every tutorial run as written.

Fixed

  • A theme file with an unknown key names the file when it is read (ValueError: themes/Brand_Theme.yaml: unknown field colours, expected one of ...). It used to be found only when the theme was first used, and the message named no file.
  • An offset past the end of a bound ScrollView no longer logs a "written to again" error. The offset was held at the end as documented, but writing it back to the Signal that had just set it happened inside that Signal's own notification; it now waits for the next frame.
  • tesserae new --help says widget: Window, not kind: Window; the message for a theme, stylesheet or style file loaded under the wrong name no longer carries a milestone tag.

Docu...

Read more

Tesserae 0.5.1

Choose a tag to compare

@mindderivative mindderivative released this 19 Oct 01:08

Everything since 0.5.0 (the point releases 0.5.0.1 to 0.5.0.31, each with its own entry in the changelog, which were committed and pushed but never published to PyPI). Requires tre (tesserae-engine) 0.5.7.

The view language

  • Layout (0.5.0.8, 0.5.0.24, 0.5.0.25, 0.5.0.26, 0.5.0.28): sizes may be sums (calc(100% - 16), 100% - 16) and fit-content; left, top, right, bottom and inset place an absolute node against the edges of its parent; anchor, placement and offset place a node in the tree against another node, at a side or a corner, and it follows with no lag (hidden with its anchor); overflow: hidden | visible; a labelled Checkbox, RadioButton or Switch is placed as a whole row; a ListItem's divider is drawn. Overlay takes the corner placements, offset and flip.
  • Nodes (0.5.0.6, 0.5.0.7, 0.5.0.9, 0.5.0.22): visible: on any node, pointer_events: none, typing effects on a text field, number ranges, and styled spans inside one Text (runs).
  • Components: Slider (Expressive sizes, vertical, an inset icon), RangeSlider with two handles, thicker progress indicators with the circular gap, the two-bar sweep, a contained loading indicator and wavy shapes, and drop zones on the halves of a split dock.
  • Bindings (0.5.0.27, 0.5.0.29, 0.5.0.31): Two-way properties is the one page that says what a view may write back and what it keeps. A handler's assignment to a name it cannot write, and the same in the text of an after(...) or every(...), is found when the view loads, with its position; the log warns when an editable property is given a bare name that cannot be written back.
  • Projects (0.5.0.15, 0.5.0.19, 0.5.0.21): tesserae new and tesserae add screen write the current language; the examples are in it; a view's stylesheet is read only when the application uses the view.

Hot reload and editor support

  • Hot reload for views written with widget: nodes, including routed screens, and the app's stylesheet of widget: rules (0.5.0.13 to 0.5.0.15).
  • The editor schemas know the current language, and are checked in Red Hat's YAML language server (0.5.0.18, 0.5.0.30).

Fixed

  • A flex-expanded Slider maps the pointer with the width it was laid out at; surface.dismiss closes a widget: Overlay; a borderless window no longer crashes with a stylesheet of widget: rules; a function name that does not exist is a load error; a mistyped colour role is named; ViewDialog given a current-language view says what to do.

Each point release has its own entry in the changelog, with the issue and the detail.

Tesserae 0.5.0

Choose a tag to compare

@mindderivative mindderivative released this 10 Oct 04:47

The YAML language redesign (#209), then the components and the windows work.
The language is specified in design/yaml-language.md; the phases land one at a time.

Changed

  • Bindings are a Python subset (phase 2). tesserae.expr is a sandboxed evaluator (an ast node whitelist, name resolution
    through a scope, limits on source size, depth, nodes, steps, ranges, sequences, exponents, integers and text) that replaces the port
    of tre's binding grammar. Python's arithmetic and comparison rules apply (1 == 1.0 is True, unary minus, None, if/else,
    comprehensions, f-strings, whitelisted functions and methods), and a Signal reads as its value (count and count.get() agree).
    Operators, truth tests, subscripts, formatting and built-ins touch only plain values, built-in containers, mappings, dates, decimals
    and enums, so an application's own object can be read by attribute but none of its methods run from a view. tesserae.binding
    keeps parse_binding, evaluate, evaluate_value, Handle and BindingError over it, and errors now carry the position and a hint.
    See Binding Expressions.

  • The node model (phase 3). tesserae.spec.widgets is the widget registry (Property with type, default, choices, required and model;
    @widget, declare, register_widget, decl_from_params for a view's params:, and a JSON schema per widget in
    schema/tesserae-widget-schema.json). tesserae.spec.nodes.parse_view reads a view in the 0.5.0 syntax (widget:, optional name:,
    properties, if, for, key, slot, state, style, classes, handlers, a11y, interaction, window_region, route, children):
    every key and property is checked, every expression compiled, every node given an id from its path, and an error names the file, line and
    column with a suggestion. tesserae.spec.translate turns 0.4.x YAML into it; 128 of the 131 files in the repository translate and load, and
    the other three are reported (a dynamic widget name, and a property a call binds that its fragment does not declare). Nothing builds from the
    new syntax yet: that is phases 4 and 5.

  • Composition (phase 4). tesserae.spec.compose.Composer turns parsed views into a live tree of Instances: a view call is replaced by the
    callee's root, its arguments are evaluated in the caller's scope and stay reactive inside the callee, Slot holds the call's children (built in
    the caller's scope, with errors for a view that takes none or a slot it lacks), for: expands a node per element and a reactive one is
    reconciled by key: (kept, added, removed, reordered), if: builds and disposes as its expression changes, and state: is a per-instance
    Signal that survives a recomposition for the same ids. Disposing a composition releases every subscription. Nothing builds tre nodes from it
    yet (phase 5).

  • ViewModel binding and a renderer (phase 5). A ViewModel lists the named views it serves in views; one instance serves every view with
    one of those names, wherever they are, so a pie chart and a list of the same rows follow one Signal. app.bind(DataViewModel) makes it once,
    when its first view opens; app.bind(instance) uses yours; app.bind(factory=DataViewModel) makes one per view instance; a view without a
    name: is not bound. app.open_view("Main") composes a view written in the new syntax and shows it with the existing builder, keeping it in
    step with its Signals (for: and if: add and remove real nodes, handlers run in the scope they were written in, a model property given a
    bare reference writes the user's edit back). ViewModel.views[name] is a handle (.node, .state, .show, .hide), self.show(new, old) swaps views, and app.check() / check_view compare every name, action and expects: entry of a view with its ViewModel
    without a window. ViewModel(view) still works.

  • Style rules (phase 6). A stylesheet may hold rules by widget, variant, size, shape, classes, name, part and state
    (tesserae.spec.rules). The most specific rule wins (a name, then the number of properties matched, then a state, then the widget alone),
    a later rule wins a tie, an app's stylesheet beats the looks a widget ships, and a node's inline style: beats every rule for the fields it
    sets. hovered, focused and pressed are Signals a rule can select on and an expression can read; disabled, selected, checked and
    expanded read the widget's own property. foreground is no longer valid on every widget: the widgets that draw text or glyphs declare it, and
    the error names them. self.show(new, old) swaps one of a ViewModel's views for another.

  • Migration (phase 7). tesserae migrate-yaml [PATH] [--write] [--force] (tesserae.migrate) moves a project to the new syntax: views and
    fragments are translated (a fragment becomes a *_View.yaml), stylesheets become rules (a component's by part, an app's by widget and
    name), a view with a *_ViewModel.py is named after it, header comments are kept, every result is checked with the app's loader and nothing
    is written unless all of it loads (--force writes what did). Python is not rewritten: the report lists what each ViewModel needs. A view in
    the old syntax still loads and says once per file how to move on. New: the guide The View Language, whose YAML
    examples are tested, and the migration table in Migrating.

  • The text field component (#184, the first of the components). widget: TextField is
    the Material text field, a view Tesserae ships with its look as rules: filled and outlined, a label that rises with focus or text, placeholder,
    leading and trailing icons, prefix and suffix, supporting text, a character counter, an error state with its message, disabled, read-only,
    multiline, and a password field with a button that shows the text. text is two-way; on_change, on_key and on_submit are events. The bare
    input is the new widget TextInput (placeholder, multiline, obscured, max_length, read_only); the old builder's kind: TextField takes
    placeholder, multiline and obscured in its text: as well, and tesserae migrate-yaml writes the old kind as widget: TextInput.
    New with it: shipped views (tesserae/views/, found after the project's, replaceable by a view of the same name), focused, focus_visible,
    error and read_only as states a rule can select, a widget's state read by its parts' rules, and the icons visibility, visibility_off and
    error.

  • More accessibility states (#210). a11y: takes expanded, selected, checked, value,
    value_min, value_max and value_step, in both syntaxes and in tesserae.a11y; every field but role and live can be bound, and null
    clears a state tre holds unset. A control still sets its own checked, selected and value.

  • Text extras (#211). max_lines, letter_spacing (and selectable on Text) are properties of
    Text and Link in the new syntax and keys of text: in the old; max_lines cuts a long text to that many lines, letter_spacing is tracking in pixels, and
    a Text with a fixed width and no height is as tall as the lines it wraps to.

  • Alpha on colours, and the full shape (#212). A colour may end in @N% to scale its alpha: primary@12%,
    on_surface@38%, "#6750A4@50%", wherever a style, a rule, a bound background/foreground/border_color or a color property takes one.
    corner_radius: full is a pill or a circle.

  • Focus control and keyboard navigation (#213). focus('name') in a handler gives the focus to a named node in the view; on_press
    is a handler for the pointer pressing a node (it does not make the node a button), so a container can focus the input inside it; focus_group: horizontal | vertical | both
    gives the focusable nodes under a node one tab stop, arrow-key, Home/End and type-ahead movement. The text field's box focuses its input when pressed.

  • Transitions (#214). style: {transition: {background: 150, scale: {duration: 300, easing: spring}}} makes a change to those
    properties ease instead of jump (opacity, colours, border, corner radius, elevation, blur and the new scale, translate_x, translate_y, rotation_deg), with Material's easings, cubic
    beziers or a spring; the first draw does not ease, an app that reduces motion gets the value at once, and a stylesheet rule can carry the transition.

  • Canvas (#215). widget: Canvas with draw:, a list of {rect: [x, y, w, h]}, {circle: [cx, cy, r]} and
    {path: [points], width: N} commands, each with a color (a role, a CSS colour or role@N%). draw: may be one {{ }} expression, so a canvas
    repaints when the Signals it reads change. It is how a widget draws wavy progress, ticks and graph edges.

  • Icons from a path (#216). widget: Icon takes path: (SVG path data) and view_box: instead of a name, so any
    glyph can be drawn and tinted like the built-in ones. tools/import_material_symbols.py DIR turns a folder of Material Symbols SVGs into
    src/tesserae/icon_data/material_symbols.json, which tesserae.icons merges under the icons built in. The 18 built-in names are unchanged; no Symbols are bundled yet (see the issue).

  • Material Design Icons (#216). 147 icons from Pictogra...

Read more

Tesserae 0.4.6

Choose a tag to compare

@mindderivative mindderivative released this 08 Oct 04:24

The removal stubs are removed (#113).

Removed

  • The messages for the names 0.4.5 removed: tesserae._removed (RemovedError), tesserae.shell, and the use_shell, load_shell
    and decorations members of App that only raised them, the --shell argument of tesserae new, and the _Shell.yaml check in
    App.load. An old name now fails as any unknown name does (TypeError, AttributeError, ModuleNotFoundError, "unrecognized
    arguments"); Migrating says what replaced each. Nothing that works changes.

Added

  • tests/test_no_shell_left.py keeps the shell file, AppShell and decorations out of the code, the examples, the tools and the
    workflows.