Skip to content

NanoDSL: End-to-end support for HStack wrap + child flex #518

@phodal

Description

@phodal

Goal

  • Make NanoDSL authoring support: HStack(wrap=true or wrap="wrap") and child flex= end-to-end.

Scope

  • Spec: declare wrap on HStack and flex on common layout/container nodes (at minimum Card/VStack/SplitView/Form/Component).
  • Parser (IndentParser): parse wrap for HStack and flex for supported nodes from args and indented props.
  • IRConverter: emit props.wrap and props.flex into NanoIR.
  • Renderers:
    • Compose: use existing wrap/flex logic (already implemented) but ensure it is reachable from DSL.
    • HTML: implement wrap via CSS (flex-wrap) and flex via style="flex: 1 0%" or equivalent.
  • Tests: add/extend cross-platform IR conversion tests to cover wrap/flex output.

Acceptance

  • Given NanoDSL:
    component FlexWrapDemo:
    HStack(wrap=true):
    Card(flex=1):
    Text("A")
    Card(flex=2):
    Text("B")

    IR contains HStack.props.wrap=true and child Card.props.flex=1/2.
    Compose renderer wraps when wrap=true and allocates weights accordingly.
    HTML renderer wraps and respects flex ratio.

Notes

  • Keep behavior minimal; avoid new UX features beyond wrap/flex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions