feat(attedit): attribute editor dialog for blocks

Double-clicking a block reference that has attributes, or running ATTEDIT
on one, now opens an editor dialog listing every attribute (tag + editable
value) with OK / Cancel. OK writes the values back to the block, with undo
and a repaint; Cancel discards. A block with no attributes still enters
in-place block edit (REFEDIT) on double-click as before. (#192)

ATTEDIT opens the dialog directly when a suitable block is already
selected; otherwise it runs the pick command and the dialog opens once a
block is chosen. This replaces the earlier command-line, per-attribute
prompt flow, which is removed along with its __ATTEDIT__ sentinel path and
the now-unused attedit_set_attrs trait hook; the ATTEDIT command is reduced
to a plain block picker.

The dialog is a tab-scoped in-canvas modal (Plan B): its working copy holds
a document-local handle, so closing that tab or switching away dismisses the
editor rather than risk applying edits to another tab's document.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-01 08:05:25 +03:00
1 parent 5f2e920b75
commit 86a59d6c7e
12 files changed
+346 -192

No files matched your search

+2 -5
View File
@@ -667,15 +667,12 @@ pub trait CadCommand: Send {
None
}
/// If this command needs attribute data injected (ATTEDIT), returns the
/// INSERT handle awaiting attr initialization; else None.
/// The block reference an ATTEDIT pick has resolved to, awaiting the
/// attribute editor dialog; else None.
fn attedit_pending_handle(&self) -> Option<acadrust::Handle> {
None
}
/// Inject attribute (tag, value) pairs into the command after entity pick.
fn attedit_set_attrs(&mut self, _attrs: Vec<(String, String)>) {}
/// Inject attribute definitions (tag, prompt, default_value) for ATTREQ
/// attr-filling after INSERT point is picked.
fn attreq_set_attdefs(&mut self, _attdefs: Vec<(String, String, String)>) {}