Documentation
¶
Index ¶
- func ChatKeyBindings() ui.KeyBindingSet
- type ChannelList
- func (cl *ChannelList) ClearUnread(channel string)
- func (cl *ChannelList) FindByName(name string) (sharkfin.Channel, bool)
- func (cl *ChannelList) HasUnreads() bool
- func (cl *ChannelList) IncrementMention(channel string)
- func (cl *ChannelList) IncrementUnread(channel string)
- func (cl *ChannelList) IsMember() bool
- func (cl *ChannelList) MoveDown()
- func (cl *ChannelList) MoveUp()
- func (cl *ChannelList) Names() []string
- func (cl *ChannelList) SelectByName(name string) bool
- func (cl *ChannelList) SelectIndex(i int)
- func (cl *ChannelList) Selected() string
- func (cl *ChannelList) SetChannels(channels []sharkfin.Channel)
- func (cl *ChannelList) SetCounts(channel string, unread, mentions int)
- func (cl *ChannelList) SetSize(w, h int)
- func (cl ChannelList) View() string
- type ChannelSelectedMsg
- type ChatModel
- type DMList
- func (dl *DMList) ClearUnread(channel string)
- func (dl *DMList) HasUnreads() bool
- func (dl *DMList) IncrementMention(channel string)
- func (dl *DMList) IncrementUnread(channel string)
- func (dl *DMList) MoveDown()
- func (dl *DMList) MoveUp()
- func (dl *DMList) Participant() string
- func (dl *DMList) SelectByChannel(channel string)
- func (dl *DMList) SelectIndex(i int)
- func (dl *DMList) Selected() string
- func (dl *DMList) SetCounts(channel string, unread, mentions int)
- func (dl *DMList) SetDMs(dms []sharkfin.DM)
- func (dl *DMList) SetSize(w, h int)
- func (dl DMList) View() string
- type InputBar
- func (ib *InputBar) Blur()
- func (ib *InputBar) Focus()
- func (ib *InputBar) Focused() bool
- func (ib *InputBar) Height() int
- func (ib *InputBar) InsertNewline()
- func (ib *InputBar) InsertString(s string)
- func (ib *InputBar) Paste()
- func (ib *InputBar) Reset()
- func (ib *InputBar) SetReadOnly(ro bool)
- func (ib *InputBar) SetWidth(w int)
- func (ib *InputBar) TryComplete(usernames []string) bool
- func (ib *InputBar) UpdateTextInput(msg interface{})
- func (ib *InputBar) Value() string
- func (ib InputBar) View() string
- type MessagePane
- func (mp *MessagePane) AppendMessage(channel string, msg sharkfin.Message)
- func (mp *MessagePane) AtTop() bool
- func (mp *MessagePane) Channel() string
- func (mp *MessagePane) Height() int
- func (mp *MessagePane) LatestID(channel string) int
- func (mp *MessagePane) MergeMessages(channel string, msgs []sharkfin.Message)
- func (mp *MessagePane) OldestID(channel string) int
- func (mp *MessagePane) PrependHistory(channel string, msgs []sharkfin.Message)
- func (mp *MessagePane) ScrollDown(n int)
- func (mp *MessagePane) ScrollUp(n int)
- func (mp *MessagePane) SetChannel(name string)
- func (mp *MessagePane) SetSize(w, h int)
- func (mp MessagePane) View() string
- type Modal
- func (m *Modal) HitTest(screenX, screenY int) ModalAction
- func (m *Modal) IsPublic() bool
- func (m *Modal) SetError(err string)
- func (m *Modal) SetValue(v string)
- func (m *Modal) TogglePublic()
- func (m *Modal) UpdateTextInput(msg interface{})
- func (m *Modal) Value() string
- func (m *Modal) View(totalW, totalH int) string
- type ModalAction
- type ModalCloseMsg
- type ModalType
- type Pane
- type ShortcutGroup
- type ShortcutItem
- type SidebarTab
- type UserList
- func (ul *UserList) ClearDMUnread(channel string)
- func (ul *UserList) MoveDown()
- func (ul *UserList) MoveUp()
- func (ul *UserList) SelectIndex(i int)
- func (ul *UserList) SelectedDMChannel() string
- func (ul *UserList) SelectedUsername() string
- func (ul *UserList) SetDMMapping(dms []sharkfin.DM, myUsername string)
- func (ul *UserList) SetDMUnread(channel string, count int)
- func (ul *UserList) SetSize(w, h int)
- func (ul *UserList) SetUsers(users []sharkfin.User)
- func (ul *UserList) UpdatePresence(username string, online bool)
- func (ul UserList) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChatKeyBindings ¶
func ChatKeyBindings() ui.KeyBindingSet
ChatKeyBindings returns the bindings shown in the bottom help bar.
Types ¶
type ChannelList ¶
type ChannelList struct {
// contains filtered or unexported fields
}
func NewChannelList ¶
func NewChannelList() ChannelList
func (*ChannelList) ClearUnread ¶
func (cl *ChannelList) ClearUnread(channel string)
func (*ChannelList) FindByName ¶
func (cl *ChannelList) FindByName(name string) (sharkfin.Channel, bool)
FindByName returns the channel and true if found, or zero value and false.
func (*ChannelList) HasUnreads ¶
func (cl *ChannelList) HasUnreads() bool
func (*ChannelList) IncrementMention ¶
func (cl *ChannelList) IncrementMention(channel string)
func (*ChannelList) IncrementUnread ¶
func (cl *ChannelList) IncrementUnread(channel string)
func (*ChannelList) IsMember ¶
func (cl *ChannelList) IsMember() bool
func (*ChannelList) MoveDown ¶
func (cl *ChannelList) MoveDown()
func (*ChannelList) MoveUp ¶
func (cl *ChannelList) MoveUp()
func (*ChannelList) Names ¶
func (cl *ChannelList) Names() []string
Names returns all channel names.
func (*ChannelList) SelectByName ¶
func (cl *ChannelList) SelectByName(name string) bool
SelectByName selects a channel by name. Returns true if found.
func (*ChannelList) SelectIndex ¶
func (cl *ChannelList) SelectIndex(i int)
func (*ChannelList) Selected ¶
func (cl *ChannelList) Selected() string
func (*ChannelList) SetChannels ¶
func (cl *ChannelList) SetChannels(channels []sharkfin.Channel)
func (*ChannelList) SetCounts ¶
func (cl *ChannelList) SetCounts(channel string, unread, mentions int)
func (*ChannelList) SetSize ¶
func (cl *ChannelList) SetSize(w, h int)
func (ChannelList) View ¶
func (cl ChannelList) View() string
type ChannelSelectedMsg ¶
type ChannelSelectedMsg struct {
Name string
}
type ChatModel ¶
type ChatModel struct {
// contains filtered or unexported fields
}
ChatModel is the root Bubble Tea model for the chat UI.
type DMList ¶
type DMList struct {
// contains filtered or unexported fields
}
func (*DMList) ClearUnread ¶
func (*DMList) HasUnreads ¶
func (*DMList) IncrementMention ¶
func (*DMList) IncrementUnread ¶
func (*DMList) Participant ¶
func (*DMList) SelectByChannel ¶
func (*DMList) SelectIndex ¶
type InputBar ¶
type InputBar struct {
// contains filtered or unexported fields
}
func NewInputBar ¶
func NewInputBar() InputBar
func (*InputBar) InsertNewline ¶
func (ib *InputBar) InsertNewline()
func (*InputBar) InsertString ¶
func (*InputBar) SetReadOnly ¶
func (*InputBar) TryComplete ¶
TryComplete attempts @mention tab-completion against the given usernames. Works on the current line at the cursor position.
func (*InputBar) UpdateTextInput ¶
func (ib *InputBar) UpdateTextInput(msg interface{})
type MessagePane ¶
type MessagePane struct {
// contains filtered or unexported fields
}
func NewMessagePane ¶
func NewMessagePane() MessagePane
func (*MessagePane) AppendMessage ¶
func (mp *MessagePane) AppendMessage(channel string, msg sharkfin.Message)
func (*MessagePane) AtTop ¶
func (mp *MessagePane) AtTop() bool
AtTop returns true if the viewport is scrolled to the top.
func (*MessagePane) Channel ¶
func (mp *MessagePane) Channel() string
Channel returns the currently displayed channel name.
func (*MessagePane) Height ¶
func (mp *MessagePane) Height() int
Height returns the inner height of the message pane in lines.
func (*MessagePane) LatestID ¶
func (mp *MessagePane) LatestID(channel string) int
LatestID returns the largest message ID for the channel, or 0 if none.
func (*MessagePane) MergeMessages ¶
func (mp *MessagePane) MergeMessages(channel string, msgs []sharkfin.Message)
MergeMessages adds messages not already present, maintaining sort order by ID.
func (*MessagePane) OldestID ¶
func (mp *MessagePane) OldestID(channel string) int
OldestID returns the smallest message ID for the channel, or 0 if none.
func (*MessagePane) PrependHistory ¶
func (mp *MessagePane) PrependHistory(channel string, msgs []sharkfin.Message)
PrependHistory adds older messages to the front, preserving scroll position.
func (*MessagePane) ScrollDown ¶
func (mp *MessagePane) ScrollDown(n int)
func (*MessagePane) ScrollUp ¶
func (mp *MessagePane) ScrollUp(n int)
func (*MessagePane) SetChannel ¶
func (mp *MessagePane) SetChannel(name string)
func (*MessagePane) SetSize ¶
func (mp *MessagePane) SetSize(w, h int)
func (MessagePane) View ¶
func (mp MessagePane) View() string
type Modal ¶
type Modal struct {
Type ModalType
// contains filtered or unexported fields
}
Modal holds the state for overlay modals.
func (*Modal) HitTest ¶
func (m *Modal) HitTest(screenX, screenY int) ModalAction
HitTest checks if screen coordinates (x, y) land on a modal button.
func (*Modal) TogglePublic ¶
func (m *Modal) TogglePublic()
func (*Modal) UpdateTextInput ¶
func (m *Modal) UpdateTextInput(msg interface{})
type ModalAction ¶
type ModalAction int
ModalAction identifies a clickable modal button action.
const ( ModalActionNone ModalAction = iota ModalActionSubmit ModalActionToggle ModalActionCancel )
type ModalCloseMsg ¶
type ModalCloseMsg struct{}
type ShortcutGroup ¶
type ShortcutGroup struct {
Title string
Items []ShortcutItem
}
ShortcutGroup is a named group of shortcuts.
func AllShortcuts ¶
func AllShortcuts() []ShortcutGroup
AllShortcuts returns the full list of shortcuts for the shortcuts modal.
type ShortcutItem ¶
ShortcutItem is a single shortcut entry.
type SidebarTab ¶
type SidebarTab int
SidebarTab identifies which sidebar list is visible.
const ( TabChannels SidebarTab = iota TabDMs TabUsers )
type UserList ¶
type UserList struct {
// contains filtered or unexported fields
}
func NewUserList ¶
func (*UserList) ClearDMUnread ¶
func (*UserList) SelectIndex ¶
func (*UserList) SelectedDMChannel ¶
SelectedDMChannel returns the DM channel for the selected user, or "".
func (*UserList) SelectedUsername ¶
SelectedUsername returns the username at the cursor.
func (*UserList) SetDMMapping ¶
SetDMMapping updates the username -> DM channel mapping from the DM list.
func (*UserList) SetDMUnread ¶
func (*UserList) UpdatePresence ¶
UpdatePresence updates a single user's online status and re-sorts.