format_engineering split feet from inches before rounding to DIMDEC, so a
remainder that rounds up to a full foot printed out of range: 35.999" at
two decimals read 2'-12.00" instead of 3'-0.00". A magnitude that rounded
away to zero also kept a lone minus sign.
Round on the decimal grid first and split afterwards, matching the carry
handling already used by format_architectural and format_fractional.
Scene.selection was Rc<RefCell<SelectionState>> (31 fields, ~1.6KB
with poly_points) cloned deep per view_main per pane via
(*sel_ref).clone() at view/mod.rs:760. Replace with
Arc<RefCell<SelectionState>> (Arc::new(RefCell::new(...)) at
scene/mod.rs:1436,1868), SelectionCanvas holds Arc<RefCell> and
selection_overlay takes Arc<RefCell> (overlay.rs:365,415),
view_main does Arc::clone(&tab.scene.selection) (atomic bump)
instead of deep clone. sel_ref stays borrowed for field reads
(vp_size etc.).
Bench (release, n=5000): SelectionState::clone 39-68ns (64pts) /
11-22ns (0pts) vs Arc::clone 7ns — 5-9x on the hot path.
Tests:
- selection_is_arc_not_refcell: asserts type_name contains Arc
- bench_selection_state_clone / bench_selection_arc_clone / bench_selection_state_clone_empty (ignored, release)
Make palette rows fill the available panel width while reserving an embedded scrollbar lane. Keep the final row aligned with the 16-column grid.\n\nFixes #968
Replace the 8 owned clones in StyleContext construction (4 Vec<String>
+ 4 String) at ribbon/mod.rs:568 and :1059 with borrowed refs.
StyleContext is now StyleContext<'a> with &'a [String]/&'a str
(widgets.rs:313), RenderCtx holds &'a StyleContext<'a> (:633),
and call sites pass &self.x instead of .clone(). The view-local
borrow is valid for the duration of Ribbon::view() and the style
dropdown overlay.
TDD: RED style_context_tests failed E0308 (owned vs borrowed),
GREEN added lifetime and updated 4 type sites + 2 construction sites.
Centralize the 7 byte-identical `muted_style` helpers (alpha 0.68)
previously duplicated across src/ui/style/* into a single
`src/ui/style/common.rs::muted_style` (+ alias `muted_text_style`).
All 7 style windows and the style_manager wrapper now call the
common helper, ensuring a theme palette change updates one place.
`btn_s` is intentionally NOT deduped: plotstyle.rs:41 and
style_manager.rs:299 have divergent bodies (Disabled handling +
text alpha 0.45). Unifying would silently change plotstyle
disabled appearance : documented in common.rs and covered by test.
TDD: RED `common_tests` failed E0433 (missing common), GREEN
added common.rs and wired `pub mod common`, REFACTOR replaced
locals with `use crate::ui::style::common::muted_style`.
Tests:
- common_muted_style_matches_local_copy: asserts common output equals 0.68 alpha reference
- common_muted_text_style_alias_matches: alias identity
- btn_s_bodies_documented_as_divergent: documents intentional non-dedup
Hold a single Ref<SelectionState> across the block; replace six redundant borrow().vp_size/last_move_pos calls with field reads on the Ref. Move the deep clone to the widget call site ((*sel_ref).clone()), preserving one clone per frame but ensuring the widget receives the same snapshot as the geometry reads.
- Implement `TABLEDIT` command supporting viewport point-picking on cell interiors
- Support overlapping table hit testing with selection cycling and top-table resolution
- Support `/n` and `\n` multiline paragraph breaks (`\P`) in table cell text editing
- Unify text input modes via `InputKind` (`Point`, `SingleToken`, `FreeText`) on `CadCommand`
- Migrate 15+ commands across annotate, draw, insert, layout, and view modules
- Preserve text casing, literal spaces, and bypass arithmetic eval during FreeText input
- Add dedicated `tabledit_tests` and `free_text_entry_tests` test suites