Summary
Support responsive Grid layout where the same primitive can be placed in different grid positions depending on screen size, by adding the same item multiple times with different minWidth/minHeight thresholds. tview supports this via multiple AddItem calls; tviewyaml currently adds each grid item once.
Background
Discovered while planning a tview presentation demo implementation via tviewyaml. The Grid slide adds menu/main/sidebar with minWidth: 0 for narrow screens (hidden) and minWidth: 100 for wide screens (visible), achieving responsive layout.
Demo Usage
Demo adds same primitives multiple times with different minWidth (0 vs 100) for narrow/wide; tviewyaml adds each item once.
Proposed Approach
- Extend
GridItem to support multiple placements: placements: [{ row, column, rowSpan, colSpan, minHeight, minWidth, focus }, ...]
- Or add
responsiveItems that duplicate a primitive with different min dimensions
- In
populateGridItems, call AddItem for each placement
Relevant Files
config/types.go – extend GridItem or add responsive structure
builder/builder.go – populateGridItems
docs/tview-coverage.md – document once implemented
Summary
Support responsive Grid layout where the same primitive can be placed in different grid positions depending on screen size, by adding the same item multiple times with different
minWidth/minHeightthresholds. tview supports this via multipleAddItemcalls; tviewyaml currently adds each grid item once.Background
Discovered while planning a tview presentation demo implementation via tviewyaml. The Grid slide adds menu/main/sidebar with
minWidth: 0for narrow screens (hidden) andminWidth: 100for wide screens (visible), achieving responsive layout.Demo Usage
Demo adds same primitives multiple times with different minWidth (0 vs 100) for narrow/wide; tviewyaml adds each item once.
Proposed Approach
GridItemto support multiple placements:placements: [{ row, column, rowSpan, colSpan, minHeight, minWidth, focus }, ...]responsiveItemsthat duplicate a primitive with different min dimensionspopulateGridItems, callAddItemfor each placementRelevant Files
config/types.go– extend GridItem or add responsive structurebuilder/builder.go–populateGridItemsdocs/tview-coverage.md– document once implemented