Skip to content

Commit

Permalink
tiny fix around hey UI (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Aug 27, 2023
1 parent cef343f commit 70ae027
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ui/hey/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import (
_ "github.com/gdamore/tcell/v2" // if not import this package, UI does not display as expected
)

func (m Model) Init() tea.Cmd {
func (m *Model) Init() tea.Cmd {
return tea.Batch(m.loadConfig, textinput.Blink)
}
2 changes: 1 addition & 1 deletion ui/hey/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/JunNishimura/Chatify/ai/model"
"github.com/JunNishimura/Chatify/config"
"github.com/JunNishimura/Chatify/ui/hey/style"
"github.com/JunNishimura/Chatify/ui/style"
"github.com/JunNishimura/Chatify/utils"
"github.com/JunNishimura/spotify/v2"
"github.com/charmbracelet/bubbles/list"
Expand Down
12 changes: 6 additions & 6 deletions ui/hey/view.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package hey

import (
"github.com/JunNishimura/Chatify/ui/hey/style"
"github.com/JunNishimura/Chatify/ui/style"
"github.com/charmbracelet/lipgloss"
)

func (m Model) View() string {
func (m *Model) View() string {
var s string

// window size adjustmen
Expand All @@ -29,18 +29,18 @@ func (m Model) View() string {
return s
}

func (m Model) getViewWidth() int {
func (m *Model) getViewWidth() int {
wholeWidth := m.window.Width - 4
halfWidth := wholeWidth / 2
return halfWidth
}

func (m Model) getViewHeight() int {
func (m *Model) getViewHeight() int {
height := m.window.Height - 5
return height
}

func (m Model) chatView() string {
func (m *Model) chatView() string {
var s string
var lastSpeaker Speaker
for _, message := range m.conversation {
Expand All @@ -58,6 +58,6 @@ func (m Model) chatView() string {
return s
}

func (m Model) recommendationView() string {
func (m *Model) recommendationView() string {
return m.list.View()
}

0 comments on commit 70ae027

Please sign in to comment.