Commit Graph
165 Commits
Author SHA1 Message Date
aiongg 4e965a7638 NumberCodec writes a value that rounds to zero without a sign (photocraft#15548) 2026-11-21 08:01:10 +00:00
aiongg 2126170565 Overlay placement: a context menu that fits neither side covers its anchor (photocraft#15552)
PlaceRequest gains covers_anchor. Below or above the anchor, an overlay with it
that fits on neither side but fits the bounds keeps the preferred side and its
height and slides over the anchor; only one taller than the bounds is capped.
The overlay host sets it for a layer hanging from the pointer or from the rect
a context request named, so placement's room and the first pass's content room
are the cap within the bounds, and the menu shows every row without scroll
strips. Dropdowns, menu-bar menus and submenus keep their rule.
2026-11-21 07:48:59 +00:00
aiongg fb45d473df Dock workspace: tabs closed together reopen together (photocraft#15545)
When one apply_all batch closes several tabs of a group (Close Tab Group, or a
preset that closes panels one at a time), each closed panel's Location records
the set in closed_with. Reopening any of them restores the set in group order,
each by its own record, with the requested one in front. A tab closed in a
batch of its own stays closed: the set only counts members whose records name
each other.
2026-11-21 07:42:39 +00:00
aiongg c30c9e1749 Merge remote-tracking branch 'upstream/next' into memo-stack
# Conflicts:
#	crates/layers/tests/it/main.rs
#	crates/menu/tests/it/main.rs
#	crates/ui-contract/src/testing/mod.rs
#	crates/ui-contract/tests/it/runtime/mod.rs
#	crates/ui-widgets/tests/it/menu/mod.rs
2026-11-20 20:32:36 +00:00
David Mann d7a61a8889 Snap targets can reach past their spans
A spanned target catches only a point or box overlapping its span on the
other axis since canvas-w4, which keeps a layer's edge on its page from
catching a box on another page. Photoshop-style layer edges snap a box
beside them too (side-by-side boxes align their tops), so PhotoCraft's
Move tool stopped snapping to other layers' edges.

SnapTargets::reach_past_spans() lets every target catch along its whole
line, the span only shaping the drawn smart guide. The default is
unchanged, and filtered() keeps the setting.
2026-11-20 19:45:06 +01:00
aiongg b729d8b422 Derived: a replayed view keeps the values it derived
A replay asks for no derived value, so the memo rule dropped the values of a view that replayed for a few frames
and the view's next run built them again. The record notes the slots a run asked for, as it does for layout memory,
and a replay keeps them. last_frame_derived_builds counts the builds of every pass of a frame. IconId is plain data.
2026-11-20 18:16:52 +00:00
aiongg d1386328c2 Dock on Derived: one rail-grid conversion, window ids never reused, docs
- A panel's grid is read only through DockSizes::stepped, in the dock's own sizes, so
  DockGrid::rail is converted in one place; ToolRail counts its columns in its scope's
  style (DockSizes::of_scope), and ToolRail::dock_grid is gone.
- A layout's window counter starts above every id it is built or loaded with; a dock
  area raises a workspace an undo brings back above every id it has shown
  (Workspace::raise_window_floor). A saved u64::MAX id loads without overflow.
- Floating::id and DockArea::new docs say how ids are given and why to keep one Arc.

Part of #2336.
2026-11-20 18:16:52 +00:00
aiongg 42739aaa2d Dock on Derived: tracked panel specs, workspace revisions, layout-owned window ids
- `Workspace` fields are private. `revision()` moves with every write (a clone is a
  new source); `generation()` moves only on `replace` and ends drags as the old
  revision did. A trial walks every `&mut self` method, read from the source.
- Panel specs and permissions leave `DockPanels` for `PanelSpecs`, a plain-data model
  the host keeps in a `Tracked`. `DockArea` binds `Arc<Workspace>` and derives specs,
  permissions and keys from the workspace revision, the specs revision and the lock:
  an idle pass reads no spec, read-only docks included.
- `DockGrid::rail(cells)` is sized by the dock from its own tokens.
- Floating window ids come from a counter the layout owns; `replace` gives incoming
  windows ids the replaced layout never gave out. The dock's global id counter and its
  `no-global-state` allowlist entry are gone.

Part of #2336.
2026-11-20 18:16:52 +00:00
aiongg 339570da6f Merge storytold next into memo-audit-fix
next's submenu switch (62189858af) requests a plain repaint, and its trial counts a memoized view beside the bar,
which replays while sibling submenus switch, in place of a settling Lazy region.
2026-11-20 15:33:50 +00:00
aiongg 39da1180ee Merge storytold next into memo-audit-fix
next's WordCraft port and the framework work under it (243d68e12d) take the memoized-view APIs where they meet the
branch: story values bind through StoryData::bind, value_at and pair_at (next's copy-out stories included; one held
form story still binds a copy, as its held answer is a note beside the value); next's env values (GroupLevel,
ControlPlace, RibbonLook, ScreenModeSet), IconMark and PageBandRoom derive MemoProps, and the shell entry keys the page
band's room; request_own_repaint calls become request_repaint. The collection extent next reworked (motion-owned
style context, FillHeight, ideal width by item count) moves into items_extent. The header's hosted cells join the
parts' roving group from the pass's own membership (parts_group over Cx::join_roving), as the parts' stops do. A
content-sized shell slot measures its content with the app running in it every pass. The gallery card hands the
story's output from its view's real run (StoryRun).
2026-11-20 14:58:23 +00:00
David MannandClaude Opus 5.5 16e2584365 Merge storytold next into haranishi-combined
Conflicts resolved by keeping both sides. The start screen keeps next's
Greeting layout and its move of the recent body to recent_list.rs; the
desktop Home grid aspect and card padding now reach recent_body through a
desktop_home flag. The scroll bars keep both the document chrome (arrows,
corner) and next's drag tip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 14:55:23 +01:00
aiongg bddc593180 Merge storytold next into memo-audit-fix
Memoized views stay the one change mechanism: next's settling-path additions (modifier reads as bind keys, given-edit
and keymap unsettling, settle counters) give way to the tracked inputs that cover them, and request_own_repaint calls
become request_repaint. next's command board, node facts after the node check, the guide drag out of a ruler and the
CommandStates input are taken; the trials next wrote on Lazy::settles run on memoized views. The ruler guide env value
keys a view under the canvas in every pass of a drag. The replay audit's run in the gate takes next's target selection.
2026-11-20 10:26:06 +00:00
aiongg 5ac0410a58 craft-ui: the replay audit compares geometry within 1/256 pt
A record moved by a whole pixel from positions off the float grid differs from a run at the new place by rounding
only. Shift::snapped takes a value's coordinates and floats from the run's where they lie within the tolerance, so the
journal, the rect and the output compare with == after it; egui's PassRecords::first_difference takes the same
tolerance (aiongg/egui b65cbd8d9, pinned here). Ids, counts, colours and text stay exact.
2026-11-20 09:46:25 +00:00
aiongg 07bc5387be gallery mock: the document's view is Tracked
The canvas, the Navigator and the status bar's zoom show and edit it, so they bind it by its source.
2026-11-20 07:43:21 +00:00
haranishi 3e80f5bd3a Reserve the document scrollbar corner for chrome 2026-11-20 15:46:45 +09:00
Martin BallandClaude Opus 5.5 5dda594ad1 Merge craft-libs next 3e85f5975 into the WordCraft port
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:24:38 +00:00
aiongg 3a6624df13 Brush tip outlines show only inside the canvas view, under the layers above it
A tip outline the tool host requests carries its region: the canvas's view on
the canvas's layer. The window takes the whole outline as its cursor image only
while it lies inside that region with no layer over it; otherwise the ring paints
on the canvas's layer clipped to the view, under panels, menus and dialogs, and
the window takes only its marks, as for a tip too large for an image.

photocraft#15863
2026-11-19 23:50:56 +00:00
Martin Ball 6dedbe4fe6 skeleton: merge up/next into area/ribbon-fw with conflict markers left in (land step 1) 2026-11-19 20:42:08 +00:00
Martin BallandClaude Opus 5.5 3c647f1689 fwstub-1: Shift+Delete reaches an editor with its shift (EditorInput::Delete.shift); an editor reads one frame's IME edits, texts and keys in the order they arrived (event places from the IME and key stages); trials
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 19:39:36 +00:00
haranishi d32036cb8c Add document chrome to canvas scrollbars 2026-11-20 03:07:58 +09:00
aiongg 4f697dbc70 Merge remote-tracking branch 'upstream/next' into memo-records
# Conflicts:
#	crates/ui-contract/src/runtime/commands/mod.rs
2026-11-19 17:43:02 +00:00
David Mann cce3836b0e Merge pull request #2282 from davidmann4/anchor/12732-segment-reach
Add Anchor: reach a segment within 5 points (photocraft#12732)
2026-11-19 18:24:21 +01:00
aiongg b82c10b0e9 craft-ui: replay a memoized view at a moved place
A kept run replays where its room is now: the room's position leaves the place comparison and
becomes the offset of one RecordShift, which moves egui's records, every journal entry and what
a memoized view returned. Room size, layer, layout, scale and environment stay compared.

- Place::shift_to: the move is a whole step of egui's UI rounding; a moved record holds no paint
  callback and sits on an untransformed layer; clip rects follow when the clip moved with the
  room, or when the run lay wholly inside its clip (nothing culled). Otherwise the view runs.
- Shift: journal arguments (A: Shift) and MemoView's R (R: Shift) move by the replay's shift
  inside replay::replay; rects and points move, Clip goes through the clip rule, the rest stays
  (stays!). Vec2 has no impl: a size and a move are both Vec2.
- The engaged test reads the moved rect; the scroll-view rule compares the view moved with the
  record while the clip moved with it; sizing extents compare the room's size.
- The scroll body moves its content by whole UI rounding steps, as egui places widget rects.
- Trials: a moved replay equals a run there (pass records, revealed rects, returned rect); a room
  of another size runs; a cut run moved under its clip runs and moved with its clip replays; the
  Overview's scroll runs only entering cards and the pointer's.
2026-11-19 16:16:19 +00:00
aiongg d125e4e094 craft-ui: bind_tracked! binds a whole Tracked value; Selection, OpenSet and Level are plain data 2026-11-19 15:38:39 +00:00
aiongg 460bb5de7d craft-ui: MemoView, memoized views keyed by their props
A memoized view's content is a fn and its props are its only input, so the
framework sees every input it reads. While its key (the props type, the fn's
address and the props' inputs) equals the key after its last run, it adds
that run again and returns what the run returned. Lazy and MemoView share
one runner and one settled test; a memo view ignores the two rules that infer
a change of app data (input arrived, a repaint was asked), replays a run of an
earlier pass of the same frame when nothing it read was edited after the run
started and the run asked for no discard pass, and keeps its entry through
absence up to twice the shown views per viewport.

MemoProps gains identity() (the props type with its lifetimes erased, through
the typeid crate), &mut Tracked<T> by revision and Bind by value and place.
A binding's check takes its inputs as props: check(fn) and
check_with(inputs, fn), one mechanism; a composite hands its check on through
BindMut::check_of. The preset name check (NameCheck) takes inputs the same
way, with PresetNames as a library's names. Glyph is Any + MemoProps, and an
icon keys a glyph by its type, then by its key; the caption glyph owns an
Arc<CaptionIcons>.

Facts::register is journaled, layout memory notes discard asks into the open
record, and the settle counters become MemoRun and last_pass_memo_runs. The
idle-frame trial moves onto memo views, beside count trials of the mechanism.
2026-11-19 10:04:00 +00:00
aiongg f9c149b497 craft-ui: journal entries are data, comparable by call and arguments
`runtime::journal(ctx, args, again)` notes a registration as its arguments and a capture-free `again` (a function or
a closure without captures; a capture fails to compile). Two entries are equal when they come from the same `again`
with equal arguments, and `Debug` names the call and its arguments, so a replay can be compared with a real run.

The focus `Transcript` and the records it holds (`StopRec`, `ScopeRec`, `RowGroups`, `Stop`, `Group`, `KeyUse`,
`KeyRole`) derive `PartialEq`. The journal's argument types gain `PartialEq` or `Debug` where they lacked them;
`UiTokens` compares by its content key. The docking generics that journal drop spots require `PartialEq + Debug` of
the panel type.
2026-11-19 09:44:06 +00:00
aiongg 3a815c9657 ui-contract: MemoProps, MemoKey, Stateless and the MemoProps derive
MemoProps keys every input of a memoized view. The derive builds on the
plain-data field check, with #[memo_props(hash = "reason")] for foreign
plain types and #[memo_props(stateless)] for the type parameter of a
Stateless callback, which no fn item implements MemoProps for: the shared
check takes an optional per-parameter escape beside the field escape, and
PlainData passes none. FitKeep derives Hash.
2026-11-19 08:04:49 +00:00
aiongg 08a442aeaf craft-ui: journal entries are data, comparable by call and arguments
`runtime::journal(ctx, args, again)` notes a registration as its arguments and a capture-free `again` (a function or
a closure without captures; a capture fails to compile). Two entries are equal when they come from the same `again`
with equal arguments, and `Debug` names the call and its arguments, so a replay can be compared with a real run.

The focus `Transcript` and the records it holds (`StopRec`, `ScopeRec`, `RowGroups`, `Stop`, `Group`, `KeyUse`,
`KeyRole`) derive `PartialEq`. The journal's argument types gain `PartialEq` or `Debug` where they lacked them;
`UiTokens` compares by its content key. The docking generics that journal drop spots require `PartialEq + Debug` of
the panel type.
2026-11-19 07:37:16 +00:00
Martin Ball 42bcdb68e7 fu-platform: app batch 1 rulings (S-L324, S-L239) 2026-11-18 22:39:34 +00:00
David MannandClaude Opus 5.5 7f56589f5a Add Anchor: reach a segment within 5 points
The reference application adds an anchor when a click is up to 5 px
from a segment at 100 % and adds none at 6 px. The overlay's segments
hit within a line's 4 points, so a click 4.5 or 5 points away added
nothing under Add Anchor.

craft-behavior's polyline hit shape gets its own reach
(`HitShape::polyline_within`; `polyline` keeps `LINE_REACH`), and the
overlay gives Add Anchor's segments a 5-point reach. Delete Anchor,
Direct Selection and the other tools keep a line's reach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:55:39 +01:00
Martin Ball 5ca0336a5c ribbon-w1: net change of 5 commits
- ribbon-w1: written by an agent
- ribbon-w1: finished by an agent
- ribbon-w1: finished by an agent
- ribbon-w1: review fixes (review-1b)
- ribbon-w1: review fixes (review-1c)
2026-11-18 21:02:54 +00:00
David Mann e380b20809 Merge pull request #2136 from davidmann4/fix/window-edge-drag-leaves-window
A press whose pointer left the window still drags: window edges resize when pulled out (#2132)
2026-11-18 19:54:12 +01:00
Martin Ball 62729b3af6 dialogs-w2: net change of 5 commits
- dialogs-w2: repair 1
- dialogs-w2: finished by an agent
- dialogs-w2: finished by an agent
- dialogs-w2: review fixes (review-1)
- dialogs-w2: review fixes (review-1b)
2026-11-18 18:18:25 +00:00
Martin Ball 5b9bf4c985 canvas-w4: net change of 5 commits
- canvas-w4: repair 1
- canvas-w4: finished by an agent
- canvas-w4: finished by an agent
- canvas-w4: finished by an agent
- canvas-w4: review fixes (review-1)
2026-11-18 14:03:47 +00:00
Martin Ball 3981899044 Contract stubs: phase 4 refresh (decisions S-L141..S-L152, consistency contract changes) 2026-11-18 10:20:44 +00:00
Martin Ball b21c69300c Contract stubs: craft-codepage craft-i18n craft-host craft-quit craft-theme craft-keymap craft-behavior craft-settings craft-platform 2026-11-18 08:01:14 +00:00
David Mann 13b9bf4d46 A press whose pointer left the window still drags: window edges resize when pulled out (#2132)
winit reports the pointer leaving the window while the button is held, and the
press machine marked the open press abandoned, which also stopped its drag from
starting. A window's resize grip lies inside the window and starts the OS
resize on DragStart, so pulling an edge outward left the window before slop and
the resize never started. Leaving the window now ends only the press's click.
2026-11-18 01:52:13 +01:00
David Mann 183b6b7dd5 dock: a permission for panels that dock only in dock columns (photocraft#12517)
`Permissions::docks_outside_columns` (on in `ALL`): without it a panel docks
only in dock columns or floats. Any action that leaves it in a frame of the
docked tree (a split beside the canvas, an edge of the docked area) is a
column-rights breach, so the model refuses it and a drag's dry run shows no
drop mark there. Reconcile moves a saved one out of a frame into a dock
column. A toolbar sets it so it never lies across the window.
2026-11-17 21:17:17 +01:00
aiongg af12cd1005 Merge branch 'fx/tabs' into fx/all-1117 2026-11-17 14:59:50 +00:00
aiongg f9b87ee8f1 fit test: a zero-width strip reserves no button 2026-11-17 14:48:44 +00:00
aiongg ef59f1d81d Merge branch 'fx/tabs' into fx/all-1117 2026-11-17 14:46:03 +00:00
aiongg 53ac626a31 next CI: derive Preview's Default, restore flatten_write's Cyan ink and main's craft-zip README line, gate the embedded-SVG test on tree, fix doc links
- craft-behavior: Preview<V> derives Default with #[default] Unchanged (clippy::derivable_impls on Rust 1.100).
- craft-prepress tests/flatten_write.rs: main's even-odd test needs the Cyan ink const.
- craft-svg: the embedded-SVG scene test needs the data-URL image resolver, which is behind feature tree.
- Docs: no links to private items (markdown, dwg, ui-patterns), no link to a crate that is not a dependency (frame), write() for the function (doc-binary), an autolink for the URL (update), Self::from_bytes (psd). craft-midi's source_timed and craft-pdf's cos::content keep only their inner docs, so their links resolve inside the module.
- README: main's craft-zip entry with its lenient reader sentence, lost in the 17 Nov merge.
2026-11-17 14:28:37 +00:00
aiongg bf755d4228 Panel tabs: shown tab keeps its width, others keep their first letters, labels clip 2026-11-17 14:26:15 +00:00
aiongg 98226eb219 Merge branch 'look/align' into fw/mac1 2026-11-17 08:04:37 +00:00
aiongg 5ccb18f828 A transformed box's corner near the origin holds the precision of the box's largest coordinate: a host's f32 write-back of a rotated text box no longer reads as a document change that cancels the handle drag after its first step 2026-11-17 08:02:42 +00:00
aiongg 1a55c72e1e Grid: each column is a column group, so the labels beside the fields of one column share a width and the fields start at one x 2026-11-17 07:52:46 +00:00
aiongg aef9f695dd cargo fmt 2026-11-17 07:21:19 +00:00
aiongg f42157c78b Merge branch 'fw276/check' into fw/mac1 2026-11-17 05:25:39 +00:00
aiongg ca8e645567 A cancel that restores the value counts as a write
The apply step counts every event that changes the bound value: a proposal,
commit or set, and a cancel that puts the value from before the gesture back.
A given binding unsettles on the same events, compared by the value each
lands. EditEvent::apply reports Restored only when the cancel changed the
value, so a cancel under a commit-only policy, whose place still holds the
value from before, counts as no write.
2026-11-17 05:12:37 +00:00
aiongg 4c1e445022 Merge branch 'fw276/dock' into fw276/check 2026-11-17 05:12:31 +00:00