Skip to content

Unnest: UnnestToLetWindow dialog + /Unnest command #272

Description

@jimmytacks

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)

  • Round-trip: /Unnest on the worked-example formula writes a LET that parses back via LetParser.
  • Full chain /Unnest -> /Refactor -> /LET to LAMBDA produces a working LAMBDA for the worked example.
  • Empty/literal cell -> popup closes silently.

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