forked from 1b-agent/opencadstudio-upstream
feat(input): scalar entry via dynamic input
Text-input steps (OFFSET distance, POLYGON sides, radii, counts) were swallowed by the dynamic-input overlay: typed digits landed in the field buffer and Enter committed a point pick, so the value never reached on_text_input (issue #61). Now each text step shows one scalar box whose value routes to on_text_input on commit; non-numeric prompts (names, keywords) keep going to the command line so mixed text like "Bolt12" isn't split. OFFSET reworked: object first, then through-mode by default — the offset follows the cursor at the perpendicular distance to the object. Typing a number locks the magnitude (cursor then only picks the side); a value typed and clicked without Enter is applied before the point pick. The dynamic-input overlay and the command line now show the active step's prompt and hold it until the step completes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c9c6e45793
commit
4b878b88c4
15 files changed
+405
-70
No files matched your search
+12
-2
@@ -226,7 +226,12 @@ impl CommandLine {
|
||||
matches
|
||||
}
|
||||
|
||||
pub fn view(&self, show_autocomplete: bool, dyn_capturing: bool) -> Element<'_, Message> {
|
||||
pub fn view(
|
||||
&self,
|
||||
show_autocomplete: bool,
|
||||
dyn_capturing: bool,
|
||||
active_prompt: Option<String>,
|
||||
) -> Element<'_, Message> {
|
||||
// Only the most recent entries pushed within the last few
|
||||
// seconds show on the overlay. The dropdown button keeps the
|
||||
// full backlog reachable when the user actually wants it.
|
||||
@@ -247,7 +252,12 @@ impl CommandLine {
|
||||
};
|
||||
col.push(container(text(&entry.text).size(11).color(color)).padding([1, 8]))
|
||||
});
|
||||
let prompt = container(text("Command:").size(11).color(PROMPT_COLOR)).padding([5, 8]);
|
||||
// While a command is running, the prompt shows what the current
|
||||
// step is asking for and stays put until that step completes — it
|
||||
// does not fade like the history lines. With no active command it
|
||||
// falls back to the generic entry prompt.
|
||||
let prompt_label = active_prompt.unwrap_or_else(|| "Command:".to_string());
|
||||
let prompt = container(text(prompt_label).size(11).color(PROMPT_COLOR)).padding([5, 8]);
|
||||
// While dynamic input is capturing keystrokes, the command-line
|
||||
// text field is left without an `on_input` handler so it can't
|
||||
// grab focus or swallow numeric keys — those flow through the
|
||||
|
||||
Reference in new issue
Block a user