feat(table): add TABLEDIT point picking, and consolidate InputKind

- 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
This commit is contained in:
Karim Jerbi committed 2026-09-02 14:55:49 +01:00
1 parent bde9cc2715
commit d6a6dd6a7d
23 files changed
+860 -254

No files matched your search

+6 -11
View File
@@ -4,7 +4,7 @@ use acadrust::EntityType;
use glam::{DVec3, Vec3};
use crate::t;
use crate::command::{CadCommand, CmdResult, WorkingPlane};
use crate::command::{CadCommand, CmdResult, InputKind, WorkingPlane};
use crate::modules::{IconKind, ModuleEvent, ToolDef};
use crate::scene::model::wire_model::WireModel;
@@ -249,11 +249,11 @@ impl CadCommand for InsertBlockCommand {
}
}
fn wants_text_input(&self) -> bool {
matches!(
self.step,
Step::Name | Step::FillAttr { .. } | Step::Point { .. }
)
fn input_kind(&self) -> InputKind {
match self.step {
Step::FillAttr { .. } => InputKind::FreeText,
Step::Name | Step::Point { .. } => InputKind::SingleToken,
}
}
fn point_step_accepts_keywords(&self) -> bool {
@@ -263,11 +263,6 @@ impl CadCommand for InsertBlockCommand {
matches!(self.step, Step::Point { .. }) && self.awaiting.is_none()
}
fn wants_text_with_spaces(&self) -> bool {
// Block names don't embed whitespace, but attribute values do.
matches!(self.step, Step::FillAttr { .. })
}
fn on_text_input(&mut self, text: &str) -> Option<CmdResult> {
match &self.step {
Step::Name => {