views

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

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

func (ActivityModel) View

func (m ActivityModel) View() string

View renders the activity view

type ActivitySelectedMsg

type ActivitySelectedMsg struct {
	ChannelID string
	ThreadTS  string
}

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 NewChatModel

func NewChatModel() ChatModel

NewChatModel creates a new chat view model

func (*ChatModel) AddMessage

func (m *ChatModel) AddMessage(msg models.Message)

AddMessage adds a new message to the viewport

func (*ChatModel) AddThreadReply

func (m *ChatModel) AddThreadReply(msg models.Message)

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

func (m ChatModel) GetChannels() []models.Channel

GetChannels returns all channels from the sidebar

func (ChatModel) GetSelectedChannel

func (m ChatModel) GetSelectedChannel() *models.Channel

GetSelectedChannel returns the currently selected channel

func (ChatModel) GetSelectedMessage

func (m ChatModel) GetSelectedMessage() *models.Message

GetSelectedMessage returns the currently selected message from the messages viewport

func (ChatModel) Init

func (m ChatModel) Init() tea.Cmd

Init initializes the chat view

func (ChatModel) IsSidebarFocused

func (m ChatModel) IsSidebarFocused() bool

IsSidebarFocused returns whether the sidebar is currently focused

func (ChatModel) IsThreadActive

func (m ChatModel) IsThreadActive() bool

IsThreadActive returns whether a thread is currently active

func (*ChatModel) SelectChannel

func (m *ChatModel) SelectChannel(channelID string)

SelectChannel selects a channel by ID in the sidebar

func (*ChatModel) SetChannels

func (m *ChatModel) SetChannels(channels []models.Channel)

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

func (m *ChatModel) SetMessages(msgs []models.Message)

SetMessages sets the messages in the viewport

func (*ChatModel) SetSize

func (m *ChatModel) SetSize(width, height int)

SetSize sets the dimensions of the chat view

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) SetUserID

func (m *ChatModel) SetUserID(userID string)

SetUserID sets the current user ID for reaction tracking

func (ChatModel) Update

func (m ChatModel) Update(msg tea.Msg) (ChatModel, tea.Cmd)

Update handles messages for the chat view

func (*ChatModel) UpdateChannelUnread

func (m *ChatModel) UpdateChannelUnread(channelID string, unreadCount int, hasUnread bool)

UpdateChannelUnread updates the unread status of a channel in the sidebar

func (ChatModel) View

func (m ChatModel) View() string

View renders the chat view

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

type LoadThreadRepliesMsg struct {
	ChannelID     string
	ThreadTS      string
	ParentMessage models.Message
}

LoadThreadRepliesMsg is sent to request loading thread replies

type SendChatMessageMsg

type SendChatMessageMsg struct {
	ChannelID string
	Text      string
}

SendChatMessageMsg is sent when the user wants to send a message

type SendThreadMessageMsg

type SendThreadMessageMsg struct {
	ChannelID string
	ThreadTS  string
	Text      string
}

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 NewUserModel

func NewUserModel() UserModel

NewUserModel creates a new user info view model

func (UserModel) Init

func (m UserModel) Init() tea.Cmd

Init initializes the user info view

func (*UserModel) SetSize

func (m *UserModel) SetSize(width, height int)

SetSize sets the dimensions of the user info view

func (*UserModel) SetUserInfo

func (m *UserModel) SetUserInfo(userName, teamName string)

SetUserInfo sets the user and team information

func (UserModel) Update

func (m UserModel) Update(msg tea.Msg) (UserModel, tea.Cmd)

Update handles messages for the user info view

func (UserModel) View

func (m UserModel) View() string

View renders the user info view

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL