Part of #269 — spec 0009 (specs/0009-unnest-to-let.md). Depends on #271 (engine).
The UI and wiring, modelled on RefactorToLetWindow / RefactorCommand.
Scope:
/Unnest slash command registered in the main popup. Activation: active cell holds a formula -> open dialog; empty/literal -> silent no-op (no dialog, no error). Zero-step formula (e.g. =A1+B1) -> open dialog showing nothing to do (discoverable, consistent).
UnnestToLetWindow WPF window:
- Read-only header: active cell address + original formula.
- Steps section, one row per step in leaf-first order: editable live-validated name (reuse
ExcelNameValidator + LetToLambdaWindow collision rules), read-only RHS, Origin badge ("function: SUMSQ" / "operator: −"), Include checkbox (default on).
- Live Preview pane via
FormulaFormatter, updating on rename / Include toggle.
- Save writes the synthesised LET to the active cell via
Range.Formula2; Cancel no change.
- Keyboard: Escape cancels, Ctrl+Enter saves. No reorder controls (order forced by dependency).
AddinTests (real Excel)
Part of #269 — spec 0009 (
specs/0009-unnest-to-let.md). Depends on #271 (engine).The UI and wiring, modelled on
RefactorToLetWindow/RefactorCommand.Scope:
/Unnestslash command registered in the main popup. Activation: active cell holds a formula -> open dialog; empty/literal -> silent no-op (no dialog, no error). Zero-step formula (e.g.=A1+B1) -> open dialog showing nothing to do (discoverable, consistent).UnnestToLetWindowWPF window:ExcelNameValidator+LetToLambdaWindowcollision rules), read-only RHS, Origin badge ("function: SUMSQ" / "operator: −"), Include checkbox (default on).FormulaFormatter, updating on rename / Include toggle.Range.Formula2; Cancel no change.AddinTests (real Excel)
/Unneston the worked-example formula writes a LET that parses back viaLetParser./Unnest -> /Refactor -> /LET to LAMBDAproduces a working LAMBDA for the worked example.