One value per two bytes of the compressed canvas was too tight for a
public design system: a 39.5 MB canvas holding 29.7 million values got
a budget of 19.7 million (reported in #701). Real files hold 0.37 to 0.75
values per compressed byte; the budget is now one per byte, at least the
old 20 million and at most 128 million. A small file still gets main's
20 million, however far it unpacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki
`document.json` was read under the 512 MB cap for any archive member, so a
large imported document saved but didn't open again: 900 000 layers save
as a 1.48 GB document.json, packed into 244 MB. It may now unpack to 16
times its packed size (counted up to the archive's own size), within
512 MB and 4 GB; images and other members keep 512 MB. A small archive
still can't unpack into gigabytes.
That saved file reopens in 13 s with a 5.9 GB peak.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki
A real 705 MB .fig file (401 644 nodes, 894 004 layers once instances are
expanded) didn't open: "message: too many values". Lifting that cap alone
made it import only its first 200 000 layers, and lifting that one took
41 GB of memory.
The global caps stay as they are. The .fig import gets budgets from the
size of its compressed canvas instead (counted up to the file's own size),
not from the message it unpacks to, since chunks inflate up to 512 MB:
- the kiwi value budget is one value per 2 bytes of the canvas, at least
the old 20 million (kiwi is only read for .fig files);
- the layer cap is one layer per 32 bytes of the canvas, at least the REST
import's 200 000 and at most 2 000 000. A small or crafted file can't
expand its instances into millions of layers, however far it unpacks; the
REST JSON import keeps 200 000.
Memory:
- The mapper no longer passes the document through `json!`, which serialises
its arguments: the whole tree was deep-copied twice.
- Vector networks are built once per distinct network and handed to the REST
importer beside the JSON (`vectorNetworkRef`), not written into it as JSON
objects for every instance that shows them.
- Decoded kiwi objects are trimmed, and each import stage's input is dropped
as soon as the next stage is built.
On that file: peak footprint 41 GB -> 11.3 GB, 67 s -> 25 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki
- A search covers every command again (the engine's and the UI's own), grouped by
menu where one lists it and under Other otherwise, best matches first (prefix,
then shortest), at most 60. Without a query the menus' items show as before.
- Up and Down move a visible highlight (the pointer moves it too); Enter runs
the highlighted row, not an invisible first one.
- Only runs from the palette are kept as Recents; menus, shortcuts and context
menus no longer write the preferences. Recents match the translated label.
- The Plugins menu's items (run last, manage, import) show with the plugins.
- The search keeps its hint, so every catalog keeps its translation.
- The panel sits above the toolbar pill's own rect (toolbar::pill_rect); one
set_palette/toggle_palette opens it from every entry point.
- Clippy: needless borrows in the toolbar.