on main help sign in
fix: handle compact mode
2e30226Kujtim Hoxha
internal/tui/page/chat/chat.go+12
@@ -166,6 +166,9 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
166 p.keyboardEnhancements = msg
166 p.keyboardEnhancements = msg
167 return p, nil
167 return p, nil
168 case tea.MouseWheelMsg:
168 case tea.MouseWheelMsg:
169+ if p.compact {
170+ msg.Y -= 1
171+ }
169 if p.isMouseOverChat(msg.X, msg.Y) {
172 if p.isMouseOverChat(msg.X, msg.Y) {
170 u, cmd := p.chat.Update(msg)
173 u, cmd := p.chat.Update(msg)
171 p.chat = u.(chat.MessageListCmp)
174 p.chat = u.(chat.MessageListCmp)
@@ -173,6 +176,9 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
173 }
176 }
174 return p, nil
177 return p, nil
175 case tea.MouseClickMsg:
178 case tea.MouseClickMsg:
179+ if p.compact {
180+ msg.Y -= 1
181+ }
176 if p.isMouseOverChat(msg.X, msg.Y) {
182 if p.isMouseOverChat(msg.X, msg.Y) {
177 p.focusedPane = PanelTypeChat
183 p.focusedPane = PanelTypeChat
178 p.chat.Focus()
184 p.chat.Focus()
@@ -186,6 +192,9 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
186 p.chat = u.(chat.MessageListCmp)
192 p.chat = u.(chat.MessageListCmp)
187 return p, cmd
193 return p, cmd
188 case tea.MouseMotionMsg:
194 case tea.MouseMotionMsg:
195+ if p.compact {
196+ msg.Y -= 1
197+ }
189 if msg.Button == tea.MouseLeft {
198 if msg.Button == tea.MouseLeft {
190 u, cmd := p.chat.Update(msg)
199 u, cmd := p.chat.Update(msg)
191 p.chat = u.(chat.MessageListCmp)
200 p.chat = u.(chat.MessageListCmp)
@@ -193,6 +202,9 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
193 }
202 }
194 return p, nil
203 return p, nil
195 case tea.MouseReleaseMsg:
204 case tea.MouseReleaseMsg:
205+ if p.compact {
206+ msg.Y -= 1
207+ }
196 if msg.Button == tea.MouseLeft {
208 if msg.Button == tea.MouseLeft {
197 u, cmd := p.chat.Update(msg)
209 u, cmd := p.chat.Update(msg)
198 p.chat = u.(chat.MessageListCmp)
210 p.chat = u.(chat.MessageListCmp)