Skip to content

Editable defaults for optional args in LET to LAMBDA#216

Merged
jimmytacks merged 1 commit into
mainfrom
issue-215-editable-optional-defaults
May 29, 2026
Merged

Editable defaults for optional args in LET to LAMBDA#216
jimmytacks merged 1 commit into
mainfrom
issue-215-editable-optional-defaults

Conversation

@jimmytacks
Copy link
Copy Markdown
Collaborator

@

Summary

In the LET to LAMBDA dialog, ticking Optional on an input previously fixed its default to the bindings original RHS — authors had no way to change it. This lets them edit the default inline.

  • When Optional is ticked, the read-only default: … preview turns into an editable text box, pre-filled with the original RHS. Unticking reverts to the read-only preview.
  • InputChoice gains an optional DefaultExpression; the builder uses it for the IF(ISOMITTED(…)) wrapper and falls back to the original RHS when blank, so existing behaviour and the full builder test suite are unchanged.
  • User-typed defaults get the same ApplyRenames + AbsolutizeCellRefs treatment as the original RHS (a typed A1 becomes $A$1).
  • Save is disabled while an optional row has a blank default.

Files

  • addin/lambda-boss/LetToLambdaBuilder.csInputChoice.DefaultExpression + wrapper uses it.
  • addin/lambda-boss/UI/LetToLambdaWindow.xaml(.cs) — editable default box, ShowRhsPreview, blank-default validation.
  • addin/lambda-boss.Tests/LetToLambdaBuilderTests.cs — 4 new cases (typed default, absolutized ref, blank fallback, rename-through-default).

Testing

  • dotnet build addin/lambda-boss.slnx — clean, 0 warnings.
  • dotnet test …/lambda-boss.Tests994 passed, 0 failed.
  • WPF dialog behaviour (the editable box appearing/reverting) is not covered by automated tests and needs a manual check in Excel.

Closes #215

🤖 Generated with Claude Code
@

When an input is marked Optional in the LET to LAMBDA dialog, the
generated LAMBDA previously always defaulted it to the binding's
original RHS. Authors can now edit that default inline: the read-only
RHS preview becomes an editable text box (pre-filled with the original
RHS) when Optional is ticked.

- InputChoice gains an optional DefaultExpression; the builder uses it
  for the IF(ISOMITTED(...)) wrapper, falling back to the original RHS
  when blank so existing behaviour and tests are unchanged.
- User-typed defaults get the same ApplyRenames + AbsolutizeCellRefs
  treatment as the original RHS (a typed A1 becomes $A$1).
- Save is disabled while an optional row has a blank default.

Closes #215

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jimmytacks jimmytacks merged commit a5d382a into main May 29, 2026
1 check passed
@jimmytacks jimmytacks deleted the issue-215-editable-optional-defaults branch May 29, 2026 15:06
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.

Edit default values for optional arguments in LET to LAMBDA dialog

1 participant