Skip to content

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.

Documentation

  • About a hundred statements on the pages were corrected after being run against the code. The ones a reader would have hit: views are found in Views/ and the folders the app searches, not "anywhere in the project"; a Tabs example that did not load; the repeater example needed name: main; a rule's part: that names no node does nothing (the example used a part Card does not have); Text and TextInput need a typography_role (or font_family) and, for Text, a style.foreground; hot reload does apply an edit to the app's stylesheet of widget: rules and to views opened with open_view; tesserae add screen adds bind, open_view and a route; the keyword-only arguments of the Python overlays; a window is found by its view's name; Slider accepts foreground; the exact function and method lists of an expression; what an assignment in a handler may be; the real tesserae schema --settings output; and the limits that were stale after the work of the last weeks (anchoring, insets and sums, runs, labelled controls).
  • Both tutorials say to delete the two ViewModel files that step 6 replaces.
  • New guards: tests/test_docs_examples.py checks that every part: a docs rule example names is a node of that view, and tests/test_docs_expr_lists.py that the Bindings page lists every function and method the expression language has.