GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix bad layout on first render of chat history · siathalysedI/opencode@6232e0f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/tui/internal/components/chat
    • messages.go
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/tui/internal/components/chat/messages.go‎

Copy file name to clipboardExpand all lines: packages/tui/internal/components/chat/messages.go
+5-9Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,23 @@ func (m *messagesComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6767
m.height = msg.Height - 7
6868
m.viewport.SetWidth(m.width)
6969
m.loading = true
70-
return m, m.Reload()
70+
return m, m.renderView()
7171
case app.SendMsg:
7272
m.viewport.GotoBottom()
7373
m.tail = true
7474
return m, nil
7575
case dialog.ThemeSelectedMsg:
7676
m.cache.Clear()
7777
m.loading = true
78-
return m, m.Reload()
78+
return m, m.renderView()
7979
case ToggleToolDetailsMsg:
8080
m.showToolDetails = !m.showToolDetails
81-
return m, m.Reload()
81+
return m, m.renderView()
8282
case app.SessionLoadedMsg, app.SessionClearedMsg:
8383
m.cache.Clear()
8484
m.tail = true
8585
m.loading = true
86-
return m, m.Reload()
86+
return m, m.renderView()
8787

8888
case opencode.EventListResponseEventSessionUpdated:
8989
if msg.Properties.Info.ID == m.app.Session.ID {
@@ -404,7 +404,7 @@ func (m *messagesComponent) renderView() tea.Cmd {
404404
}
405405

406406
content := "\n" + strings.Join(blocks, "\n\n")
407-
viewport.SetHeight(m.height - lipgloss.Height(m.header))
407+
viewport.SetHeight(m.height - lipgloss.Height(header))
408408
viewport.SetContent(content)
409409
if tail {
410410
viewport.GotoBottom()
@@ -585,10 +585,6 @@ func (m *messagesComponent) View() string {
585585
Render(m.header + "\n" + viewport)
586586
}
587587

588-
func (m *messagesComponent) Reload() tea.Cmd {
589-
return m.renderView()
590-
}
591-
592588
func (m *messagesComponent) PageUp() (tea.Model, tea.Cmd) {
593589
m.viewport.ViewUp()
594590
return m, nil

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.