Commit Graph
167 Commits
Author SHA1 Message Date
aiongg d37d9aeff3 docking: merge floating windows, frame profile and native windows
Merge the docking-t4 track (floating title bars and stacks, frame
profile, native windows, public chrome) into the dock profile track.

Integration:
- DockStyle keeps two edge bands: `edge_band` (8) is the outer edge
  band that splits at the root; `new_dock_band` (12) is the band along
  the docked area's left and right edges that makes a new dock. One
  `seam_band` serves dock seams and floating stack seams.
- New-dock targets are offered in the dock profile rather than only in
  layouts that already have a dock.
- Window title bar drags take the dock targets: a column edge makes a
  new column, a seam or group band stacks the window's groups there,
  the new-dock band makes a dock. They still never split a frame or
  join a body centre. Tab drags check dock targets before floating
  stack and outer edge targets.
- One group_action maps column, window and group gestures to
  MoveColumn, MoveWindow and MoveGroup.
- The unused stacked_groups renderer is gone; docks and floating
  windows each draw their own stacks.
2026-10-19 05:27:17 +00:00
aiongg a842d330e0 docking: test that hidden panels map split resizes to layout paths 2026-10-19 05:22:03 +00:00
aiongg e235c4c183 docking: rustfmt and clippy for the floating and frame changes 2026-10-19 05:21:35 +00:00
aiongg 40fefd9c7b docking: floating title bars and stacks, frame profile, native windows
Floating windows:
- A title bar (TITLE 14) drags the whole window live; Escape and focus
  loss put it back. A release over a tab strip, a floating stack's band
  or seam, or the outer edge emits MoveWindow; elsewhere the window
  stays and hosts get group_drop. Double-click minimizes or expands
  every group; the close button closes every panel (CloseWindow).
- Stacked groups with a 3 pt bar between them and dividers that resize
  both neighbours (ResizeGroup). The top and bottom quarter of a group
  and the seam between two groups insert a new group there, with a line
  preview (P3, P4). The title bar occludes what lies behind it.
- The only group of a window carries the window rect when dragged by its
  bar, so floating it again keeps the window's size.

Frame profile (DockStyle::profile):
- Ctrl/Cmd held at the start of a tab drag undocks the panel (S9).
- The outer edge band splits at the root: top and bottom in both
  profiles, left and right in the frame profile (P8).
- Menu tail: Undock Panel, Close Panel Group, Undock Panel Group, Close
  Other Panels in Group and Maximize Frame (DockEvent::ToggleMaximize).

DockArea::maximized draws only the docked frame holding the panel;
other frames and floating windows do not render or take input.
DockArea::hide_panels leaves out every panel, or every panel except a
host-chosen set; protected panels stay and the layout is unchanged.

Feature native-windows: a floating window with a native rect gets its
own OS window through show_viewport_immediate when the backend does not
embed viewports, and stays in-window otherwise. Closing it emits
SetNative None, so the group returns to its in-window rect; moves and
resizes are read back as SetNative with bounded sizes and positions.
Tabs and groups do not drag between OS windows. Move Panel to New Window
is in the menu tail where native windows are available.

A floating panel whose window closed as a whole restores at its last
rect.

Behaviour follows vectorcraft floating.rs (show_set, draw_groups, track),
effectcraft dock_ui.rs (panel_window, set_panel_window, toggle_maximize)
and dock.rs (PanelWindow::sanitized), filmcraft dock_ui.rs (workspace_edge,
EDGE_BAND, maximized) and storytold/filmcraft#2118 (saved_native_rect,
bounded_inner_size).
2026-10-19 05:19:44 +00:00
aiongg 17cf8cd07b docking: public floating window chrome
docking::chrome holds the parts of a floating window that hosts other
than DockArea need, such as office task panes: FloatingFrame (opaque
frame on its own layer, anchored resize from both sides, the bottom and
both bottom corners, arrow keys on a focused handle) and TitleBar (two
grip lines or a title, an optional menu button, and a close button 10 pt
in from the right). They return responses and requested rects; the
caller turns them into its own commands.

Behaviour follows vectorcraft floating.rs (show_set: TITLE 14, grip
lines, close position).
2026-10-19 05:19:33 +00:00
aiongg c07a0debb4 docking: test dock columns, seams, column drags and RTL docks
Behaviour tests with real egui input: seam, band, column edge and new
dock drops with their line previews, tab drops, a column taking groups
anywhere, scrolling, column bar drags and their cancellation, dividers,
minimize, iconic toggles, occlusion by floating windows and the mirrored
right-to-left layout.

Behaviour follows vectorcraft crates/ui-egui/src/floating.rs tests.
2026-10-19 05:15:14 +00:00
aiongg f1a3683cc9 docking: dock profile with columns, column bars, seams and dock targets
Node::Dock renders as side docks: columns from the window edge inwards,
each with a column bar (drag, »/« button, double-click and menu toggle
iconic) above stacked groups. A split beside a dock gives the dock its
columns' width. Every column's inner edge resizes it; dividers between
open groups save both heights; minimized groups keep theirs. A column
whose groups' minimum heights do not fit scrolls.

Drops resolve dock targets before group targets: column edges (new
column), seams and the top or bottom quarter of a group body (new group),
the room under a minimized column (below its last group) and the left or
right edge of the docked area without a dock (new dock, offered once the
layout has a dock). They show a horizontal or full-height vertical line.
Floating windows and host overlays occlude them. Tab drags use the same
targets with Move. A column bar drag moves the column with a ghost and
floats its groups away from a dock; Escape, focus loss, pointer exit and
cancel_drag cancel it like a group drag.

Side::Start maps to the left edge, or the right with
DockStyle::right_to_left. New DockStyle fields: column_bar_height,
seam_band, edge_band, right_to_left and the column labels.

Behaviour follows vectorcraft crates/ui-egui/src/floating.rs (drop
geometry, column layout and scrolling) and photocraft
crates/ui-egui/src/dock.rs (group heights).
2026-10-19 05:15:14 +00:00
aiongg 954ad06d25 docking: Placement::Edge splits the layout's outer edge
A frame along one edge of the docked layout, a quarter of its size. In a
layout with docks the split wraps the part between them, so a bottom
Timeline or top bar stays inside the docks.

Behaviour follows filmcraft dock_ui.rs (workspace_edge).
2026-10-19 05:05:42 +00:00
aiongg 4bf11647ad docking: test tearing a group out of a floating stack 2026-10-19 04:56:52 +00:00
aionggandZenodeon 1b091edefb docking: drag tab groups by their drag bar and top border
Every group with a tab strip has a drag bar between its tabs and the
host's header, at least drag_bar_width wide: tabs shrink and overflow
before it narrows. The bar and the 4 pt top border move the whole group
with its order and active tab. While dragging, a ghost outline follows
the pointer and one destination preview paints on the Tooltip layer. On
release DockArea resolves the target and emits one MoveGroup: joined as
tabs, split beside a frame, or floated at the group's own size.
group_drop is filled only for releases without a target. Ctrl or Cmd
held at release always floats, for tab drags too. Escape, focus loss,
leaving the window and cancel_drag end the drag without a change. A
release over the group's own docked position is a no-op; a floating
group released over itself moves there.

Double-clicking a tab or the bar of a floating or dock-column group
minimizes it to its strip; clicking another tab expands it. The bar is
focusable; its menu (right-click, Enter or Space) and the tab menu end
with Close Tab Group, Minimize or Expand, Float Tab Group and Group
with. Floating windows paint floating_background and floating_stroke
under their groups, so they stay opaque over a transparent host. A lone
bare panel, like a lone protected one, draws no strip and no bar.

The group handles and their tests build on storytold/craft-libs#110 by
@Zenodeon.

Co-authored-by: Zenodeon <aswinmani2001@gmail.com>
2026-10-19 04:55:27 +00:00
aionggandZenodeon 9777c291c3 docking: anchored floating resize, no-op drops and the host drop hook
Floating windows resize from both side edges, the bottom edge and both
bottom corners; the opposite edges stay fixed and a resize past the
viewport waits for the pointer to come back. A release over a tab's
current slot or its own group body is a no-op instead of a float.
Insertion markers stay inside their strip. Previews paint on the
Tooltip layer, and a reorder inside the source strip shows only the
insertion line. resolve_drag lets the host own a gesture. A panel
floated from a dock uses floating_size or its limits instead of the
column height. ResizeHandle gives focus back after a pointer drag.
node_limits is a free function for the render modules. is_dragging and
tab_insertion_marker are public.

Ported from storytold/craft-libs#110 by @Zenodeon.

Co-authored-by: Zenodeon <aswinmani2001@gmail.com>
2026-10-19 04:45:52 +00:00
aionggandZenodeon 0784873c06 docking: per-panel policy on DockContent and DockArea::show_content
DockContent gains default methods for the logical label, permissions,
limits, floating size, icon, native-window permission, bare panels and a
host drop hook. show_content reads all of them from the content; the
closures passed to the older show functions override the label,
permission and limit defaults.

floating_size, resolve_drag, DropRequest and DropFeedback are ported
from storytold/craft-libs#110 by @Zenodeon.

Co-authored-by: Zenodeon <aswinmani2001@gmail.com>
2026-10-19 04:42:54 +00:00
aiongg 87ddebd73a docking: split the renderer into render modules
DockArea, DockContent, DockStyle, DockOutput and the drag state stay in
surface.rs. The Renderer moves to docking/render: the node tree, limits
and helpers in mod.rs, groups and tabs in group.rs, floating windows in
floating.rs, and drop resolution and previews in preview.rs.
2026-10-19 04:41:18 +00:00
aiongg 69a1adf699 docking: model, workspace and v1 fixture tests
Group, column and window moves, close and restore round trips, dock validation, Lock Workspace, reconcile and reset, the random action sequence over dock layouts, and one v1 fixture per app shape that must parse and write back unchanged.
2026-10-19 04:35:58 +00:00
aiongg 0ea5f8200c docking: Workspace with hidden locations, lock, reconcile and reset
Workspace<P> keeps the current layout, where hidden panels go back, the
user's saved arrangement and Lock Workspace. It reads the {layout,
hidden} files lightcraft, pdfcraft, cadcraft and soundcraft write today.
Close actions record a location per closed panel; set_visible follows
hidden anchors when a panel's own anchor is hidden too. reconcile moves
panels the app does not register now to hidden and places missing
registered panels at their default place; reset returns to the saved or
default arrangement.
2026-10-19 04:35:58 +00:00
aiongg 0ae7cddbb5 docking: docks, columns, groups and floating stacks in the layout model
Node::Dock holds columns of groups on a logical window edge (Side::Start
or Side::End). Floating windows hold a stack of groups and an optional
native rect; the v1 {panels, active, rect} shape still parses, and a
window with one plain group writes it. Placement gains Group and Column,
Target names where a group, column or window goes, and the new actions
move, close, minimize, collapse and resize groups, columns and windows
atomically. Location records group and column state so a panel closed
from a dock or floating stack restores to the same group, seam, column
or dock. Layout gains apply_all, closed_by and panel_state; Permissions
gains locked. Node, Action, Placement and DockError are non_exhaustive.

The renderer draws each floating window's groups stacked and a dock's
columns side by side until the dock and floating-stack profiles land.
2026-10-19 04:35:58 +00:00
NibrasAz7 c4b007706d Docking: hide 'Move to group' when no panel accepts the move (lightcraft#1768)
A movable panel's context menu always offered 'Move to group', even
when the layout held no other panel that accepts tabs — one open panel
showed an empty submenu. Layout gains move_targets() (the same filter
the menu applies: every other panel that accepts_tabs), the menu renders
only when it is non-empty, and a test pins the lone-panel and
protected-anchor cases.

(cherry picked from commit 671463c1af)
2026-10-19 04:17:34 +00:00
Marco Arnulfo 5ac5d26be1 Truncate dock tab labels that do not fit their tab
A tab squeezed below its natural width painted its whole label centred and only clipped it, so long names ran over the tab's edges and under its neighbours. The label is now cut with '…' inside the same padding the natural width is measured with, and a cut tab names its panel in full on hover.

(cherry picked from commit 5c28add6cf)
2026-10-19 04:17:34 +00:00
euisuh 9cbc0888ce fix(ui): end floating group drags on pointer exit
Discard a renderer-owned group gesture when its pointer disappears so a
missing outside release cannot resume dragging, while retaining touch drops.

Closes #95

Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit 9a6f159fc5)
2026-10-19 04:17:34 +00:00
prekabreki 8db84c54f1 craft-ui: a tab dragged out of the window floats where it left
On X11 (including XWayland) and Windows, the pointer leaving the window
reaches egui as PointerGone, and egui-winit then drops the button release
because it has no pointer position. finish_drag never saw the drag end:
the panel stayed in its dock with the drop outline following the pointer
until the next click inside the window.

Leaving the window now ends the drag as a drop. interact_pos still holds
the last position on that frame, and the panel floats there (clamped to
the window) instead of docking into whatever target sits at the edge.

Test: tab_dragged_out_of_the_window_floats_where_it_left. It fails without
the fix (no action at all).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit aecdf819ba)
2026-10-19 04:17:34 +00:00
Dylan M. Taylor ae2f796b67 ci: configure Dependabot for Cargo and GitHub Actions (#174)
* ci: configure Dependabot for Cargo and GitHub Actions

* ci: include read-only-contract in Cargo Dependabot coverage
2026-10-18 15:11:21 -04:00
skylar taylor-barrick 16ec4f7e69 Merge pull request #167 from benandez/feat/i18n-runtime
Add craft-i18n: shared translation runtime for the Craft apps
2026-10-18 12:44:29 -06:00
Martin BallandClaude Opus 5.5 bc9d71b27a i18n: test prints system_lang per platform for CI logs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 19:12:44 +01:00
Martin BallandClaude Opus 5.5 c36ea1bf64 i18n: review fixes (offered locales, locale-first fallback, pt plurals, scripts)
Skylar's review of 886a0b3:
1. tc/tid go locale by locale: in each locale the context or @id row,
   then the plain row, so pt-br's plain row beats pt's context row.
2. pt (and pt-* other than pt-br) uses pt-PT plural rules: 0 is plural.
3. A script subtag (sr-Latn-RS, sr_RS@latin, be_BY@latin) never picks a
   code of another script; sr-Cyrl-RS still picks sr.
4. A row defined twice is reported and the first kept, as in the checker.
5. The pseudo locale is debug-only via from_code, get marks too, and
   looked_up() lists what was looked up for an app's audit.
6. intl_pluralrules pinned to =7.0.2; plural_form_counts copied from the
   checker, plus pt.
7. I18n::new takes the app's offered codes: languages(), from_code,
   match_tag and system_lang only return those; others stay fallbacks.

Smaller: en/pseudo/repeated codes are skipped and reported,
system_lang is cached, zh-hant-hk falls back to zh-hant, rtl adds ckb,
dv, ps, sd, ug and yi.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 19:12:01 +01:00
Martin BallandClaude Opus 5.5 886a0b367f i18n: sr_RS@latin picks sr-latn; README macro and get wording
Review fixes (CodeRabbit): a glibc @latin/@cyrillic modifier becomes the
script subtag and only codes with that script are tried. sys-locale
drops the modifier, so on desktop Unix system_lang reads LANGUAGE,
LC_ALL, LC_MESSAGES and LANG raw, in its order. README: tl! qualifies
CURRENT with $crate; get follows the locale chain but never the plain
row or English.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 10:38:04 +01:00
Martin BallandClaude Opus 5.5 10592ba4fd ci(i18n): run clippy and tests for craft-i18n on all three platforms
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 10:07:11 +01:00
Martin BallandClaude Opus 5.5 841ebed58c i18n: prefer pt over pt-br, no fallback across scripts, lookup without fallback
Final review fixes: a European Portuguese locale wins over pt-br when both
are embedded; sr-latn no longer falls back to Cyrillic sr; get() looks up
one context with no plain or English fallback (key-cap names).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9fM3mv1PUyKpk5rdwUQrW
2026-10-18 09:33:21 +01:00
Martin BallandClaude Opus 5.5 c9bcc60832 i18n: README and library listing
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9fM3mv1PUyKpk5rdwUQrW
2026-10-18 09:33:21 +01:00
Martin BallandClaude Opus 5.5 6346621e91 i18n: pseudo locale
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9fM3mv1PUyKpk5rdwUQrW
2026-10-18 09:33:14 +01:00
Martin BallandClaude Opus 5.5 cfbc6a1adf i18n: languages, names and system locale matching
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9fM3mv1PUyKpk5rdwUQrW
2026-10-18 09:33:14 +01:00
Martin BallandClaude Opus 5.5 c84b14d6c2 i18n: plurals and placeholder filling
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9fM3mv1PUyKpk5rdwUQrW
2026-10-18 09:33:14 +01:00
Martin BallandClaude Opus 5.5 7b797335cb i18n: catalog parsing and lookup with fallback
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9fM3mv1PUyKpk5rdwUQrW
2026-10-18 09:33:14 +01:00
skylar taylor-barrick 82a24b006e Merge pull request #169 from skylartaylor/docpath-crate
Add craft-docpath
2026-10-17 12:00:19 -06:00
skylar taylor-barrick a92010200c test(docpath): assert Unix-shaped results only on Unix
resolve_absolute_refuses_results_that_are_not_absolute resolved links against a
document at /home/u/docs/a.doc outside its cfg!(windows) branch. On Windows that
path is rooted but has no drive, so it is not absolute, resolve_absolute refuses
the result as documented, and the unwrap panicked. The Windows arm already covers
the same three cases with a drive. Found by the new docpath CI job on its first run.
2026-10-17 11:10:18 -06:00
skylar taylor-barrick 5542a9466d ci(docpath): run clippy and tests for craft-docpath on all three platforms
The per-crate workflows name their crates with -p, so the new crate had no job
and its tests, including the Windows-only colon and stream assertions, never ran
in CI.
2026-10-17 10:20:41 -06:00
skylar taylor-barrick 04e83f095a Merge pull request #166 from storytold/fix/models-provenance-for-a-running-test
craft-ai-core: record which address a test's models came from
2026-10-17 08:50:21 -06:00
skylar taylor-barrick 559992953f craft-ai-core: record which address a test's models came from
A test is not instant and the address field stays editable while it runs,
so its answer can arrive after the address has changed. `set_models` then
recorded the models against whatever the field held by the time it
returned, filing one endpoint's models under another — the mislabelling
`models_fit` exists to prevent, reached the asynchronous way rather than
the synchronous ones already closed.

`set_models` now takes the address the test was started against and
returns whether the models were taken, so an answer that outlived its
address is dropped and the caller can say the result is out of date. The
parameter replaces the old signature rather than joining it: there was no
second legitimate caller, and leaving an address-free version beside it
would have left the racy call the shorter, easier one to reach — against
this module's rule that the rules live once so two screens cannot
disagree.

Also fixes a pre-existing mismatch found while testing this:
`from_connection` recorded the loaded address untrimmed while `prepare`
compares it trimmed, so a stored endpoint with stray whitespace dropped
its models on the first save.
2026-10-16 23:07:53 -06:00
aiongg c04cc16109 fix(docpath): colons in names are refused only on Windows 2026-10-17 04:14:51 +00:00
skylar taylor-barrick 15ed713b8f Merge pull request #69 from Jeremy8776/feat/ai-model
Model provenance across loaded and preset endpoints and repeated endpoint edits, so models from one endpoint are not relabelled as another's, and eligibility resolved in both directions: a model must accept every input the tool sends, and the tool must supply every input the model requires (new ResolveError::InputRequired).

All 18 checks pass on a40245bd, including craft-ai-core fmt, clippy -D warnings, tests and the wasm32 check on Ubuntu, Windows and macOS.

Note for callers: after a tracked endpoint change, use set_models for newly discovered models; direct assignment on fresh custom drafts and unchanged saved endpoints still works. The asynchronous in-flight probe race is separate and not addressed here.
2026-10-16 21:56:16 -06:00
aiongg 0d0e5efaac feat(docpath): add resolve_absolute
resolve_absolute refuses a result that is not absolute on the running
platform, such as a relative link in a document that has no path yet.
It is the function to call before opening a file.
2026-10-17 03:36:22 +00:00
aiongg d7772fbb39 fix(docpath): refuse colons inside path components
A stored path that starts with a URL scheme and a colon is a URL; a
colon in any other name is invalid. Only a leading drive letter keeps
its colon.
2026-10-17 03:35:36 +00:00
skylar taylor-barrick a40245bd36 craft-ai-core: track model provenance by address; require the inputs a model needs 2026-10-16 20:26:06 -06:00
skylar taylor-barrick 83bf4cb25c Merge pull request #148 from midasmatterhorn/fix/r4-cms-icc-checked
cms: bound the ICC curve count before it is multiplied, and read mluc record offsets checked
2026-10-16 10:58:04 -06:00
aiongg 12281d07fe fix(docpath): accept drive hosts, legacy escapes and colon names; refuse lookalike separators 2026-10-16 16:14:16 +00:00
aiongg ddc5012437 feat(docpath): add craft-docpath for checking paths stored in documents 2026-10-16 16:01:59 +00:00
midasmatterhorn 8b71728482 cms: the mluc record is read as one checked 12-byte slice
The eager tuple computed o + 8 even when the first read had failed,
overflowing a 32-bit usize at offsets near u32::MAX (n = 2 with
size = u32::MAX - 20 reaches it: o fits, o + 8 does not). The record is
now bounds-checked in one slice and the fields read inside it, the same
complete-record pattern the profile reader uses elsewhere.
2026-10-16 14:46:23 +03:00
Jeremy 90792958fb Merge remote-tracking branch 'upstream/main' into feat/ai-model
# Conflicts:
#	Cargo.toml
#	README.md
2026-10-15 20:07:18 +01:00
Jeremy bd175be54f craft-ai-core: rename from craft-ai-model; lapse each kind of consent on its own; keep models found at a new address
Consent expiry is now per kind of data: renewing text no longer renews an expired image permission. A connection edit keeps models found by a test at the new address, and drops only the ones saved for the old one.
2026-10-15 20:06:57 +01:00
midasmatterhorn 1db56c92d2 cms: bound the ICC curve count before it is multiplied, and read mluc record offsets checked
parse_curve computed 12 + n * 2 with n straight from the file and only
checked the 1 << 20 bound afterwards, inside the table arm — on a 32-bit
(wasm32) target, which craft-cms ships branches for, a trC curve count of
0xFFFFFFFF overflows with overflow checks on and panics before the guard
could reject it. The mluc reader computed 16 + k * size unchecked, where
wrapping reads another record's bytes as the language, length and offset
(wrong text, no error) instead of stopping.

Hoist the curve-count guard above the arithmetic and compute the record
offset with checked_mul/checked_add, breaking out when it does not fit.
This ports the app-side fix accepted as PhotoCraft #4976 / PR #5227,
which was never carried into craft-cms. On a 64-bit host both sites are
benign (the arithmetic fits), so the two new tests pass before and after
there; they bite on a 32-bit/overflow-check build, which deserves a
wasm32 CI job — craft-cms has none yet.
2026-10-15 17:58:13 +03:00
skylar taylor-barrickandskylartaylor 8f5a283161 ci: add comfortable runtime limits to unbounded jobs (#136)
Co-authored-by: skylartaylor <26588250+skylartaylor@users.noreply.github.com>
2026-10-15 05:15:52 +02:00