Private
Public Access
1
0

Update tui error handling

- Allow each view to position error banners where they choose
- Add global 'esc' key handler to dismiss errors
This commit is contained in:
2024-12-12 07:09:58 +00:00
parent d9d1b02ef3
commit 02228d65ac
6 changed files with 40 additions and 12 deletions

View File

@@ -218,9 +218,13 @@ func (m *Model) Header(width int) string {
return styles.Header.Width(width).Render(header)
}
func (m *Model) Content(width int, height int) string {
func (m *Model) Content(width int, height int, errors string) string {
m.content.Width, m.content.Height = width, height
return m.content.View()
content := m.content.View()
if errors != "" {
content += errors
}
return content
}
func (m *Model) Footer(width int) string {