Skip to content

feat: v2 — div+flex, YAML state, nested state, template v2#1

Merged
anakod merged 1 commit into
futurefrom
feature/v2-div-flex-yaml-nested
Mar 28, 2026
Merged

feat: v2 — div+flex, YAML state, nested state, template v2#1
anakod merged 1 commit into
futurefrom
feature/v2-div-flex-yaml-nested

Conversation

@anakod

@anakod anakod commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator

TelaOS v2 syntax + div/flex layout

New features

  • div container — nesting, bgcolor/visible bind, CSS, padding, overflow
  • Flex layout — row/column/wrap/reverse, gap, justify, align, grow
  • YAML statebrightness: 50 instead of <int name="brightness" default="50"/>
  • Nested state — dotted paths {player.x}, arrays {items[0]}
  • Lua proxystate.player.x = 50, state.items[1], #state.items
  • Template v2<TableCell>body</TableCell> instead of <template id="TableCell">
  • isOsV2()os=1.0 old parser, os=2.0 new. Per-app migration.

Files changed

File Changes
state_store.h Arrays API (defineArray, hasArray, getArrayItem, setArrayItem) + hasPrefix
lua_engine.cpp/h Nested proxy (pushProxy, lua_proxy_index/newindex/len)
ui_html.cpp YAML state parser, template v2 parser, div+flex, resolve_binding
ui_types.h Element::Div tag

Tests

TelaCI PR: Tela-CICD#1 — 62/62 green (8 new test files, 150+ checks)

Features:
- <div> container with nesting, bgcolor/visible bind, CSS, padding, overflow
- Flex layout: row/column/wrap/reverse, gap, justify, align, grow
- YAML state: key: value with type inference (int, float, bool, string)
- Nested state: dotted paths (player.x), arrays (items[0])
- Lua proxy: state.player.x, state.items[1], #state.items
- Template v2: <PascalCase> definitions inside <templates>
- isOsV2() switch: os=1.0 → old parser, os=2.0 → new
- resolve_binding() for {player.x} and {items[0]} in templates

Files: state_store.h, lua_engine.cpp/h, ui_html.cpp, ui_types.h
62/62 TelaCI tests pass.
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.

2 participants