-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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
GridItemto support multiple placements:placements: [{ row, column, rowSpan, colSpan, minHeight, minWidth, focus }, ...] - Or add
responsiveItemsthat duplicate a primitive with different min dimensions - In
populateGridItems, callAddItemfor each placement
Relevant Files
config/types.go– extend GridItem or add responsive structurebuilder/builder.go–populateGridItemsdocs/tview-coverage.md– document once implemented
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels