@
Idea
In the LET to LAMBDA dialog, when a user ticks Optional on an input row, the generated LAMBDA defaults that argument to the bindings original RHS — e.g. IF(ISOMITTED(offset), $A$1, offset). The user cannot change that default; its always whatever the source LET binding happened to be.
Allow the user to edit the default value for optional arguments directly in the dialog. e.g. mark offset optional but set its default to 0 instead of the cell reference it originally read.
Design (agreed with Tim)
- UX: When Optional is ticked, the read-only
default: … preview becomes an editable text box, pre-filled with the original RHS. When unticked, it reverts to the read-only preview.
- Absolutize: A user-typed default is treated like the original RHS —
ApplyRenames then AbsolutizeCellRefs (so a typed A1 becomes $A$1).
- Backward compatible:
InputChoice gains an optional DefaultExpression field; when null/blank the builder falls back to the original RHS (existing behaviour and tests unchanged).
- Validation: an optional row with a blank default disables Save.
Files
addin/lambda-boss/LetToLambdaBuilder.cs — InputChoice.DefaultExpression, use it in the optional-binding wrapper.
addin/lambda-boss/UI/LetToLambdaWindow.xaml(.cs) — editable default text box + validation.
addin/lambda-boss.Tests/LetToLambdaBuilderTests.cs — coverage for custom defaults.
@
@
Idea
In the LET to LAMBDA dialog, when a user ticks Optional on an input row, the generated LAMBDA defaults that argument to the bindings original RHS — e.g.
IF(ISOMITTED(offset), $A$1, offset). The user cannot change that default; its always whatever the source LET binding happened to be.Allow the user to edit the default value for optional arguments directly in the dialog. e.g. mark
offsetoptional but set its default to0instead of the cell reference it originally read.Design (agreed with Tim)
default: …preview becomes an editable text box, pre-filled with the original RHS. When unticked, it reverts to the read-only preview.ApplyRenamesthenAbsolutizeCellRefs(so a typedA1becomes$A$1).InputChoicegains an optionalDefaultExpressionfield; when null/blank the builder falls back to the original RHS (existing behaviour and tests unchanged).Files
addin/lambda-boss/LetToLambdaBuilder.cs—InputChoice.DefaultExpression, use it in the optional-binding wrapper.addin/lambda-boss/UI/LetToLambdaWindow.xaml(.cs)— editable default text box + validation.addin/lambda-boss.Tests/LetToLambdaBuilderTests.cs— coverage for custom defaults.@