Skip to content

Edit default values for optional arguments in LET to LAMBDA dialog #215

@jimmytacks

Description

@jimmytacks

@

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.csInputChoice.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.
    @

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions