Commit Graph
1565 Commits
Author SHA1 Message Date
aiongg b46b9dd5c1 docking: a native window's bar docks it at the main window's frame edges
The window docks as its groups at a frame's edge zones, as a group drag would; a body's
center still takes no whole window. Tests for Escape during a bar drag and for the
window focused last being in front.
2026-10-23 17:31:11 +00:00
aiongg 619c93ea29 docking: document drags between OS windows 2026-10-23 17:24:25 +00:00
aiongg 84b42eacc9 docking: tabs, groups and windows drag between OS windows
The window where a drag starts owns it and writes its pointer with its desktop origin.
The window under that point shows the preview with its own targets, and the release
docks there, or floats a new window over the desktop. Leaving a window is no release
with native viewports. Dragging the only tab or group of a window moves it, and its
bar docks the whole window.
2026-10-23 17:24:25 +00:00
aiongg 141ddc92f6 docking: which window lies under a desktop point 2026-10-23 17:24:19 +00:00
aiongg 48272d3932 docking: the host stand-in needs no expect, and the label count drops with New Window 2026-10-23 16:42:36 +00:00
aiongg 0ecc7d2d39 Merge remote-tracking branch 'ao/docking' into dock-windows 2026-10-23 16:42:21 +00:00
aiongg e350bfdb01 docking: the undock hint test uses contains, as clippy asks 2026-10-23 16:40:17 +00:00
aiongg e23e447f32 Merge remote-tracking branch 'ao/docking' into dock-windows 2026-10-23 16:35:58 +00:00
aiongg 53947dbfe8 docking: the undock hint test expects the platform's key 2026-10-23 16:35:35 +00:00
Federico Olivares 834044eb29 Merge origin/main into spanish-proofing
Resolve the ROADMAP.md conflict: the status line keeps both changes, and main's
revision-history row comes before the Spanish proofing one.
2026-10-23 13:20:42 -03:00
NetterSilverandClaude Haiku 5.5 1711c147cb Cap and deduplicate the .aff TRY alphabet at parse time (storytold/wordcraft#3981)
Fixes storytold/wordcraft#3654

Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-23 11:44:50 -04:00
Dylan M. Taylor f180fc0d35 Use chrono instead of hand-rolled UTC conversion (#219)
* Use chrono for UTC/calendar conversion instead of hand-rolled copies

Replaces the hand-rolled civil_from_days and Day::to_days in
crates/ai-core/src/history/report.rs with chrono, added as a workspace
dependency (std-only, so ai-core still compiles for wasm). The day/month
grouping, ISO and CSV timestamps and the Day/Month display are byte-identical
and pinned by the existing tests. AGENTS.md now says time goes through chrono.

Follow-up to storytold/cadcraft#1785

* history: preserve out-of-range conversion failure in civil_from_days

civil_from_days used `i32::try_from(..).unwrap_or(0)` before calling
NaiveDate::from_num_days_from_ce_opt, so a CE day count past i32 (e.g.
from Day::from_days(i64::MAX)) passed a valid day 0 to chrono and read
as 0000-12-31 instead of the 0000-01-01 fallback the None arm gives for
every other out-of-range date. Convert with `.ok().and_then(..)` so both
the integer-conversion and NaiveDate-construction failures share the one
fallback. Regression test covers i64::MAX and i64::MIN.

Doc comments on the chrono-touched to_days/from_days/civil_from_days now
state the out-of-range behaviour (0 / 0000-01-01) for the docstring gate.

* Convert every i32 year, not only chrono's range

Day holds any i32 year, but NaiveDate stops near ±262143, so years like
262144 read as 0 / 0000-01-01. The Gregorian calendar repeats every 400
years: chrono now converts the day within its cycle and whole cycles are
added back, in both directions. Values match the pre-chrono formula
(tested for 262144, -262145, i32::MAX and i32::MIN). Nonexistent days
still read as 0, and day counts whose year doesn't fit i32 still read as 0000-01-01.

* Name the 400-year range extension as the one exception to the time rule

The rule said never to hand-roll calendar math, but the range fix
(shifting by whole 400-year Gregorian cycles so dates past chrono's year
range keep their old output) is cycle arithmetic, so the rule and the code
disagreed. The rule now names that exception: the library still computes
month, day and time, and only whole cycles are carried in the year.

* Say the library computes month and day; time-of-day is plain arithmetic

Narrows the range-extension wording: the date library computes the
calendar fields, and splitting seconds into hours, minutes and seconds
is ordinary arithmetic, which is what the code does.
2026-10-23 11:17:51 -04:00
Dylan M. Taylor 9def84d7a5 security: fallible bitmap allocation in vendored hayro-jbig2 (#242)
* security: fallible bitmap allocation in vendored hayro-jbig2 (follow-up to #239)

* security: reinitialize allocates before mutating the jbig2 bitmap (CodeRabbit)
2026-10-23 11:16:19 -04:00
Dylan M. Taylor 35d18945a9 fix(hayro-syntax): read full /W[0] xref entry type width (#241)
* fix(hayro-syntax): read full /W[0] width for xref stream entry type (follow-up to #239)

* hayro-syntax: loader-path test for oversized /W[0]; document patch; drop committed build output (CodeRabbit)
2026-10-23 11:14:16 -04:00
Federico Olivares f4fe03610d storytold/wordcraft#3360: user dictionary and Ignore All use the composed key spelling uses
Maintainer review on storytold/wordcraft#3562: spelling looks words up composed (NFC), but
add_word, remove_word, ignore_word, custom_word (so loading the dictionary
file) and save_user_dictionary's removed list kept the raw lower-cased
spelling. A word added or ignored decomposed (`zqprue\u{301}ba`) therefore
stayed flagged.

- dictionary_key(): lower case, then composed; every write uses it, and
  in_user_dictionary() looks up composed, so either form adds, ignores,
  removes and finds the same entry; NFD entries in an existing file load
  and save composed
- English's known_core() reuses in_user_dictionary() instead of a copy of it
- issue byte ranges still cover the text as typed
- regressions: proof (add, Ignore All, remove, save/load with an NFD entry,
  both forms rechecked) and engine (review.addToDictionary and
  review.ignoreAll with the issue's NFD text)
2026-10-23 10:31:35 -03:00
Dylan M. Taylor 6cefd467fc security: bound vendored hayro xref/object-stream/JBIG2/graphics-state work and krilla PNG size (CodeRabbit) (#239)
* security: bound vendored hayro xref, object-stream, JBIG2 and graphics-state work; krilla PNG size

hayro-syntax:
- xref-stream subsections must be backed by decoded bytes: zero /W widths and counts
  longer than the data are refused before inserting (CodeRabbit CWE-400, xref.rs:962)
- object-stream offset tables are parsed once per document and cached in Data
  (CodeRabbit CWE-407, xref.rs:1079)
- embedded JBIG2 pages over 2^28 pixels are refused before allocating, with checked,
  fallible reservation (CodeRabbit CWE-789, filter/jbig2.rs:34)
- a JBIG2Globals stream with an image filter is ignored, so globals cannot recurse
  (CodeRabbit CWE-674, filter/jbig2.rs:20)

hayro-interpret:
- at most 4096 saved graphics states / 64 MiB retained; dash arrays over 256 entries stroke
  solid (CodeRabbit CWE-400, context.rs:226)

krilla:
- PNGs implying more than 1 GiB of decoded output are refused at Image::from_png and in
  the deferred decoder; the buffer is reserved fallibly (CodeRabbit CWE-789,
  graphics/image.rs:565)

SOURCE.json local hashes updated; patches recorded in vendor/README.craft-reader.md and
vendor/krilla/README.craft.md.

* vendor: fix SOURCE.json local hashes; reserve krilla's colour/alpha split buffers fallibly

- SOURCE.json: only the local sha256 changes; the source/upstream hashes of the patched
  files are restored (CodeRabbit review)
- krilla handle_u8_image/handle_u16_image reserve their split buffers with try_reserve_exact
  and return an error, so a valid image under the 1 GiB decode cap cannot abort the process
  on the second allocation (CodeRabbit review)
2026-10-23 08:39:26 -04:00
Federico Olivares 970bfcf7a8 storytold/wordcraft#3360: Spanish proofing code clean-up (no behaviour change)
- es/mod.rs: one variety() match gives the dictionary slot, log name and file
  names (variety_name() folded in); load_installed() destructures it
- es/grammar.rs: the sentence-start rule for the missing ¿/¡ is one named
  function, ends_clause(), replacing is_boundary() and three closures
  rebuilt per mark; in_address() is shared; repeated_words() builds its
  helpers once instead of per word pair
- es/suggest.rs reuses the Czech ranking's MAX_LETTERS instead of a copy

Same tests pass unchanged; a temporary old-vs-new differential proptest
(20,000+ generated inputs with URLs and punctuation) found identical output.
2026-10-23 09:19:18 -03:00
Federico Olivares ecb4638980 storytold/wordcraft#3360: decomposed accents stay in their word; URLs aren't Spanish questions
Maintainer review on storytold/wordcraft#3562:
- words() keeps combining marks with the word they follow, so a word typed
  decomposed (NFD, `tambie\u{301}n`) is one word with its own byte range;
  is_correct_in_with and suggest_in look it up composed (NFC), so it is
  checked like `también` in every language (unicode-normalization, MIT/Apache)
- the Spanish missing-¿/¡ rule skips marks in web and e-mail addresses
  (`Ver https://example.com/?`), and punctuation inside an address or a word
  (`example.com`, `https:`, `10:30`) no longer starts the sentence the
  opening mark is offered for; a mark ending an address still ends a sentence
- Spanish repeated-word check matches composed and decomposed spellings
- regressions: check_text with the Spanish fixture and NFC/NFD equivalents
  (acceptance and ranges), words() and composed(), URLs ending in /? beside
  ordinary questions

CodeRabbit review: Session::region_spanish takes the ISO 639-2 `spa` as
Spanish, so a `spa-MX` region writes es-MX documents.
2026-10-23 08:43:44 -03:00
aiongg 99f4511e6d docking: document native windows 2026-10-23 08:27:19 +00:00
aiongg 06c1fc8825 docking: DockDriver stands in for OS windows, and native window tests
with_native_host draws native windows as their own egui frames with a
desktop rect, focus, close requests and the commands they receive. Tests
cover each way into a native window, closing, stable ids, place and
monitor, restore, the bar drag, hiding and forwarded keys.
2026-10-23 08:27:19 +00:00
aiongg 799ab4e691 docking: every float opens in its own OS window
With native-windows on a backend with viewports, each floating window
whose panels allow it is native: in-window floats open over their place
in the app window, and restored windows go back to their monitor or onto
the main window's. Windows stay on top and hide while the app is
inactive. A thin bar with title and close replaces the OS title bar and
moves the window; closing the window closes its panels. Keys a native
window leaves unused come back in DockOutput::forwarded_events, and
DockArea::monitors takes the monitor list. Move Panel to New Window goes,
since every float is native.
2026-10-23 08:27:13 +00:00
aiongg 9c869166e8 docking: floating windows keep a stable id and store their monitor
Floating::id names a window across panel moves: fresh from Floating::new
and on load, unique within a loaded layout, kept by a whole window that
moves and by the receiver of a merge. Floating::monitor and monitor_size
record where a native window is; Action::SetMonitor sets them. Equality
ignores the id.
2026-10-23 08:26:56 +00:00
aiongg 4cdf3dece4 hayro-interpret: name the spot alternate helper for its space 2026-10-23 08:25:41 +00:00
aiongg fdf121325c ci: build and test craft-i18n with collate 2026-10-23 08:15:24 +00:00
aiongg 72a1dc7728 i18n: the shipped-locale collation test checks each locale's own order 2026-10-23 08:15:24 +00:00
aiongg 6ea2d2c7f2 i18n: standalone Hangul jamo are letters in search, not syllable parts 2026-10-23 08:15:24 +00:00
aiongg f0ed593d9f keymap: update Cargo.lock for the egui dev-dependency with serde 2026-10-23 08:14:06 +00:00
aiongg 135981286f keymap: a layout switch forgets what letter positions typed, and Layout::forget_letters does so on request 2026-10-23 08:03:27 +00:00
aiongg 5050d5dead Merge remote-tracking branch 'ao/craft-keymap' into keymap-layout-rule 2026-10-23 08:02:46 +00:00
aiongg 3f5f57642a Merge remote-tracking branch 'upstream/main' into keymap-layout-rule
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	README.md
2026-10-23 08:02:46 +00:00
aiongg fe4a4450f7 keymap: compile Keymap::twins_in only with the ui feature, its one user 2026-10-23 07:28:24 +00:00
aiongg bd5c21682c hayro: DeviceCMYK luminosity masks take their values from the inks
A luminosity soft mask whose group is DeviceCMYK draws the group's four process plates over the backdrop and applies 1 - min(1, 0.3c + 0.59m + 0.11y + k) (ISO 32000-2 §10.4.2.2), so K 100% hides the masked object. Spot colorants on those plates paint through their alternate space (Plate::spots_as_process).
2026-10-23 07:26:21 +00:00
aiongg 0ccb6a9304 keymap: ForeignSet is non_exhaustive and built with ForeignSet::new, with_name and with_truncated 2026-10-23 07:19:55 +00:00
aiongg 78639905f7 Merge remote-tracking branch 'ao/craft-keymap' into keymap-ui 2026-10-23 07:18:38 +00:00
aiongg 30d17273c3 Merge remote-tracking branch 'upstream/main' into keymap-ui
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	README.md
2026-10-23 07:18:38 +00:00
aiongg 01ce7162a4 docking: Floating::stack is public, and four-way handles take the pointer only
Floating::stack builds a window from groups stacked top to bottom, so an
app's own stacked layouts migrate without building the split chain. The
four-way handle no longer takes keyboard focus: it has no label or key
action, and the two dividers it joins take arrow keys.
2026-10-23 06:11:03 +00:00
aiongg 3596b2ee8c i18n: round-trip tests for Windows' equal marks, a chosen digit system and the C locale 2026-10-23 05:47:11 +00:00
aiongg b0be5d5155 Merge branch 'i18n-format' into i18n-parse-number 2026-10-23 05:47:11 +00:00
aiongg 5620df6e45 i18n: a system grouping mark equal to the decimal mark is dropped 2026-10-23 05:47:10 +00:00
aiongg cc7020654e i18n: the C locale is A4, metric and ungrouped; a chosen digit system stays in the locale 2026-10-23 05:47:10 +00:00
aiongg 1711202871 Merge branch 'i18n-region' into i18n-format 2026-10-23 05:47:10 +00:00
aiongg 1477ffff09 craft-fonts-build: warn instead of cutting to kana when subset_to gets no catalogs, and when the manifest has no interface face; watch the manifest only after reading it 2026-10-23 05:40:04 +00:00
aiongg 457da42c5f keymap: pin the workflow's toolchain and cache actions to main's commits, and keep the token out of .git/config after checkout 2026-10-23 05:28:19 +00:00
aiongg af39757fea krilla: README states that patch 09 changes every document's XMP 2026-10-23 05:22:24 +00:00
aiongg 8cda34e137 pdf: document that the print color settings return a Result 2026-10-23 05:21:53 +00:00
aiongg 7865923aec Merge upstream main into print-color 2026-10-23 05:21:53 +00:00
aiongg af6eb6ae1e Revert "keymap: leave the token out of .git/config after checkout in the keymap workflow"
This reverts commit e6b54fa8aa.
2026-10-23 05:16:16 +00:00
aiongg 50f9c06aa7 Merge remote-tracking branch 'upstream/main' into docking
# Conflicts:
#	crates/ui/src/docking/surface.rs
2026-10-23 05:06:13 +00:00
aiongg a30ff6bf2f craft-fonts-build: reject faces under a non-UTF-8 path instead of embedding a lossy include_bytes! path 2026-10-23 05:05:13 +00:00
aiongg d413913b6b craft-fonts-build: bound each cmap subtable to its declared length 2026-10-23 05:05:13 +00:00