Repository navigation
Releases
Tesserae 0.6.3
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 codestemplate-unclosedandtemplate-emptyand 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 astess_ui.tel.Parts(the literals and each slot's expression text, with where that text starts in the file) andtess_ui.tel.compile_template(parts)compiles every slot withcompile_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 (Noneis 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 withlimit-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 saidgot '{{ x }}'(a name, aWindow_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 saida _Host cannot be used in text. - A
{{ }}in a Python dict is no longer an expression.App(stylesheet_spec={...})andRuleSheet.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 isHeight: <| h / 2 |>; a dict spec that must hold an expression takes thePartsthe front end makes. - The mapping the front end gives holds a slot as
Parts, not as{{ x }}.load_tdl_file,load_marked_tdlandload_marked_tdl_stylesheetreturn astrsubclass 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{{checksisinstance(value, Parts). - An unclosed or empty slot is a TDL error, as it was.
This <| has no |> on its lineandThis slot is emptycome fromtess_dlbefore TEL sees anything, sotemplate-unclosedandtemplate-emptynever reached an author.
- The step budget is each slot's. A text of three slots may take three times
- API of
tess_ui.tel:compile_template(parts, *, limits=)takes aParts(it took text and an origin and returnedNonefor text without{{);SlotandPartsare new;Template,NestedTemplateandExprkeep their methods and attributes.
Tesserae 0.6.2
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'ssrc: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_colorandtess_ui.images.decode_image. Usetess_utils.parse_colorandtess_utils.decode_image_file(path), which returns(width, height, rgba)(decode_imagereturned(rgba, width, height)).
Tesserae 0.6.1
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.yamlor.ymlname with one message: Tesserae no longer reads YAML, write the file as TDL (tesserae migrate-tdlintesserae-ui<0.6.1), see Migrating from YAML. A name that is not found says so too when aName_View.yamlis in the project. The shipped.yamltwins of Tesserae's views, stylesheets and default theme are gone, and so isTESS_UI_SHIPPED. - The converter.
tesserae migrate-yamlandtesserae migrate-tdl(and thetess_ui.migrate*modules) are removed; they live on intesserae-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_viewandViewWatcher. Open a view withapp.open_view, repeat a node withFor, and show a view in a dialog with a modalOverlayin a view (the table in Migrating). A per-screenstylesheet=onloadis gone with it;App(stylesheet=)is the app's stylesheet. - The
*_Component.yamland*_Style.yamlfile kinds. A project no longer has aComponents/folder of fragments,component:andinclude:do not read a project's files, and a rule'sstyle:cannot name a*_Style.yamlfile. 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), andtess_ui.expris 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 ownget(it needs a key; writed), andn.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() + 1works; 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 aSet(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 noallowed:list, onlydid you mean) and everyExprErrorhas TEL'scode(unknown-name,call-not-function,method-not-available,bad-call,limit-range, ...). See Migrating. - The engine is
tesserae-engine0.6.8 (was 0.6.7), the release the whole suite was run on. pyyamlis no longer a dependency. The Python widget factories read no YAML. A project that read YAML itself installspyyamlon 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 fromButton,IconButton,Fab,Card,ListItem,Chip,Badge,Divider,Accordion,TreeNode,DatePickerDay,PeriodSelector,SearchBar,Toolbar,TopAppBar,StatusBarandMenuItem, 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 idsnameandname.part; what changed is listed in Migrating. The shipped views gained what the factories need:CardandToolbartakeBare(only the surface, for nodes a Python widget adds itself),BadgetakesFlat(the root is the mark),SearchBartakesTrailing_Icons(a list) and shows no leading icon whenleading_iconis empty, and aStatusBar's notes are keyed by their position, not their text. - Python 3.14 is the minimum, and
tesserae-dlis a dependency (it was an optional extra): TDL is read bytess_dl, which needs 3.14.
Tesserae 0.6.0.1
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 anya11y:value with{{for a binding to wire: a label such as a tree row'sBar {{ 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).lowernow marks the nodea11y_literal: trueand the view reads itsa11y: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: focusedorstate: focus_visibleon a view whose root holds an anchoredOverlay(ColourPicker,Menu) wrote thefocusedstate again while that state was still notifying, when closing the layer moved the focus back to the trigger; the engine loggedwas written to again while still notifyingand the write was lost. A state written during its own notification is now applied on the next turn. -
A text input whose
textis 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 afterHomelanded 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
lowermade 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, andView.reconcile, the image extraction and the expansion ofWindow/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 withdescribedby/controlsare lowered again every time. -
The Configuration Application is checked against the real
tesserae-shell checkandschema(T-056).apps/shell_config/tests/test_shell_config_real_check.py(markerreal_shell_check, on when the shell's checkout and a venv of its own withtesserae-shellfrom 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/Ifedits, 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 itsChildren { }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;requiredsets of alternatives are read (PanelgetsWidthandHeight, anSVGitsIcon); a newRuleselects.new_rule, not a word that is no block; a type default in aStylehas no required keys; a surface's style keys andShadowsgo in itsStyle { }; 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 aTooltipis 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 oneSelector: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; aPopupnamed like a default popup shows that popup's values; the Add list offers the user's own modules (theParamsof every file underModules/, read withtess_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 atrashfolder 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, andIfandForrows in the tree are named without braces (the toolkit takes a{{in ana11y:label for a binding and drops it); a folder of more than 12 files opens its Files tree with one group open. Toolkit:View.reconcilebuilds 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, isguide/shell-config.md. -
The Shell Configuration App, check, the Problems list, saving and the file watch (T-036, phase C4):
tesserae-shell check --jsonruns 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 andfile: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 showsstatus --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). -
KeyChordFieldwrites media and hardware keys by their X names without theXF86prefix (T-036, phase C4):AudioRaiseVolume,AudioLowerVolume,AudioMute,AudioMicMute,AudioPlay,AudioPause,AudioStop,AudioNext,AudioPrev,MonBrightnessUpandMonBrightnessDown. Recording one of those keys writes the name (the engine'saudio_volume_up,media_track_next, ... are read), and typed text takes theXF86form too and is written back canonically (tess_ui.key_chords). -
The Shell Configuration App edits an
Ifand aFor(T-036, phase C4, part 0): selecting one shows its condition, or its variable, list and key, as editable rows written throughtess_dl'swith_condition,with_items,with_keyandwith_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 (thepopupssection 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 bytess_dl.format_block, aNameis the type and a number no block of the file has), Remove, Move up and down (past the next block,IforFor), Move to (a list of the blocks the schema lets hold it, the keyboard's way to another parent) and Duplicate (the copy'sNamebecomesName_Copy,Name_Copy_2, so names stay unique). Each is onetess_dledit, 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 edittess_dlrefuses (a block inside anIforFor) says so in the status line. The model keeps the selection as a place counted in blocks,Ifs andFors only, since an edit can take a comment away with a block; a copied or moved multi-line block is dedented beforeBlock.with_childindents 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:
iconis theIconPicker(over the built-in icons and the configuration folder'sIcons/folder when it has one, found through the toolkit's file system),fonttheFontList,key_chordtheKeyChordField(writtenCtrl+Alt+Shift+Meta+Key; text that is not a chord is refused), andlisttheListEditorwith the schema's item kind (text, name, number or whole with the key's range, bool, enum with its choices, colour), itslength,uniqueandone_or_list; a list whose item kind has no row says why and stays a TDL field. The token button is the shippedTokenButton(the tokens of the groups the key accepts,preferred_tokensfirst, 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,blockandtooltip. -
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...
Tesserae 0.6.0
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
tesseraeistess_uiandtreistess_re, and nothing is left under the old names.from tesserae import Appisfrom tess_ui import App;import treisimport tess_re; after the upgrade the old names are aModuleNotFoundError. The environment variables follow (TESSERAE_*isTESS_UI_*, the engine'sTRE_*isTESS_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-engine0.6.0, one exact release (it was 0.5.8). A project that imports the engine itself changestretotess_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, andtesserae new,tesserae add screenandtesserae migrate-yamlwrite it. A file you wrote that saystesserae: 0.5is refused withwritten 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 to0.6, and changes nothing else in the file (a comment after the value, Windows line ends and a byte order mark stay).tesserae migrate-yamlalone reports what it would move, and--writemoves 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). Withtesserae-engine0.5.9 and later (found on 0.6.0), the keep-alive callback that queues itself again keptrun()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 behindTESS_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 withthread_handle().call_soonhas 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), thetesseraecommand andpython -m tess_ui, the.tesserae/foldertesserae schema --projectwrites to, and the repositorymindderivative/tess-ui.
Known
- A callback of your own that queues itself with
thread_handle().call_sooncan keeprun()from returning on macOS after the last window closes, withtesserae-engine0.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
The PyPI name is tesserae-ui again. The repository stays mindderivative/tess-ui.
Changed
- Install with
pip install tesserae-ui. The rename totess-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-engineistre). The import name (import tesserae) and thetesseraecommand are the same, and so is everything in a project.tesserae newinstallstesserae-uiinto the project's virtual environment again, and the messages that name the package saytesserae-ui:pip install tesserae-ui[build]fortesserae build, and the upgrade hint for a file written for a newer series. - If
tess-uiis installed, switch:pip uninstall tess-ui, thenpip install tesserae-ui. The two hold the sametesseraepackage, so they must not be installed together. The release that was published astess-ui(0.5.1.8) is the same code, and this repository's release workflow publishestesserae-uionly. The note in 0.5.1.8 thattesserae-uigets one more release and no more no longer holds. - Unchanged: the repository, the docs address and the editor schemas'
$idstill saytess-ui; they name the repository and its Pages site, not the package.
Tesserae 0.5.1.8
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 thetesseraecommand are the same, and so is everything in a project.tesserae newinstallstess-uiinto the project's virtual environment, and the messages that name the package say the new name:pip install tess-ui[build]fortesserae build, and the upgrade hint for a file written for a newer series. - If
tesserae-uiis installed, switch:pip uninstall tesserae-ui, thenpip install tess-ui. The two hold the sametesseraepackage, so they must not be installed together.tesserae-uigets 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 athttps://mindderivative.github.io/tess-ui/(Pages does not redirect, so the old address is gone). The editor schemas'$idis an address in the docs, sotesserae-*-schema.jsonnow namehttps://mindderivative.github.io/tess-ui/schema/...; ayaml.schemassetting 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.yamlwithstyles:used to give onlya node needs a 'widget:' (its keys are: styles); it now goes on withthis looks like a stylesheet: name it Brand_Stylesheet.yaml. A theme'sseed:,dark:,colors:,typography:orcomponents:saysa themeandBrand_Theme.yaml. Only the root of the file is judged: a nested node withstyles: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.yamlwithwidget:orseed: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 toApp(stylesheet_spec=)orcustom_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 overstyles:, 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.yamlinThemes/used to give onlyno 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 withfound 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
Brandwhen onlyViews/Brand_View.yamlexists addsfound 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=Truesearch skips (hidden folders, virtual environments,node_modulesand 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'sstyles:or a theme's fields). It must be the first line: atesserae: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 writetesserae: 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 everythingtesserae migrate-yamlwrites (the key, then the file's own comments).tools/stamp_language.py --writeputs 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_loadof a stylesheet or theme file with the key, given toApp(stylesheet_spec=),custom_theme_spec=orRuleSheet.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 theyaml.schemassetting thattesserae schema --projectprints. migrate-yamlwrites 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-engine0.5.8 (it was 0.5.7 or newer, below 0.6). A newtrerelease 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 newertreis 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: Cardwithpart: headingused 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=)orstylesheet_spec=) and a project's<View>_Stylesheet.yaml; a built-in widget has no parts, so a rule that names one forSplitterorContainersayshas 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
placementoroffsetwithout ananchoris an error at the node.style: {placement: above}used to be accepted and did nothing (the node stayed in the flow), so a forgottenanchorgave 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, orparent). The check is on the style a node ends up with, so a rule that gives onlyplacementstill works for nodes that give theanchor(and the other way round); ananchor: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 fieldcolours, 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
ScrollViewno 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 --helpsayswidget: Window, notkind: Window; the message for a theme, stylesheet or style file loaded under the wrong name no longer carries a milestone tag.
Docu...
Tesserae 0.5.1
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) andfit-content;left,top,right,bottomandinsetplace an absolute node against the edges of its parent;anchor,placementandoffsetplace 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 labelledCheckbox,RadioButtonorSwitchis placed as a whole row; aListItem's divider is drawn.Overlaytakes the corner placements,offsetandflip. - 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 oneText(runs). - Components:
Slider(Expressive sizes, vertical, an inset icon),RangeSliderwith 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(...)orevery(...), 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 newandtesserae add screenwrite 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 ofwidget: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
Slidermaps the pointer with the width it was laid out at;surface.dismisscloses awidget: Overlay; a borderless window no longer crashes with a stylesheet ofwidget:rules; a function name that does not exist is a load error; a mistyped colour role is named;ViewDialoggiven 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
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.expris a sandboxed evaluator (anastnode whitelist, name resolution
through a scope, limits on source size, depth, nodes, steps, ranges, sequences, exponents, integers and text) that replaces the port
oftre's binding grammar. Python's arithmetic and comparison rules apply (1 == 1.0isTrue, unary minus,None,if/else,
comprehensions, f-strings, whitelisted functions and methods), and a Signal reads as its value (countandcount.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
keepsparse_binding,evaluate,evaluate_value,HandleandBindingErrorover it, and errors now carry the position and a hint.
See Binding Expressions. -
The node model (phase 3).
tesserae.spec.widgetsis the widget registry (Propertywith type, default, choices, required and model;
@widget,declare,register_widget,decl_from_paramsfor a view'sparams:, and a JSON schema per widget in
schema/tesserae-widget-schema.json).tesserae.spec.nodes.parse_viewreads a view in the 0.5.0 syntax (widget:, optionalname:,
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.translateturns 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.Composerturns parsed views into a live tree ofInstances: 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,Slotholds 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 bykey:(kept, added, removed, reordered),if:builds and disposes as its expression changes, andstate:is a per-instance
Signalthat survives a recomposition for the same ids. Disposing a composition releases every subscription. Nothing buildstrenodes from it
yet (phase 5). -
ViewModel binding and a renderer (phase 5). A
ViewModellists the named views it serves inviews; 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 oneSignal.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:andif:add and remove real nodes, handlers run in the scope they were written in, amodelproperty 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, andapp.check()/check_viewcompare every name, action andexpects: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,partandstate
(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 inlinestyle:beats every rule for the fields it
sets.hovered,focusedandpressedare Signals a rule can select on and an expression can read;disabled,selected,checkedand
expandedread the widget's own property.foregroundis 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 bypart, an app's bywidgetand
name), a view with a*_ViewModel.pyis 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 (--forcewrites 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: TextFieldis
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.textis two-way;on_change,on_keyandon_submitare events. The bare
input is the new widgetTextInput(placeholder,multiline,obscured,max_length,read_only); the old builder'skind: TextFieldtakes
placeholder,multilineandobscuredin itstext:as well, andtesserae migrate-yamlwrites the old kind aswidget: TextInput.
New with it: shipped views (tesserae/views/, found after the project's, replaceable by a view of the same name),focused,focus_visible,
errorandread_onlyas states a rule can select, a widget's state read by its parts' rules, and the iconsvisibility,visibility_offand
error. -
More accessibility states (#210).
a11y:takesexpanded,selected,checked,value,
value_min,value_maxandvalue_step, in both syntaxes and intesserae.a11y; every field butroleandlivecan be bound, andnull
clears a state tre holds unset. A control still sets its ownchecked,selectedandvalue. -
Text extras (#211).
max_lines,letter_spacing(andselectableonText) are properties of
TextandLinkin the new syntax and keys oftext:in the old;max_linescuts a long text to that many lines,letter_spacingis tracking in pixels, and
aTextwith a fixedwidthand noheightis as tall as the lines it wraps to. -
Alpha on colours, and the
fullshape (#212). A colour may end in@N%to scale its alpha:primary@12%,
on_surface@38%,"#6750A4@50%", wherever a style, a rule, a boundbackground/foreground/border_coloror acolorproperty takes one.
corner_radius: fullis 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/Endand 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 newscale,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: Canvaswithdraw:, a list of{rect: [x, y, w, h]},{circle: [cx, cy, r]}and
{path: [points], width: N}commands, each with acolor(a role, a CSS colour orrole@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: Icontakespath:(SVG path data) andview_box:instead of a name, so any
glyph can be drawn and tinted like the built-in ones.tools/import_material_symbols.py DIRturns a folder of Material Symbols SVGs into
src/tesserae/icon_data/material_symbols.json, whichtesserae.iconsmerges 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...
Tesserae 0.4.6
The removal stubs are removed (#113).
Removed
- The messages for the names 0.4.5 removed:
tesserae._removed(RemovedError),tesserae.shell, and theuse_shell,load_shell
anddecorationsmembers ofAppthat only raised them, the--shellargument oftesserae new, and the_Shell.yamlcheck 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.pykeeps the shell file,AppShellanddecorationsout of the code, the examples, the tools and the
workflows.