Documentation
¶
Index ¶
- type ActivityModel
- func (m *ActivityModel) AppendActivities(newActivities []models.Activity)
- func (m ActivityModel) GetSelectedActivity() *models.Activity
- func (m ActivityModel) Init() tea.Cmd
- func (m ActivityModel) IsFocused() bool
- func (m *ActivityModel) SetActivities(activities []models.Activity)
- func (m *ActivityModel) SetFocused(focused bool)
- func (m *ActivityModel) SetSize(width, height int)
- func (m ActivityModel) Update(msg tea.Msg) (ActivityModel, tea.Cmd)
- func (m ActivityModel) View() string
- type ActivitySelectedMsg
- type ChannelSelectedMsg
- type ChatModel
- func (m *ChatModel) AddMessage(msg models.Message)
- func (m *ChatModel) AddThreadReply(msg models.Message)
- func (m *ChatModel) EnterView()
- func (m *ChatModel) ExitView()
- func (m ChatModel) GetChannels() []models.Channel
- func (m ChatModel) GetSelectedChannel() *models.Channel
- func (m ChatModel) GetSelectedMessage() *models.Message
- func (m ChatModel) Init() tea.Cmd
- func (m ChatModel) IsSidebarFocused() bool
- func (m ChatModel) IsThreadActive() bool
- func (m *ChatModel) SelectChannel(channelID string)
- func (m *ChatModel) SetChannels(channels []models.Channel)
- func (m *ChatModel) SetKeyMap(keyMap *keys.ScopedKeyMap)
- func (m *ChatModel) SetMessages(msgs []models.Message)
- func (m *ChatModel) SetSize(width, height int)
- func (m *ChatModel) SetThreadReplies(channelID, channelName, threadTS string, parentMessage *models.Message, ...)
- func (m *ChatModel) SetUserID(userID string)
- func (m ChatModel) Update(msg tea.Msg) (ChatModel, tea.Cmd)
- func (m *ChatModel) UpdateChannelUnread(channelID string, unreadCount int, hasUnread bool)
- func (m ChatModel) View() string
- type FocusedComponent
- type LoadChannelMessagesMsg
- type LoadThreadRepliesMsg
- type SendChatMessageMsg
- type SendThreadMessageMsg
- type UserModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityModel ¶
type ActivityModel struct {
// contains filtered or unexported fields
}
ActivityModel represents the activity view
func NewActivityModel ¶
func NewActivityModel() ActivityModel
NewActivityModel creates a new activity view model
func (*ActivityModel) AppendActivities ¶
func (m *ActivityModel) AppendActivities(newActivities []models.Activity)
AppendActivities appends new activities to the existing list This is used for live updates from polling
func (ActivityModel) GetSelectedActivity ¶
func (m ActivityModel) GetSelectedActivity() *models.Activity
GetSelectedActivity returns the currently selected activity
func (ActivityModel) Init ¶
func (m ActivityModel) Init() tea.Cmd
Init initializes the activity view
func (ActivityModel) IsFocused ¶
func (m ActivityModel) IsFocused() bool
IsFocused returns whether the view is focused
func (*ActivityModel) SetActivities ¶
func (m *ActivityModel) SetActivities(activities []models.Activity)
SetActivities sets the list of activities
func (*ActivityModel) SetFocused ¶
func (m *ActivityModel) SetFocused(focused bool)
SetFocused sets the focus state
func (*ActivityModel) SetSize ¶
func (m *ActivityModel) SetSize(width, height int)
SetSize sets the dimensions of the activity view
func (ActivityModel) Update ¶
func (m ActivityModel) Update(msg tea.Msg) (ActivityModel, tea.Cmd)
Update handles messages for the activity view
type ActivitySelectedMsg ¶
ActivitySelectedMsg is sent when the user selects an activity to view
type ChannelSelectedMsg ¶
type ChannelSelectedMsg struct {
ChannelID string
}
ChannelSelectedMsg is sent when a channel is selected
type ChatModel ¶
type ChatModel struct {
// contains filtered or unexported fields
}
ChatModel represents the chat view
func (*ChatModel) AddMessage ¶
AddMessage adds a new message to the viewport
func (*ChatModel) AddThreadReply ¶
AddThreadReply adds a new reply to the thread
func (*ChatModel) EnterView ¶
func (m *ChatModel) EnterView()
EnterView is called when the user presses Space at tab level to enter the chat view
func (*ChatModel) ExitView ¶
func (m *ChatModel) ExitView()
ExitView is called when the user presses Esc at view level to return to tab level
func (ChatModel) GetChannels ¶
GetChannels returns all channels from the sidebar
func (ChatModel) GetSelectedChannel ¶
GetSelectedChannel returns the currently selected channel
func (ChatModel) GetSelectedMessage ¶
GetSelectedMessage returns the currently selected message from the messages viewport
func (ChatModel) IsSidebarFocused ¶
IsSidebarFocused returns whether the sidebar is currently focused
func (ChatModel) IsThreadActive ¶
IsThreadActive returns whether a thread is currently active
func (*ChatModel) SelectChannel ¶
SelectChannel selects a channel by ID in the sidebar
func (*ChatModel) SetChannels ¶
SetChannels sets the list of channels in the sidebar
func (*ChatModel) SetKeyMap ¶
func (m *ChatModel) SetKeyMap(keyMap *keys.ScopedKeyMap)
SetKeyMap sets the keybinding map for the chat view
func (*ChatModel) SetMessages ¶
SetMessages sets the messages in the viewport
func (*ChatModel) SetThreadReplies ¶
func (m *ChatModel) SetThreadReplies(channelID, channelName, threadTS string, parentMessage *models.Message, messages []models.Message)
SetThreadReplies sets the thread replies in the thread view
func (*ChatModel) UpdateChannelUnread ¶
UpdateChannelUnread updates the unread status of a channel in the sidebar
type FocusedComponent ¶
type FocusedComponent int
FocusedComponent represents which component is currently focused.
Navigation flow within chat view: 1. FocusSidebar: Channel list (entry point when view is entered) 2. FocusMessages: Main message area for selected channel 3. FocusThread: Thread reply view (activated by pressing Enter on threaded message) 4. FocusInput: Message input field
Transitions: - Tab: Cycles forward through components (Sidebar → Messages → Input → Sidebar) - Shift+Tab: Cycles backward - Enter on threaded message: Opens thread view (FocusMessages → FocusThread) - Escape in thread: Closes thread view (FocusThread → FocusMessages)
const ( FocusSidebar FocusedComponent = iota FocusMessages FocusThread FocusInput )
type LoadChannelMessagesMsg ¶
type LoadChannelMessagesMsg struct {
ChannelID string
}
LoadChannelMessagesMsg is sent to request loading messages for a channel
type LoadThreadRepliesMsg ¶
LoadThreadRepliesMsg is sent to request loading thread replies
type SendChatMessageMsg ¶
SendChatMessageMsg is sent when the user wants to send a message
type SendThreadMessageMsg ¶
SendThreadMessageMsg is sent when the user wants to send a thread reply
type UserModel ¶
type UserModel struct {
// contains filtered or unexported fields
}
UserModel represents the user info view
func (*UserModel) SetUserInfo ¶
SetUserInfo sets the user and team information