import_package returned an empty folder for a bare "walk.xfl", which
same_file can't resolve, so reopening it imported the package a second
time. It now returns ".", which Import::of and the tab lookup both resolve.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups (ADR 0009 note):
* A bare relative "walk.xfl" has an empty package folder: it resolves as
".", so Save suggests an .anicraft beside the folder, not inside it.
* When the opened path has no name of its own ("walk/sub/.."), the tab and
window title use the package folder's name instead of "Untitled".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A block that keeps needing a fallback face is laid out again on every edit; asking each
listed face for each letter again opened about thirty font files a time. Measured on a
three-character block with two characters no face has: 1.0 ms a layout before, 0.09 ms after.
In a field while a movie plays, Left and Right move the caret by where text is displayed,
crossing lines by the paragraph's direction, and a selection across a change of direction is
highlighted in its separate stretches. text.create and text.edit return a note naming the
families letters were borrowed from and how many characters no installed font has; the stage
shows it in the status bar. craft-text is pinned to the craft-libs commit the app already
uses. ADR 0130, the guide, the roadmap and the parity matrix say what is done and what is
left; outside PRs #39 and #40 are credited.
Layout resolves embedding levels with craft-text's bidi module (UAX #9), shapes each run in
stretches of one direction and one script, finds lines in reading order on shaped clusters
and then puts each line in the order it is displayed. A cluster its run's face has no glyph
for is shaped again, whole, in the first fallback face that has all of it: the listed
families first, then any installed face. Carets carry each cluster's box and the paragraph's
direction.
Rebuilds outside PRs #39 and #40 (SoldierPePe) on the styled-text layout of ADR 0085: lines
in reading order and never inside a cluster, the fallback family list, a cluster moving whole
with its marks, invisible format characters not counted as missing.
Tests run on fonts made in memory, so they are the same on every computer.
Both were written against the single-style layout that lived in crates/text/src/lib.rs
before ADR 0085 moved layout to styled runs in rich.rs, so their changes to lib.rs,
cmds_text.rs and the roadmap conflict and are resolved to main's side here. The commits
that follow rebuild the same behaviour on the styled-text layout and carry over their
ideas and tests: line breaks found in reading order and never inside a cluster, a face
chosen per cluster with its marks, invisible format characters not counted as missing,
the fallback family list, and the note that says which characters show as boxes.
Kept from the merge as it is: the ADR 0012 paragraph and the unicode-bidi entry, which
the next commit replaces with craft-text's bidi module.
Review follow-ups (ADR 0009 note):
* A package reached through "." or ".." is resolved before its name and
Save suggestion are taken, so the suggestion lands beside the folder,
not inside it as animation.anicraft.
* Only a regular file named *.xfl stands for the XFL folder around it; a
folder named inner.xfl is a package of its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups on the import name (ADR 0009 note):
* Session::imported is an `Import` {source, package, save_as}, fixed at
import time: removing an XFL package's DOMDocument.xml afterwards no
longer moves the Save suggestion inside the folder.
* Duplicate-tab lookup compares packages (`import_package`), so an XFL
folder and the .xfl in it are one document and share a tab.
* In a browser an import isn't matched by path: an upload is known only by
its name, and two different files may share one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main already fixed the picture cache race and split the command fuzz (#525), so this keeps
main's versions of both; what remains here is the longer thread deadlines in tests.