Commit Graph
267 Commits
Author SHA1 Message Date
William Dunn bfe246b5b4 craft-ui: leave the menu module ungated, as main has it
This branch gated `pub mod menu;` behind the esign feature, which was right when main had no menu module of its own. #160 landed one, and its cloud pages use it (crates/ui/src/cloud/pages.rs, cloud/title.rs). The gate therefore broke every build with cloud on and esign off, which is what the workspace clippy leg does. The gate was the whole remaining content of the commit that carried the helper across.
2026-11-17 21:04:35 -05:00
William Dunn a64ad59593 craft-esign make the outstanding-send regression test actually outstanding
The send helper submitted the create immediately, consuming the captured context before the status request ran. The test now queues and takes document A's send without submitting it, leaving the context pending. That pending context is the scenario the guard exists for.
2026-11-17 21:03:40 -05:00
William Dunn 52d874ae96 craft-esign keep the send context off status requests
submit_request consumed the captured send context for every request kind. A status refresh for the current document submitted while another document's send was still outstanding then carried the old context. pump dropped its reply as stale. The context now goes only to the create submission that answers the taken send request. Every other request uses the current context.
2026-11-17 21:03:40 -05:00
William Dunn df8f35d297 craft-esign apply rustfmt to the refresh caption test
Wraps a line fmt would otherwise reject on the next check.
2026-11-17 21:03:40 -05:00
William Dunn 9e70a85182 craft-esign fix status routing, relink, role reuse, close and i18n gaps
A public submit_request call carrying Request::Status never registered
status_seq. Its own reply then failed the supersession guard. The dialog
kept showing an envelope's old state. submit_request now records
status_seq for a Status submission the same way status_panel's own button
already does.

Once available() turns true it never asks again. A backend whose linked
value changes after an out-of-band sign-in stayed stuck showing the
sign-in message. A new reset_capabilities method reprobes the current
backend. It reuses the same reset set_backend already performs.

Recipient roles were derived from the current recipient count. Add two
recipients, remove the first, then add a third: the third gets the
second's exact role. A placement keyed to a removed recipient's role
could then bind to whichever recipient later receives that reused label.
Roles now come from a counter that only climbs. A recipient removal also
drops any placement keyed to a role no recipient holds anymore.

Both Close buttons set self.open to false inside the window's content
closure. show() then overwrote it with the window's own unchanged open
binding, undoing the click. show() now requires both to agree the dialog
stays open.

The manual status refresh button showed the English "Refresh status"
caption regardless of the labels a host supplied. EsignLabels gained a
refresh field for it.

Each fix adds a test that fails without it.
2026-11-17 21:03:40 -05:00
William Dunn 4e007a5fb0 craft-esign add the missing regression test for the capabilities race
The is_caps_reply guard from the earlier commit had no test of its own. A
reply from a replaced backend now provably cannot overwrite the new
backend's capabilities, responsible party or linked state.
2026-11-17 21:03:40 -05:00
William Dunn 5c44349a89 craft-esign apply rustfmt to the new tests
Wraps a few lines fmt would otherwise reject on the next check.
2026-11-17 21:03:40 -05:00
William Dunn 820aa7b32c craft-esign clear the texture delta the sign-in message test's frame leaves
run_ui's FullOutput carries textures_delta. egui panics on drop when a test
never applies or clears it.
2026-11-17 21:03:40 -05:00
William Dunn b0b5c2bf17 craft-esign close context, idempotency and busy-ownership gaps in the dialog
A reply from a replaced backend could overwrite capabilities for the new
one. A reply for an older document revision could install under a reopened
dialog. A send request taken before a reopen could tag its reply with the
wrong context. A duplicate answer from a backend holding a second Replier
could reinstall state the dialog had already moved past. A superseded
status refresh could overwrite a newer one. A failed lookup could clear
busy for a create that was still running.

Placements and the draft idempotency key could also survive a document
change or a field edit that should have invalidated them. A contact with no
email address could become a recipient using its share id as the address.
Two dialog instances could mint the same idempotency key for the same
document. An unlinked account showed a disabled Send button with no
explanation.

The context model now carries the document revision and an opening counter
alongside the document id and account. Pending-send context is captured at
queue time and consumed by the eventual submit or result call. A late reply
or result keeps the context it was built under. Each fix adds a test that
fails without it.
2026-11-17 21:03:40 -05:00
William Dunn 98bfed94c2 craft-esign: carry the menu helper behind the esign feature on the new egui
Main's craft-ui no longer has a standalone menu module. The esign dialog is the only consumer of the split-button helper this slice carries. The module is therefore feature-gated so the default craft-ui build matches main exactly. The three widget_info calls move from the deprecated egui::WidgetType alias to egui::Role. The current pin denies that deprecation as a warning.
2026-11-17 21:03:40 -05:00
William Dunn 81bdd0dbe8 craft-esign: context-keyed replies, context-based staleness, two completion digests
Fixes three gate items skylartaylor raised on PR #661. He reproduced them
against 0a937ef in
https://gist.github.com/skylartaylor/c1108ecf20d63c5e3183947408ddab7a.

The request-signatures dialog now tags every in-flight create, status,
completed, void and remind request with the context that issued it. That
context is the document identity plus the account identity. A reply
installs only when that context still matches the dialog's current
context. This replaces the old staleness rule. That rule keyed off a global
sequence counter that typing in the signer search also bumped. It dropped a
late create reply and left the dialog on Sending forever.

CompletedDocument now carries original_content_sha256 and
signed_content_sha256 as distinct fields, per RFC-0021's evidence guarantee
in storytold/craft-contrib#37. The crate's in-process test double computes
both from the bytes it actually holds. It applies a fake seal that changes
the signed bytes first. The two digests are never conflated.

Regression tests, all in crates/ui/src/esign/review_repro.rs unless noted:

1. review_h5_reply_for_previous_document_is_installed_after_reopen
2. review_h5_reply_for_previous_account_is_installed_after_account_switch
3. review_n1_create_reply_dropped_after_a_lookup_leaves_dialog_busy
4. completed_document_keeps_original_and_signed_digests_distinct, in crates/esign/src/lib.rs
2026-11-17 21:03:40 -05:00
William Dunn be5c6accc1 craft-esign: add the e-sign contract and craft-ui's esign feature
This carries over crates/esign and craft-ui's esign dialog from the cut-down #160 branch, with minimal workspace wiring. The esign dialog speaks only craft_cloud::Contact and craft_esign types. This also brings crates/cloud along as a dependency until PR #160 lands on main.
2026-11-17 21:03:40 -05:00
skylar taylor-barrick d93b55f7ff fix(cloud): retain conflict-copy identity through retries 2026-11-16 23:48:02 -05:00
William Dunn 658cc01501 craft-ui cloud: stop using unreachable in the conflict modal tests
clippy::unreachable is denied at the crate root with no in-tests
carve-out, unlike unwrap, expect and panic. The three let-else
fallbacks in conflict_tests.rs now panic with a message instead,
matching the pattern used everywhere else in this crate's tests.
2026-11-16 23:48:02 -05:00
William Dunn b49ac50ed5 craft-ui cloud: fix conflict modal and session identity bugs
Reload from the conflict modal now acts on the conflicted document's
uid. Save as a copy acts on that same uid too. Neither acts on the
active tab anymore. A window with more than one document open keeps
them separate.

Sign-out bumps an account generation. Sign-in bumps it too. Each
clears busy. A job's reply carries the generation it was issued
under. A reply from an older generation gets dropped. A stale session
cannot restore its account or its files over a newer one. A job that
never answers cannot refuse every save afterward. Regression tests
for both pairs of findings run through a held backend that answers
jobs on the test's own schedule.
2026-11-16 23:48:01 -05:00
William Dunn b1fce2be74 craft-ui cloud pages: move off deprecated egui aliases
The current egui pin denies the deprecated egui::WidgetType alias and egui::Id::new. The slice's pages (account, cloud, share, presence, the menu helper) move to egui::Role::Button and egui::Id::unique, the same spellings main's craft-ui already uses.
2026-11-16 23:47:59 -05:00
William Dunn 8334fd3c83 craft-cloud: cut-down contract plus ui pages 2026-11-16 23:47:58 -05:00
.CooCoo a50bf4a94c craft-ui: a combo box cut short shows its selected text in full on hover (#1207) 2026-11-16 21:37:09 -05:00
.CooCoo b554424c08 docking: a restored native window opens in the monitor's work area (#1270) 2026-11-16 21:36:37 -05:00
.CooCoo 05d5350511 craft-ui: testing gains shared input steps and a review screenshot folder (#1385) 2026-11-16 21:35:41 -05:00
.CooCoo 4cae75b53b docking: native palette windows use the X11 utility window type (#1833) 2026-11-16 21:30:43 -05:00
dotCooCoo 23b10d78fb craft-ui: unit tests that render take turns with the wgpu renderer
Each egui_kittest wgpu renderer creates its own Vulkan instance and
device. When one test uses its device while a test on another thread
creates or destroys one, the Vulkan loader now and then crashes the test
binary with SIGSEGV. The previous commit serialized the four rendering
tests in tests/visual_regression.rs; the craft-ui unit test binary has
the same pattern in two tests:
combo::tests::the_button_and_menu_look_like_eguis and
tabs::dialog::tests::selected_tab_erases_a_baseline_centered_on_its_bottom_edge.

Both now take crate::gpu_test_lock() before building their harness and
hold it until the harness is dropped. The comment on the lock in
visual_regression.rs now names the loader race instead of concurrent
rendering alone.
2026-11-13 06:05:11 -08:00
Dylan M. Taylor 47107f6601 craft-mesh: retain glTF texture and sampler inventory (#1151)
* craft-mesh: expose unreferenced glTF texture variants

* mesh: validate texture inventory image indices

* Fix PR 1151 validation and workspace checks

* Fix remaining Rust 1.95 workspace lint findings

* Fix proof workspace Clippy warning

* Fix remaining workspace Clippy findings

* Fix video all-features Clippy warning

* KRA: parse nested layers without recursion

* Preserve KRA layer limit traversal order

* Avoid expect in iterative KRA parser

* OpenRaster: parse nested stacks without recursion

* Plate tests honor optional font fixtures

* Keep bundled font index bytes unchanged

* Preserve font build license fixture bytes

* ci: allow longer workspace test matrix

* test: respect Windows Hunspell path behavior

* ci: provision keymap fonts for all-feature tests

* ci: provision PSD corpus for full workspace tests
2026-11-13 02:17:30 -05:00
638ee75115 Paint dialog tabs that join their page
* Paint dialog tabs that join their page

* Discard texture updates explicitly in headless rendering tests

* Cover centered baselines below selected dialog tabs

* Tests: use Id::unique, as main's egui requires

---------

Co-authored-by: Fluorine <joseph.anglada92@gmail.com>
Co-authored-by: Joseph Anglada Muñiz <janglada@nd-soft.com>
2026-11-12 10:37:55 -05:00
b903f08e7b Share bounded frosted backdrop composition
* Share bounded frosted backdrop composition

* Scope upload assertions to the backdrop texture

* Discard texture updates explicitly in headless rendering tests

* Correct texture ID borrowing in upload-count regression

* Bound texture sides before queuing backdrop uploads

---------

Co-authored-by: Fluorine <joseph.anglada92@gmail.com>
Co-authored-by: Joseph Anglada Muñiz <janglada@nd-soft.com>
2026-11-12 10:37:46 -05:00
6026ad570f Share shape gallery choices and procedural previews
* Share shape gallery choices and procedural previews

* Clip shape previews to their supplied rectangles

* Discard texture updates explicitly in headless rendering tests

* Honor fill colors across complete star and heart contours

* Make heart contour collection type explicit

* Use fixed-size triangle chunks in fill regression

---------

Co-authored-by: Fluorine <joseph.anglada92@gmail.com>
Co-authored-by: Joseph Anglada Muñiz <janglada@nd-soft.com>
2026-11-12 10:37:36 -05:00
ruchirguitar c4b8405d5f ui: resize iconic flyouts from their top edge and free top corner
* ui: resize iconic flyouts from their top edge and free top corner (#1094)

A flyout's top edge and its canvas-side top corner now resize it; the
column-side edge and its corners stay anchored. A top-edge resize keeps
the bottom and saves the top as `Group::flyout_offset`, its distance from
the group's icons, through the new `Action::MoveFlyoutTop`. The offset is
serde-defaulted and kept in close/restore locations, so older workspaces
align flyouts with their icons as before. Saved offsets are finite and
bounded, and placement clamps them inside the float bounds.

* ui: test flyout top drags past the minimum, short viewports and older workspaces (#1094)

* ui: give the flyout's top resize handle a 4 pt band (#1094)

A one-pixel top handle was hard to grab with a real mouse. Frames
whose contents supply their own header can now set
`FloatingFrame::top_handle_height`; the default stays one physical
pixel. Iconic flyouts use the stock resize band's 4 pt, over the top of
the tab strip, and the strip below it still drags the group.

---------

Co-authored-by: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com>
2026-11-12 10:05:16 -05:00
Joseph Anglada 49d865dbdd Add caller-styled dialog section frames
Group related dialog and inspector settings in reusable frames with optional accessible headings.

Makes the reusable part of [WordCraft #4038](https://github.com/storytold/wordcraft/pull/4038) available to other Craft apps. Includes API documentation, integration guidance and regression coverage. Consumer adoption remains separate; applications retain their themes, localization and command adapters.

Validation on Windows: workspace formatting, strict Clippy and tests; craft-ui Clippy/tests with all features; craft-ui WASM check with all features. Upstream CI results are tracked on this PR.

Includes the shared test-portability prerequisite [#267](https://github.com/storytold/craft-libs/pull/267); the feature itself is independent of the other UI proposals.

[Integration guide](https://github.com/fluorine/craft-libs/blob/fad5c05170d43f9bdf86c6063131e28669fcb176/crates/ui/README.md).

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
  * Added customizable sections for grouping content vertically, with optional headings and configurable spacing.
  * Sections can fill the available width or use a caller-defined width, and return the result of their content callback.
* **Documentation**
  * Added usage guidance and an example for styling sections in dialogs and inspector panels.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 07:31:25 +01:00
FredAppsandFredApps dc53e98eb1 fix(ui): keep rail scrolling above the footer in short windows (#493)
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-11-10 13:57:48 +01:00
ruchirguitar bb8320f5fa ui: resize iconic flyouts from their free edges (#627)
* ui: resize iconic flyouts from their free edges (#5713)

* ui: persist independent flyout widths per group (#5713)

* ui: keep constrained flyouts resizable (#5713)

* ui: document flyout helpers for storytold/vectorcraft#5713

* ui: honor host header minimums for storytold/vectorcraft#5713

* ui: keep constrained frame axes resizable for storytold/vectorcraft#5713
2026-11-10 12:23:09 +01:00
Zinadin ZidanandClaude Opus 5.5 9f68b84897 docs(docking): a label left with a digit keeps its text, not only one with a letter (#410)
A blank name falls back to the default label only when no letter or
digit is left ("{name} 2" gives "2"); the docs and the rustdoc of
labels::named said a letter. A test pins both cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 17:59:40 +06:00
Zinadin ZidanandClaude Opus 5.5 b4bd8e6f70 docking: each move handle has one name, after what it moves (#410)
A group's drag bar and its top border band were both buttons with
move_group_label, so a screen reader heard every group twice, and every
group and column bar had the same name. The band, which only drags, is
now out of the accessibility tree and keyboard focus (unless no bar is
drawn), and a `{name}` in move_group_label or move_column_label stands
for what the handle moves: the logical label of the panel the group
shows, or the titled panels a column's groups show, joined by ", ". A
blank title leaves the placeholder out with the brackets, quotes or
separator around it. Labels without it, today's defaults included, are
used unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 12:44:01 +06:00
Dylan M. Taylor 4029f023a6 ui: check floating destinations and integrity-matched font bytes (#567)
- docking: apply_with_permissions refuses a move or open into a floating
  window for a panel that is not floatable (Move, OpenAt, MovePanel and
  group/column/window moves), and a Group placement at a floating anchor,
  which becomes a split of its frame, needs accepts_splits.
- fonts: the served-font loader keys fetched files, in-flight requests,
  failures and pending UI faces by (url, integrity), and installs bytes
  only into faces requiring the integrity they were fetched under
  (Stack::provide_fetched); the public Stack::provide is unchanged.
2026-11-03 23:05:04 -05:00
Dylan M. Taylor 2bd8f60e15 Merge pull request #367 from lehni/fix/native-bar-title
docking: a native floating window's bar shows no title, as its tab names the panel
2026-11-02 22:16:24 -05:00
KotovGGG 71e5ecf285 test(ui): verify floating frame compatibility and resize constraints 2026-11-01 12:39:28 +03:00
KotovGGG 3685bae898 fix(ui): suppress trailing drops for host-owned groups 2026-11-01 02:09:38 +03:00
KotovGGG 9a9755568f test(ui): enumerate dock edges without unreachable branches 2026-11-01 01:45:06 +03:00
KotovGGG 4f263edcdd fix(ui): omit stock body bands for host-owned dock groups 2026-11-01 01:31:53 +03:00
KotovGGG 235fffbdbe fix(ui): preserve host docking geometry and split ownership 2026-11-01 00:02:55 +03:00
KotovGGG dcd94c27e7 feat(ui): add host-owned docking surfaces and fitted resize chrome 2026-10-31 18:57:49 +03:00
Dylan M. Taylor 6a66b95cbc Enforce Rust coding standards via Clippy (#372)
* chore(lints): enforce workspace Clippy standards

Deny cognitive_complexity (threshold 30, rust:S3776), too_many_arguments and wildcard_imports workspace-wide. Existing violations are fixed in follow-up commits.

* refactor(keymap): isolate shortcut row rendering

* test(ui): cover dock command contract cases

* fix(keymap): remove unused shortcut layout state

* refactor(media): simplify container serialization tests

* docs: document workspace lint inheritance for new crates

* refactor(text): split Knuth-Plass line costing and path extraction

Brings knuth_plass under the workspace cognitive complexity limit.

* test(font-store): split lookup test by concern
2026-10-27 13:49:38 -04:00
aiongg d40c2be47d craft-ui: combo footer remeasures reset once the footer is stable (#394)
* craft-ui: combo footer remeasures reset once the footer is stable

* craft-ui: test combo footer recovery after the remeasure cap
2026-10-27 10:26:11 -04:00
aiongg 92d392cff1 craft-ui: ComboBox, egui's combo box with a menu that grows back (#387)
* craft-ui: combo boxes whose menu grows back with its contents

egui's ComboBox lays its menu out in the height it had on the previous pass,
and its scroll area takes no more than that. A filtered list that shrinks (a
search with no matches) never grows back when the search is cleared
(emilk/egui#5225, #5138). craft_ui::combo::menu offers its contents the full
height on every pass; craft_ui::combo::combo draws the combo box button
around it. The Font Manager's Language, Script and Sample menus use it.

* craft-ui: combo and menu take the close behaviour

A menu with a search field that closes itself on a pick (DesignCraft's font
menu) closes on a click outside only.

* craft-ui: ComboBox, a drop-in for egui's combo box, with header menus

craft_ui::ComboBox has egui 0.37's ComboBox builder and button (same
atoms, style classes and icon, pixel-identical in a test) with a menu that
grows back. show_ui_with_header and show_rows_with_header keep a search
field in place and scroll only the list; combo::Menu is the same menu under
a field an app draws itself. clippy.toml disallows egui::ComboBox.

The Font Manager's Language menu, the keymap dialog's combo boxes and the
print dialog's printer and duplex choices use it.

* craft-ui: combo menus keep to the room on their side, and footers

A menu is never taller than the room on the side of its field it opens on,
so an unbounded height fits on screen and scrolls. The side is settled once
the menu is measured and kept while it is open, so a menu that shrinks or
grows while typing doesn't jump to the other side of its field.

Footer forms keep a row under the scrolling list. Menu::new takes the
field's Ui for its default height and frame, and Menu::open shows the menu
under a text field that keeps the focus while typing.

* craft-ui: combo menus open by the app keep their side, and take picks

Menu::open takes &mut bool: the menu clears it when it closes (close
behavior, Escape, ui.close(), the field losing the focus to anything but
the menu), so a click on a row under a focused text field is picked.

The side settles only once the menu was shown and measured, also for
menus the app opens (Popup::open_id). A footer that changes height
remeasures the menu before it is shown. The popup frame's margins come
from the popup style; only above/below alignments are tried.

* craft-ui: a resting pointer over a combo menu doesn't keep it open

The menu counts the pointer as having moved into it only on a press or
click. A footer height change also requests a repaint, in case the
discard is denied.

* craft-ui: a footer menu opens without a second sizing pass

A footer height change no longer discards the pass or forces another
sizing pass: the menu measures again on the next pass and settles its
side then. A forced sizing pass ran a search field's focus request in a
pass where the field can't take the focus, so a footer menu opened with
the search unfocused.

* craft-ui: tests use Ui::scope_id

* craft-ui: hide the measuring pass of a footer menu, cap remeasures

The pass that measures a menu before its side is settled is laid out but
drawn fully transparent, so no frame shows a side or height the menu then
leaves. A footer that changes height on every pass remeasures twice per
open, then settles.

* craft-ui: tests satisfy clippy
2026-10-27 09:21:01 -04:00
aiongg bd97cb760c craft-ui: iconic flyouts stay open by default (#384) 2026-10-27 01:49:01 -04:00
Jürg Lehni d201bc1964 docking: a native floating window's bar shows no title, as its tab names the panel 2026-10-26 20:57:27 +01:00
aiongg 4db3dd0117 Merge commit '819fd27f002439df60c2892715bfa322b2e566ea' into docking-native-ime 2026-10-26 03:15:20 +00:00
aiongg 9d0a57ab1c Merge remote-tracking branch 'upstream/main' into lang-2-ui 2026-10-26 03:14:20 +00:00
aiongg d7b9b5618f panes: a pane dropped over a docked pane's outer or inner third docks beside it there (#357)
Dragging a pane (a docked pane's title or a floating pane) over another
pane docked at a side edge offers two dock zones: the outer third docks
it directly outside that pane, the inner third directly inside it. The
middle third is no target. The window-edge strip docks a pane outermost
on that edge. The new PaneRequest::Before(pane, before) asks the app to
move the pane to directly before another in its open list, which sets
its position on the edge; the drop preview is laid out from that order,
so it matches where the pane lands. With one slot per edge, a closable
pane dropped on an edge takes the slot.
2026-10-25 23:13:24 -04:00
aiongg 512b54355c docking: apps can draw extra tabs after a group's panel tabs (#356)
DockContent::group_extra_tabs_width and group_extra_tabs draw host tabs
right after a group's panel tabs, before the drag bar and the header.
They fit with the panel tabs as one more tab that never overflows: both
shrink widest first to min_tab_width, and in a narrower row the panel
tabs overflow while the extra tabs keep that width.
2026-10-25 23:12:14 -04:00
aiongg cd25951cd8 Merge commit 'e8b4dde5' into docking-native-ime 2026-10-26 02:22:57 +00:00