Commit Graph
2079 Commits
Author SHA1 Message Date
ramox81 70e6138f54 Honor drawing solid history controls 2026-08-31 15:59:16 +03:00
ramox81 e4cfd4c142 Complete cylinder workflow and history properties 2026-08-31 14:51:02 +03:00
gianlucafiore b7aed86d48 fix(ui): restore context menu actions 2026-08-31 00:22:54 -03:00
Hakan Seven 19629d1246 fix(blocks): unify block-backed content
Route pictures, table cells, leader content, symbols, and arrows through one dependency and transform graph.\n\nRefs #864
2026-08-31 01:09:32 +03:00
Hakan Seven abb4f4bf56 fix(blocks): unify nested object transforms
Route block-backed entities through one local geometry and accumulated transform path.

Refs #864
2026-08-30 23:30:14 +03:00
Hakan Seven 853e830126 fix(grips): prevent phantom snapping
Keep hidden pre-drag geometry out of snap candidates and avoid empty
scene invalidations. Require stable OTRACK dwell observations and cache
planar-solid visibility during live previews.

Refs #930
2026-08-30 22:26:47 +03:00
Hakan Seven 2a482089b8 test: fix regression assertions
Refs #941
2026-08-30 21:18:10 +03:00
Hakan Seven e136741b0f fix(automation): stabilize regression coverage
Use locale-independent assertions, kernel coordinate conversion, and safe temporary drawing cleanup.\n\nRefs #941
2026-08-30 21:04:12 +03:00
Karim Jerbi 166d758820 fix(ui): stabilize themed cache keys with static byte slices and harden tests
The themed handle cache (introduced in cc430cdb) keys entries by (address, length) of &'static [u8] art. However, the art was declared as const; Rust may inline distinct copies of a const at each use site, giving the same logical icon different addresses. This broke cache lookups for wrapper functions (e.g., themed_arrow_down) that refer to the same icon from a different module than the cache test. Convert the ~30 themed-relevant byte slices (TRI_*, HOME, UNDO, REDO, CHECK, etc.) to static so each artwork has one stable address process-wide.

Also refactor themed_handle to drop the immutable borrow before building a miss handle, preventing a reentrant call from panicking on a second borrow_mut.

Adjust themed_cache_tests to use delta assertions and per-test cache removal for isolation, and add coverage for second-call cache hits, wrapper delegation, and the length component of the key.

Test: ui::icons::themed_cache_tests::themed_cache_returns_same_handle_for_same_bytes
Test: ui::icons::themed_cache_tests::themed_cache_caches_distinct_bytes_separately
Test: ui::icons::themed_cache_tests::themed_cache_second_call_is_a_cache_hit
Test: ui::icons::themed_cache_tests::themed_wrapper_populates_cache_for_underlying_bytes
Test: ui::icons::themed_cache_tests::themed_cache_key_includes_length
Test: ui::icons::themed_cache_tests::themed_cache_speedup_over_uncached_handle_creation
2026-08-30 00:36:04 +01:00
Hakan Seven 7a523a0f44 fix(clipboard): share COPY across drawings 2026-08-29 23:12:26 +03:00
Hakan Seven 217f20d8bc fix(clipboard): preserve pasted content
Reset cross-document ownership, include non-wire and locked objects, and rebuild image caches for embedded OLE content.

Refs #934
2026-08-29 22:40:59 +03:00
Hakan Seven 4fc8446df7 feat(qselect): remember last settings
Refs #892
2026-08-29 21:18:22 +03:00
Hakan Seven 1c52a2afcf Merge remote-tracking branch 'origin/main' into HEAD 2026-08-29 15:58:18 +03:00
Hakan Seven 5062c26c88 Merge pull request #931 from schoeller/rustc_plugin_gate
feat(plugins): include rustc version in plugin compatibility gate
2026-08-29 15:55:04 +03:00
Hakan Seven 466ab99c63 fix(plugins): enforce rustc compatibility
BREAKING CHANGE: API v4+ plugin packages must declare the exact rustc version used to build the binary.

Refs #901
2026-08-29 15:54:41 +03:00
Karim Jerbi 6bf84d8f5e feat(ui): show color swatch and layer in selection cycling popup
Improve the selection-cycling list box so overlapping objects can be
identified at a glance:

- Add a color swatch per row showing the object's effective drawn color
- Show the layer name right-aligned next to the element type
- Size the popup to fit its content with consistent padding

Widen render_style_for_viewport visibility from scene-internal to
crate-wide so the view layer resolves the same color the renderer uses.
2026-08-29 12:31:03 +01:00
Karim Jerbi 452749f58c fix(ribbon): align combo panel dropdowns to a shared baseline
Style selectors (Standard, layer, Color/Linetype/Lineweight) sat at
different heights across ribbon panels because each combo panel
vertically centered its content: panels with fewer icon rows
(Multiline Text, Table) centered their dropdown differently than
panels with two rows (Dimensions, Multileader).

- Pin all combo panels (Layers, Properties, style combos) to the top
  of the fixed 3-row panel with a shared COMBO_PANEL_PAD, so every
  primary dropdown shares one baseline regardless of icon-row count
- Extract the duplicated tool-row and panel-container code into
  tool_row() / combo_panel_col() helpers + named spacing constants
- Bundle the per-view render state into RenderCtx, shrinking
  render_large/render_large_dropdown from 12-14 positional args to
  (item, &ctx)
- print_to_printer: silence the Windows-only dead-code warning on
  PrintOptions::quality with the platform split documented (the field
  is read by the CUPS `lp -o print-quality` path)
2026-08-29 11:35:06 +01:00
Hakan Seven 0237652963 style(icons): unify theme-aware palette 2026-08-29 12:20:24 +03:00
Sebastian 09ba67bfd1 feat(plugins): expose document path to plugins via HostApi
OpenCADStudio/plugins#901 (comment)

- Add HostApi::document_path(tab_id) returning Option<PathBuf>.
- Add PluginRequest::DocumentPath and PluginResponse::DocumentPath for
  out-of-process plugins.
- Implement the request in the IPC server and in both V3/V4 plugin-side
  HostApi proxies.
- Implement HostSession::document_path by looking up the tab by id and
  returning its current_path.
2026-08-29 11:09:31 +02:00
Sebastian ed3e064a47 feat(plugins): include rustc version in plugin compatibility gate
OpenCADStudio/plugins#901

- Record the host's rustc --version output in the embedded version_info.json.
- Add rustc_version/rustc_declared/rustc_compatible to plugin manifests and
  release metadata, mirroring the existing acadrust gate.
- Reject API v4+ plugins whose declared rustc differs from the host, with a
  clear one-line error message.
- Propagate the rustc gate through the marketplace, install flow, and UI.
- Update plugin architecture docs to describe the new ABI metadata.
2026-08-29 10:34:47 +02:00
Hakan Seven 3024869de0 fix(i18n): localize linetype inheritance 2026-08-29 10:10:39 +03:00
Hakan Seven 8dd3eb897b fix(properties): embed scrollbar lane 2026-08-28 21:05:26 +03:00
Hakan Seven fc93efeed7 fix(box): preserve construction semantics 2026-08-28 20:44:14 +03:00
Hakan Seven e8cb752fab fix(mesh): complete polygon mesh support 2026-08-28 20:26:32 +03:00
Hakan Seven 56bb652521 fix(face3d): repair edge editing 2026-08-28 20:14:41 +03:00
Hakan Seven 7f6e5c0405 fix(helix): repair parametric editing 2026-08-28 20:05:36 +03:00
Hakan Seven 6da2685e13 chore(properties): integrate main 2026-08-28 19:48:12 +03:00
Hakan Seven 50e5dcaaac fix(polyline): correct 3D smoothing 2026-08-28 19:46:13 +03:00
Hakan Seven a0c270c20d fix(leader): correct property behavior 2026-08-28 19:40:38 +03:00
Hakan Seven ff1f873633 fix(mleader): repair creation and editing 2026-08-28 19:36:48 +03:00
Hakan Seven c206c19759 fix(dimension): repair QDIM workflows 2026-08-28 19:19:45 +03:00
Hakan Seven d991289a56 chore(dimension): sync with main 2026-08-28 19:01:59 +03:00
Hakan Seven 0d33b1aa30 Merge pull request #893 from ramox81/codex/complete-baseline-dimension
Complete DIMBASELINE workflow and creation policy
2026-08-28 18:57:12 +03:00
Hakan Seven 38b02164e8 fix(dimension): repair continued workflows 2026-08-28 18:52:57 +03:00
ramox81 766213495d Add BOX corner and face grips 2026-08-28 16:38:29 +03:00
ramox81 27f648d2bb Align BOX properties and history controls 2026-08-28 16:36:46 +03:00
ramox81 e7eb487cd8 Complete BOX construction workflows 2026-08-28 16:32:35 +03:00
ramox81 e345d89519 Extend PEDIT for polygon meshes 2026-08-28 15:50:49 +03:00
ramox81 2c9c5d04e1 Render and edit polygon meshes 2026-08-28 15:50:49 +03:00
ramox81 22d91f8946 Add 3D mesh creation workflow 2026-08-28 15:50:49 +03:00
ramox81 b8fb6f5ddb Complete 3D face creation and editing 2026-08-28 14:35:56 +03:00
ramox81 bfb649a8bb Align helix properties and editing 2026-08-28 12:48:38 +03:00
ramox81 1c88bb96ba Create parametric helix entities 2026-08-28 12:48:33 +03:00
ramox81 1cc7d3cb67 Prevent properties scrollbar overlap 2026-08-28 11:54:37 +03:00
ramox81 3ca959a34b Fix 3D polyline behavior and properties 2026-08-28 11:21:03 +03:00
ramox81 e37491c523 Align legacy leader property behavior 2026-08-28 10:12:35 +03:00
ramox81 ef7f26be68 Align multileader property visibility 2026-08-28 09:59:23 +03:00
Karim Jerbi cc430cdbe9 perf(ui): cache svg::Handle in themed* icon functions
The 9 themed* functions that take &'static [u8] artwork each built a
fresh svg::Handle::from_memory(bytes) on every call, with 113
icons::themed call sites per frame across ribbon/statusbar/popups.
Add a thread_local THEMED_CACHE keyed by the bytes' (address, length)
and a single themed_handle(bytes) helper; the 9 themed* functions all
go through it. The 13 wrapper functions (themed_arrow_*, themed_home,
themed_undo, themed_redo, themed_check_cell, ...) delegate to those 9
and pick up the cache transparently, so all 22 themed* functions (and
the 113 call sites) are deduped.

The cache key is (address, length) -- not pointer alone -- to match the
existing SEMANTIC_CACHE belt-and-braces pattern and guard against any
future call site that passes a sub-slice of a static (e.g. &BYTES[1..]),
which would otherwise alias the wrong handle. Every include_bytes!
produces a unique static slice today, so the length is defensive.

Construction is amortised to once per artwork per process. No semantic
change; visual output is byte-identical.

Measured performance gains (integrated
themed_cache_speedup_over_uncached_handle_creation bench, 20_000
iterations each, same machine):

  |                | dev profile   | release profile |
  |----------------|---------------|-----------------|
  | Before         | 235 ns/iter   | 26 ns/iter      |
  | After (cached) |  78 ns/iter   |  9 ns/iter      |
  | Cold miss      | 900 ns        | 100 ns          |
  | Speedup        | 3.0x          | 2.9x            |

Release-mode warm path: 9 ns/iter. At 60 fps with up to 113 themed*
calls per frame, that is ~1 us/frame of handle work -- a rounding
error against a 16.6 ms frame budget. The cold-miss cost (one parse
+ one insert, 100 ns release) is the one-time price per new artwork
and is amortised to negligible per-frame overhead (it happens at
most once per artwork per process). The speedup is stable at ~3x
across dev and release because the ratio of work is the same:
hashmap-get + Handle clone vs. a full SVG parse + allocation.

test ui::icons::themed_cache_tests::themed_cache_returns_same_handle_for_same_bytes
test ui::icons::themed_cache_tests::themed_cache_caches_distinct_bytes_separately
test ui::icons::themed_cache_tests::themed_cache_speedup_over_uncached_handle_creation
2026-08-28 06:05:31 +01:00
Hakan Seven 1d58082e0a fix(dimension): repair baseline workflows 2026-08-28 08:01:44 +03:00
Karim Jerbi 4f2cf5f516 test(app): add chprop integration tests for handler dispatch and undo
Add a new #[cfg(test)] mod chprop_integration_tests to src/app/properties.rs
with four end-to-end tests that exercise the converted CHPROP / MATCHPROP
handlers through the real Message dispatcher and the CLI command driver:

- prop_color_change_multiple_entities_undo_redo: a colour change on two
  selected lines flows through Message::PropColorChanged -> the property-op
  handler -> apply_property_op, and is reversible via undo / redo. Seeds
  the panel's source_handles (selected_handles() is empty in this test
  setup) so the converted non-empty branch runs.

- prop_change_on_locked_layer_is_ignored: when a selected entity's layer
  is locked, property_target_handles filters it out and the handler's
  empty-handles branch leaves the entity itself untouched. Asserts the
  entity-level invariant only; the empty branch updates the document
  header (CECOLOR) and sets dirty as a separate, pre-existing behaviour.

- ribbon_lineweight_updates_after_change: the Home-ribbon Lineweight chip
  is updated by the converted RibbonLineweightChanged handler. Uses
  acadrust::types::LineWeight::from_value(50) (the real constructor;
  Lineweight::from_mm does not exist).

- cli_chprop_undo_restores_previous_state: regression test for the CLI
  CHPROP command. Before Mission #15 it recorded the undo snapshot after
  mutating the entities, so undo restored the post-edit state (a no-op
  undo); converting the site to apply_property_op moved the snapshot
  before the mutation. #[ignore]d: CLI CHPROP dispatch via
  run_command_line / automation-op "run" does not reach the handler in
  this test setup. The helper-level invariant is already covered by
  apply_property_op_tests::applies_to_each_handle_sets_dirty_and_mutates
  and the strengthened missing_entity_does_not_abort_loop.

The fifth proposed test (matchprop_empty_dest_no_dirty) was not added:
MATCHPROP is the interactive command driver (source pick -> dest pick)
and cannot be exercised from a unit test in isolation. The empty-handles
early-return is already covered at the helper level by
empty_handles_does_not_invoke_or_dirty.

Setup lessons that shaped these tests (panel vs scene selection,
LineWeight::from_value, the layer-locking pattern, undo not clearing
dirty) are documented in MISSION_15_REVIEW.md section 6.2.

Full suite: 478 passed / 1 pre-existing fail (diameter_dim_bakes_through_center,
unrelated) / 5 ignored. No regression. No production code changed -- the
new module is #[cfg(test)]-only.

test app::properties::chprop_integration_tests::prop_color_change_multiple_entities_undo_redo
test app::properties::chprop_integration_tests::cli_chprop_undo_restores_previous_state
test app::properties::chprop_integration_tests::prop_change_on_locked_layer_is_ignored
test app::properties::chprop_integration_tests::ribbon_lineweight_updates_after_change
2026-08-27 23:24:32 +01:00