The bubbles v2 viewport requires an explicit width to render content. Without it, the viewport width defaults to 0 and no rows are displayed. Pass terminal width to InitContinueTable and include table.WithWidth in the table options.
- commit
- 1a9a2e294dbd51d2f8d3eb93a4401a77f4b0b890
- parent
- 77225ac6dc23baea791c16b2d5fc472440e9f580
- author
- Dami <dami.etoile@gmail.com>
| M | ui/ | 3 | ++- |
| M | update.go | 2 | +- |
@@ -25,7 +25,7 @@ func FormatStatus(s store.GameStatus) string {
2525 2626 // InitContinueTable loads saved games from the store and builds the table2727 // widget. Returns the table, the loaded games, and the column definitions.28-func InitContinueTable(s *store.Store, height int) (table.Model, []store.GameRecord) {28+func InitContinueTable(s *store.Store, width, height int) (table.Model, []store.GameRecord) {2929 games, err := s.ListGames()3030 if err != nil {3131 log.Printf("failed to list games: %v", err)@@ -55,6 +55,7 @@ func InitContinueTable(s *store.Store, height int) (table.Model, []store.GameRec
5555 table.WithColumns(columns),5656 table.WithRows(rows),5757 table.WithFocused(true),58+ table.WithWidth(width),5859 table.WithHeight(max(height-2, 1)),5960 )6061 @@ -148,7 +148,7 @@ func (m model) handleMainMenuEnter() (tea.Model, tea.Cmd) {
148148 case "Generate":149149 m.state = gameSelectView150150 case "Continue":151- m.continueTable, m.continueGames = ui.InitContinueTable(m.store, m.height)151+ m.continueTable, m.continueGames = ui.InitContinueTable(m.store, m.width, m.height)152152 m.state = continueView153153 case "Guides":154154 m.helpSelectList = ui.InitList(GameCategories, "How to Play")