Skip to content

Control channel: ui.dialog.confirm sends what OK sends (#1459) - #1477

Merged
aiongg merged 1 commit into
storytold:mainfrom
wstock:fix/dialog-confirm-build-params
Oct 22, 2026
Merged

aiongg merged 1 commit into
storytold:mainfrom
wstock:fix/dialog-confirm-build-params

Conversation

@wstock

@wstock wstock commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #1459.

Clicking OK in a dialog and confirming it with ui.dialog.confirm over the control channel should run the same command with the same parameters. OK goes through build_params(&d), which reshapes the field values for several dialogs (cfQuick wraps them in rule, Text to Columns turns the check boxes into delimiters, Remove Duplicates and Subtotal split columnsText into columns, Data Validation drops the fields its type/operator don't use, Zoom, Series and Define Name have their own adjustments). ui.dialog.confirm sent Json::Object(d.values.clone()) instead, so a Highlight Cells rule confirmed from the control channel added nothing (home.conditionalFormat saw no rule and asked for the dialog again) and a Text to Columns confirm ignored the ticked delimiter.

Changes:

  • crates/ui-egui/src/dialogs.rs: build_params is pub(crate), with a one-line doc.
  • crates/ui-egui/src/control.rs: ui.dialog.confirm builds the parameters with it.
  • docs/control-protocol.md: says confirm runs the dialog's command with the same parameters as its OK button.
  • crates/ui-egui/tests/dialog_confirm.rs: two tests drive dialogs over the control channel (ui.dialog, ui.dialog.set, ui.dialog.confirm) and check the model: Greater Than… adds a CellIs rule with the typed value; Text to Columns with Semicolon ticked splits a;b into two cells. Both fail on main and pass with the change.

cargo fmt --all -- --check, cargo clippy -p gridcraft-ui-egui --all-targets -- -D warnings and cargo test -p gridcraft-ui-egui --test dialog_confirm pass.

Developed with AI assistance (Claude Code); reviewed and tested locally.

OK runs a dialog's command with build_params(&d), which reshapes the
field values for several dialogs (the rule wrapper of cfQuick, the
delimiters list of Text to Columns, the columns of Remove Duplicates and
Subtotal, Data Validation's unused fields, Zoom presets, Series, Define
Name). ui.dialog.confirm passed the raw field values instead, so a
Highlight Cells rule confirmed over the control channel added nothing
and Text to Columns ignored the ticked delimiter.

Make build_params pub(crate) and use it from ui.dialog.confirm, say so
in the control protocol doc, and add tests driving the Greater Than and
Text to Columns dialogs over the control channel.
aiongg added a commit to aiongg/gridcraft that referenced this pull request Oct 22, 2026
…ata loss

crates/ui-egui/src/control.rs: kept storytold#1477's unconditional build_params call
crates/ui-egui/src/dialogs.rs: build_params pub(crate) once, with storytold#1628's advancedFilter arm
docs/ui-parity.md: status line combined, change-log rows both kept
@aiongg
aiongg merged commit c29cac5 into storytold:main Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control channel: ui.dialog.confirm runs a dialog's command with the raw field values, not what OK sends

2 participants