mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-07 20:41:50 +00:00
0e83a0e494
* Parameters: a refused new parameter's message goes once the draft is corrected In Parameters, adding a parameter whose name is taken, or whose expression does not evaluate, showed the reason in the window's banner. The banner stayed after the name or the expression was corrected, until the next Enter, beside an expression cell that already said the draft was fine. The add row now keeps the draft it was refused with (name, unit, expression, comment), the design document the refusal was about and the message, as a command window does for a refused OK (#641). Each frame the window drops the message once the draft differs or the document is another one; a selection or display change keeps the document and so keeps the message. The refusal lives apart from the row edits' messages: the banner shows the last action's message if there is one, else the refusal. Discarding the row takes the message with it. The add row's bin button publishes the scenario handle param:new:delete. Eight asserts read the banner through ParamsDialog::banner() instead of the error field. Regression tests: correcting_a_refused_new_parameter_clears_its_error and seven more in params_dialog.rs cover the corrected draft, a discarded row, a refusal on leaving the row, a design change, a row's own message beside the refusal, a selection, a unit or comment edit, and the banner's order. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Design Properties: a refused OK's message goes once the fields change In File, Design Properties, a value the design refuses (a part number with a control character, for example) keeps the window open with the reason. The message stayed after the field was corrected, until the next OK. The window now keeps a snapshot of the fields at the refused OK, as a command dialog does for its inputs (#641). Each frame it compares the fields with the snapshot; once they differ, the message goes, also on an edit to another field, and the next OK checks again. The regression test the_window_edits_properties_in_one_undo_step_and_keeps_other_tools_data covers the corrected field, an edit to another field and the repeated refusal. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * BOM panel: a refused Apply's message goes once the row or its fields change In the Bill of Materials window, edit a part number to one the design refuses and click Apply: the message shows. Correct the field, or pick another row: the message stayed until the next Apply. BomPanel::apply set the error on a refusal and nothing cleared it while the window was open. The panel now keeps the design revision, the row and the fields Apply ran with and drops the message as soon as any of them differs, as a command dialog's refused OK does (#641); the next Apply checks again. The revision is part of the snapshot because the row index counts the design's rows, which an undo or a part added elsewhere can change under the message. The regression test a_refused_apply_keeps_its_message_until_the_row_or_its_fields_change covers the corrected field, another field, another row, an undo and the repeated refusal. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Material editor: a refused Save's message goes once the draft changes New material, name it Steel (a built-in), Save: refused with the reason. Rename it: the message stayed until the next Save. The editor set the error when save was refused and cleared it only on a successful save, Discard or a new draft. The editor now keeps the design revision and the command Save ran with and drops the message as soon as the draft would run another, or the design changes under it, as a command dialog's refused OK does (#641); the next Save checks again. A Save refused while the draft fails its own validation (not reachable with a mouse, Save is disabled then) is kept the same way. The regression tests physical_material_refused_save_keeps_its_message_until_the_draft_changes and physical_material_refused_save_goes_when_the_design_changes in manage_dialogs_tests.rs cover the rename, an undo and the repeated refusal. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Add agent: a refused Add's message goes once the fields change Add agent, custom, click Add with the command empty: the dialog asks for a command. Type the command: the message stayed until Add was clicked again, the same for a missing model, a key without https or a bad URL. The dialog cleared the message only on a preset, kind or model change. The dialog now keeps what the fields said when Add was refused and drops the message as soon as any of them changes, as a command dialog's refused OK does (#641); the next Add checks again. The snapshot holds whether a key is typed, not the key itself. The regression test a_refused_add_keeps_its_message_until_the_fields_change covers a program without a command and an endpoint without a model. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>