v0.2.1 2026-09-07

Writing Faster Automations

A guide to why tab.evaluate can freeze the page it drives and how to avoid it, a worked example, and a performance pass over the panels that draw on top of the editor.

Writing Faster Automations

Everything inside tab.evaluate runs on the page's own main thread — the one the page uses for layout, paint and input. This release documents what follows from that, with a worked example, and applies the same rules to the panels Tranquil draws over the editor.

Automations

  • New guide: Performance & the Main Thread — why a working script can still freeze the page it is driving, and the four patterns that avoid it: batch your reads before your writes, do the thinking in the script rather than the page, cross the boundary as rarely as you can, and wait for conditions instead of sleeping.
  • The guide also documents a limit that was easy to trip over: tab.evaluate sends your callback to the page as source, so it cannot close over anything in your script. A helper defined outside the callback is not in scope when it runs — define it inside, or pass what it needs as an argument.

Examples

  • measure-and-place is a new example: it labels every image on a page with its rendered size. The labels are the excuse — it exists to show the measure-then-place shape any automation needs when it reads a page's layout before changing it, with the interleaved version kept alongside for contrast.
  • search-to-bookmarks no longer waits a fixed 1.5 seconds after asking for more results — it waits for the results themselves. A guessed delay is wrong in both directions: too short on a slow connection, and wasted time on every fast run.

Performance

The same rules, applied to Tranquil's own panels. Nothing here changes what they do — only how often they redraw.

  • The Automation Runs panel no longer rebuilds itself for every line a script prints. A chatty automation used to redraw the whole panel — every row in the run list, and the entire output buffer — as fast as output arrived. Output now streams in, the run list only redraws when a run actually changes, and scrolling up mid-run to read something holds its place.
  • Tree-view folder counts and hover actions no longer re-measure every row on every scroll event. Both were listening for scrolling anywhere in the workspace, not just in the tree, and re-measuring each badge immediately after moving the one before it. Scrolling a long tree is smoother, and so is dragging the dock's edge.
  • The vertical Tabs panel no longer rebuilds its whole list each time a page reports its title. Loading several browser tabs at once used to redraw the list repeatedly per tab.

Known limitations

Native builds and the in-app updater remain in private beta.


Found a bug? File it on GitHub.