Commit Graph
1828 Commits
Author SHA1 Message Date
Hakan Seven 313349fd71 fix(io): verify saves through edit leases 2026-08-17 23:13:07 +03:00
Hakan Seven 04b9363666 test(plot): verify printer property commands
Use exact platform-specific command expectations.\n\nRefs #773
2026-08-17 22:29:47 +03:00
Ngo Quoc Viet 3a94c37eea fix(plot): open selected printer properties
Open the selected printer's properties on Windows and retain the printer-list fallback.

Refs #773
2026-08-17 22:26:29 +03:00
Hakan Seven ac3392d81b fix(commands): reset selection gestures
Clear held box and lasso input before a new command starts.\n\nRefs #732
2026-08-17 22:16:14 +03:00
Ngo Quoc Viet ba990d440e fix(commands): cancel pending marquee
Cancel a pending selection marquee before starting a non-transparent command.

Refs #732
2026-08-17 22:11:41 +03:00
Hakan Seven 687023391e fix(flatten): project entities through kernel
Invalidate scene caches through entity updates and reject projections
that cannot be represented without changing geometry.

Refs #728
2026-08-17 21:59:09 +03:00
Ngo Quoc Viet 69604012d6 fix(flatten): project polylines and planar faces
Add initial FLATTEN coverage for polyline families, SOLID, and 3DFACE.

Refs #728
2026-08-17 21:40:17 +03:00
Hakan Seven aab30f1b5e fix(blocks): preserve insert unit scaling
Compose unit conversion with authored transforms and attributes. Keep unit-factor display and the full INSUNITS mapping consistent.

Refs #706
2026-08-17 21:32:28 +03:00
Hakan Seven a65ba28270 Merge pull request #776 from NgoQuocViet2001/fix-unitless-block-insert-scale
fix(blocks): don't unit-scale unitless block inserts
2026-08-17 21:17:55 +03:00
NgoQuocViet2001 c88f07d219 fix(io): stop the drawing lock blocking our own reads on Windows
Saving to a path that already holds a drawing fails on Windows with
"could not verify <path> before saving: ... (os error 33)". Save As over any
existing drawing is affected; saving to a new path is not.

EditLease::acquire() opens the destination and takes the platform drawing
lock on it, then the save fingerprints the same path to check nothing changed
underneath. LockFileEx is mandatory and scoped to the handle that took it, so
that second open is refused against our own lock, lands in the non-NotFound
arm and aborts the save. flock on Unix is advisory and the second open
succeeds, so neither CI nor a Linux desktop sees it.

Read through the handle the lease already holds instead. A duplicate shares
the lock ownership, so the pre-replace re-check on the save worker can use
one too rather than re-opening the path.

The same collision reached the headless open op, which read a path this
session may hold leased: automation's save_then_open_round_trips fails on
main for that reason, one line after the save it no longer reaches.
2026-08-17 22:49:54 +07:00
Hakan Seven 0b5d4bd311 fix(mtext): honor background contrast
Preserve stored dimension fills and rotate text backgrounds with their labels.

Refs #774
2026-08-16 23:58:17 +03:00
gianlucafiore 252224f546 Merge pull request #778 from gianlucafiore/fix/annotative-mtext-leader
Fix annotative MTEXT attachment alignment
2026-08-16 16:20:45 -03:00
gianlucafiore 3603346a19 fix: keep annotative mtext anchored to insertion point 2026-08-16 16:17:04 -03:00
Hakan Seven 36e0e40b36 perf(raster): avoid needless image resampling 2026-08-16 21:22:58 +03:00
NgoQuocViet2001 319af57711 fix(blocks): don't unit-scale unitless block inserts
A unitless block has no source length to convert from, so falling back to
MEASUREMENT gave it an inches or millimetres identity it never had and
scaled the reference on insert. The properties panel reported unit_factor
1.0 for the same insert.

Skip the conversion when either the block or the drawing is unitless.

Fixes #706.
2026-08-17 00:36:49 +07:00
Karim Jerbi 32c3844526 perf(ribbon): stop building and laying out 5 panel renderings per frame
Each ribbon panel was rendered five ways every frame so CollapsePanels could
roll back to any density at layout time: full, compact, button, tight and a
full-size flyout that duplicated the full rendering.
The layout pass ran four full measure-layouts per panel even in forced modes,
and the degradation decision was an untested u8 inline in Ribbon::view.

Now the choice is a pure, unit-tested decide_levels() whose levels are a typed
Level enum (Full/Compact/Collapsed/Tight). Panel carries its four renderings
as elements: [Element; 4] indexed by Level, with a slot(i, level) helper for
the tree stride. Forced modes (Full/Compact/Collapsed) measure nothing at all
and derive the row height from the placed panel. The open flyout draws the
panel's own `full` rendering inside a self-drawn box (identical weakest-bg +
1px neutral-border to the container it replaced), so no duplicate
render_group is built per panel per frame. Level, Panel, Widths, CollapsePanels
and decide_levels are pub(crate); CollapseMode stays pub (re-exported).

Tests (collapse.rs tests module, added RED first):
- forced_modes_pin_every_panel
- auto_huge_width_keeps_everything_full
- auto_degrades_from_the_right_one_panel_at_a_time
- auto_stops_degrading_once_the_row_fits
- auto_escalates_a_single_panel_past_collapsed_to_tight
- auto_cascade_drops_every_collapsed_panel_to_tight
- auto_runs_the_compact_phase_across_the_row_first
- no_panels_stays_empty
- single_panel_walks_the_whole_ladder
- zero_widths_never_overflow
- endless_row_degrades_everything_to_tight
- unbounded_row_keeps_everything_full
- nan_budget_degrades_both_phases_but_no_tight_cascade
- exact_fit_at_full_stays_full
- matches_the_pre_refactor_algorithm: byte-equivalence sweep against the
  verbatim pre-refactor u8 algorithm (280 width/budget combos incl. the
  degenerate 0/0/inf/NaN inputs), proving the decision logic is unchanged.

Measured with the committed #[ignore]d benchmark
(`cargo test --lib --release -- --ignored --nocapture bench_ribbon_view_construction`)
run as one instrument across pre-change / this change: Ribbon::view()
construction ~676 -> ~425 us/frame (~37% of view construction saved); forced
modes run 1 layout call per panel per frame instead of 5.

Verification: cargo build clean; cargo test --lib = 382 passed (367 baseline
+ 15 new ribbon tests) / 2 known pre-existing failures unchanged
(save_then_open_round_trips, tilted_ucs_places_planar_entities_with_the_plane_normal).
2026-08-16 10:23:44 +01:00
Hakan Seven 5630f48b4e feat: improve start page links 2026-08-15 23:33:18 +03:00
Hakan Seven da3488ed00 Merge pull request #711 2026-08-15 23:11:37 +03:00
Hakan Seven 2b224d390f feat: add subreddit to start page 2026-08-15 23:11:29 +03:00
Hakan Seven 1dded7f881 fix: restore workspace verification 2026-08-15 23:11:26 +03:00
gianlucafiore 7810d2c154 fix: allow multiple stretch selection windows 2026-08-15 15:01:05 -03:00
gianlucafiore 3f989fe94c Merge pull request #771 from gianlucafiore/fix/overlapping-grips
Fix overlapping grips moving independently
2026-08-15 14:23:17 -03:00
gianlucafiore bc9e206c19 fix: move coincident grips together 2026-08-15 14:22:22 -03:00
Hakan Seven f247d15f6e feat(plugin): harden V4 host integration
Preserve legacy wire indices and route concurrent V4 responses and background requests by correlation and stable tab ID.
2026-08-15 20:17:43 +03:00
Hakan Seven 6cc1bf9755 fix(layer): centralize rename flow 2026-08-15 19:56:35 +03:00
Karim Jerbi b4da342f0e refactor(ribbon): derive the Block Palette button highlight from app state
The ribbon kept its own \show_block_palette\ copy that the app had to
manually sync at every mutation point (the BLOCKPALETTE command and the
dock Close handler). Drop the copy and thread the app's authoritative
\show_block_palette\ into \Ribbon::view\ at render time, so the button
highlight can't drift from the panel's true visibility — those two
handlers are now mutate-points only and the ribbon view is the single
place that reads the state back.
2026-08-15 14:42:08 +01:00
Karim Jerbi c3e3132b39 refactor(props): key active fields by a typed enum, not a sentinel string
The \\\x01attr\\x01…\ sentinel-prefixed string was used to tell geometry
fields (\&'static str\ names) apart from block attribute rows (runtime
tags) in \ctive_field\ and \dit_buf\. Replace it with a \FieldKey\
enum (\Geom(&'static str)\ / \Attr(String)\), so the two namespaces can't
collide by construction: \dit_buf\ is now \HashMap<FieldKey, String>\,
\ctive_field\ is \Option<FieldKey>\, and the sentinel decoding in
\ctive_key_id\ is replaced by \FieldKey::widget_id\.

While touching the key plumbing, replace \prop_field_key_for_id\'s
per-event scan of every section x prop (with a \String\ format per
candidate) with an O(1) precomputed \HashMap<iced::widget::Id, FieldKey>\
(\ield_key_by_id\), built once in \
efresh_properties\ alongside the
sections — and rebuilt after \make_sections_read_only\ so rows demoted
to read-only stop mapping. \PropSyncActive\ now does a single map lookup
per event.
2026-08-15 14:29:20 +01:00
Karim Jerbi eead4eb5f0 perf(props): skip focus sweep when the properties panel is hidden
The global left-click listener fires PropPointerPressed on every mouse
press anywhere in the app, and the handler used to launch a full
widget-tree focus sweep on each one - even when the Properties panel
was closed. Gate the sweep on dock_panel_visible(Properties): when the
panel is hidden the handler now returns Task::none, turning an O(whole
UI) traversal per click into an O(1) boolean check in the common case.

The other sweep call sites already gate via sync_active_field_if_any;
this was the only ungated one.

Tests:
- hidden_properties_panel_skips_the_focus_sweep - a click with the
  panel closed returns a Task::none (units == 0), i.e. no sweep.
- visible_properties_panel_runs_the_focus_sweep - a click with the
  panel open still fires the sweep (units > 0), preserving the
  select-whole-value behavior.
2026-08-15 13:49:26 +01:00
Karim Jerbi 41223f09d7 feat(plot): read-only rows use the shared selectable read-only field 2026-08-15 11:59:45 +01:00
Karim Jerbi 8e6b60910c feat(style): align mleader read-only field width with editable fields 2026-08-15 11:59:45 +01:00
Karim Jerbi d5b5f0781f feat(style): dim style read-only fields use the shared read-only field 2026-08-15 11:59:45 +01:00
Karim Jerbi 71d4eb96e5 feat(style): mleader style read-only rows use the shared read-only field 2026-08-15 11:59:45 +01:00
Karim Jerbi 61c3497d7f feat(text-style): read-only rows use the shared selectable read-only field 2026-08-15 11:59:45 +01:00
Karim Jerbi f2c4d389db feat(props): read-only rows use the shared selectable read-only field 2026-08-15 11:59:44 +01:00
Karim Jerbi f2b375ab24 feat(read-only): add shared selectable read-only field helper 2026-08-15 11:59:44 +01:00
Hakan Seven 37325f4d63 fix(layers): keep rename state consistent
Keep table keys, entity references, dependency caches, and current
layer handles aligned across case-only and mixed-case renames.

Refs #764
Refs #765
2026-08-15 13:22:06 +03:00
NgoQuocViet2001 9c6adedc44 fix: keep layer rename state in sync 2026-08-15 15:56:15 +07:00
Karim Jerbi fbab4c4934 feat(ribbon): Block Palette button reflects panel open state
The Insert tab's Block Palette button now behaves like the View tab toggles
(UCS Icon, View Cube, Ortho, Properties, File Tabs, Layout Tabs): it stays
highlighted while the block palette panel is open and clears when closed.

The Ribbon gains a show_block_palette flag with a set_block_palette setter,
fed into ToggleState and mapped in is_active_tool for the BLOCKPALETTE tool
id. show_block_palette on the app remains the single source of truth; both
mutation paths now mirror it onto the ribbon:

- BLOCKPALETTE / BLOCKSPALETTE command toggles ribbon state alongside the
  panel (src/app/commands/blocks.rs).
- Closing the panel via the dock rail close button clears the ribbon state,
  matching how Close(Properties) already syncs (src/app/update/dialog.rs).
2026-08-14 23:33:45 +01:00
Karim Jerbi 28e5deb222 fix(dock): don't panic clamping panel width when window is minimized 2026-08-14 23:06:53 +01:00
Karim Jerbi df940ad58e fix(dock): size drag preview by visible panels, not stack size
The drag preview divided the edge height by the raw panel count on the target
side. Closed panels keep their stack slot, so a hidden panel (e.g. the block
palette tucked away while Properties stays open) split the ghost and the drop
index as if it were rendering — leaving a half-height preview on that edge.
Size slots from the panels actually rendered on the edge instead, via a shared
visibility helper used by both the drop-index math and the ghost/edge-tint
geometry.
2026-08-14 22:24:57 +01:00
Karim Jerbi 2a0b7805c0 fix(dock): size drag preview slots by the edge viewport height
The dock drag preview computed slot heights and drop indices from the full
window height, but docked panel columns only span the model viewport, so the
preview overlay and insertion point drifted below the actual dock edge. Use the
current viewport height so the ghost and drop index line up with the panels.
2026-08-14 21:21:40 +01:00
Karim Jerbi 9f68034a60 feat(props): select whole value when a property field is clicked
Clicking an editable property value field now selects its entire value instead
of only placing the caret, so typing immediately replaces it. The click is
observed through a global left-press subscription (PropPointerPressed); a focus
sweep reports which widget took focus and PropSyncActive maps it back to the
active property row, then issues a select-all operation only when focus landed
on a different field.

The active row stays highlighted while its text input holds keyboard focus and
clears when focus moves elsewhere.
2026-08-14 21:21:40 +01:00
Karim Jerbi dceb9626ae fix(dock): block palette reflects new blocks without reopening
Creating a block from selected entities now bumps the geometry epoch, so the
block palette's per-update stale check notices the new definition and refreshes
its list in place instead of requiring the user to close and reopen the panel.
2026-08-14 21:21:40 +01:00
Karim Jerbi bd33600ee7 fix(dock): single-panel drag preview is one full-height slot
drop_index previously mapped a pointer position inside a lone full-height panel
to a top/bottom insertion split, offering an impossible drop. Clamp to the
single slot when the edge holds one panel, and cover the multi-slot mapping with
tests.
2026-08-14 21:21:40 +01:00
Karim Jerbi 94667f9512 feat(dock): active and dragging rail tab styling
Style the dock rail tab by its panel state: the expanded (active) panel's tab
gets a primary-colored highlight and border, and a tab whose panel is being
dragged gets a lighter primary tint, so the user can see which panel owns the
edge at a glance.
2026-08-14 21:21:40 +01:00
gianlucafiore f47ab7e891 fix: respect drawing units for annotative text 2026-08-14 15:38:54 -03:00
Sebastian 83d7a4d7db plugin: parallel release fetches, faster shutdown, uninstall runner stop
- Run Plugin Manager release fetches on OS threads so they execute in

  parallel instead of serialising on the async executor.

- Reduce V4Connection shutdown poll from 3s to 100ms; the runner is killed

  and reaped without blocking host shutdown.

- Add PluginManager::remove and PluginProcess::shutdown_and_wait so

  uninstall can stop the runner before deleting files, fixing Windows

  access-denied errors on plugin removal.

- Rebuild ribbon immediately after uninstall so the tab disappears.
2026-08-14 20:18:59 +02:00
Hakan Seven 26fd9a3c02 feat(i18n): add seven UI locales 2026-08-14 11:06:53 +03:00
Hakan Seven e58bef39dc fix(web): use browser-safe render timing 2026-08-13 23:57:51 +03:00
gianlucafiore 0ea5a10570 Merge pull request #759 from gianlucafiore/fix/text-double-click-edit
Fix text editing on double click
2026-08-13 17:55:44 -03:00