feat: implement TEXTEDIT command and TEXTEDITMODE system variable#130
Conversation
KarimJerbi
commented
Jun 18, 2026
- Adds TEXTEDIT command to seamlessly edit text objects in-place.
- Matches industry-standard CAD tools' prompt behavior and "Current settings" banner logic.
- Implements the TEXTEDITMODE system variable (0/1) for Multiple or Single editing modes.
- command lifecycle with CmdResult::SuspendForTextEdit and post_editor_closed hooks, allowing commands to cleanly pause and resume after external UI editors close.
- Adds TEXTEDIT command to seamlessly edit annotation objects in-place. - Matches industry-standard CAD tools' prompt behavior and "Current settings" banner logic. - Implements the TEXTEDITMODE system variable (0/1) for Multiple vs Single editing modes. - Enhances command lifecycle with CmdResult::SuspendForTextEdit and post_editor_closed hooks, allowing commands to cleanly pause and resume after external UI editors close.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a258f29ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .scene | ||
| .document | ||
| .get_entity(handle) | ||
| .map(|e| crate::app::text_inline::read_text_field(e).is_some()) |
There was a problem hiding this comment.
Resolve leaders before rejecting TEXTEDIT picks
Selecting a LEADER that annotates text now hits this read_text_field check and fails before begin_text_edit() can resolve Leader.annotation_handle; the double-click/DDEDIT paths explicitly allow Leader and route to begin_text_edit, so TEXTEDIT reports “selected entity is not text” for leaders with editable annotations. Let the resolver run or include Leader in the eligibility check.
Useful? React with 👍 / 👎.
| self.mtext_commit(); | ||
| Task::none() | ||
| self.post_editor_closed(true) |
There was a problem hiding this comment.
Only count MText edits when the commit changes the drawing
When TEXTEDIT is suspended on an existing MText and the user clears the editor then presses OK, mtext_commit() returns without pushing an undo snapshot or changing the drawing for empty content, but this path still calls post_editor_closed(true). That increments edit_count, making the command's Undo option perform a document-level undo of an unrelated prior operation; only report committed=true when the MText commit actually changed the drawing.
Useful? React with 👍 / 👎.
- Custom recursive resolver ensures Leader entities trace back to their editable Text/MText annotations. - Bypasses overly strict baseline field checks so TEXTEDIT can natively target and launch the inline editor on Leaders.
- Propagates commit status out of inline editors so commands know whether a real change occurred. - Fixes TEXTEDIT's Undo step rolling back unrelated document actions when the user presses OK on empty/cleared existing MText.
ReviewSolid design — the suspend/resume command lifecycle is clean and the guards are in the right places. A few findings: 🐛 Bug — invalid
|
|
do i need to adress the duplications and mesearment arm ? sorry i took my time |
|
No 🙂 I fixed it myself |