Documentation
¶
Overview ¶
Package reactionpicker is the one-row chooser that `+` opens over the cursored message.
A row rather than a palette command. Reacting is a thing you do TO a message, and the message is already under the cursor — routing it through `:` would mean naming the message a second time, in a surface that has no idea which one you meant.
A fixed set rather than the account's own. Telegram serves a global list and lets a chat narrow it, so the honest set for a chat is two requests away, and a chooser that has to load is a chooser you press and then wait at. These twelve are Telegram's own defaults, in its own order; a chat that has narrowed its set refuses the ones it does not allow, and the refusal says so.
Index ¶
- Variables
- func Width() int
- type CancelledMsg
- type ChosenMsg
- type Model
- func (m *Model) Close()
- func (m Model) IsVisible() bool
- func (m Model) Mine() string
- func (m *Model) Open(chatID, messageID int64, mine string)
- func (m *Model) SetHints(hints []hintbar.Hint)
- func (m *Model) SetRoles(r theme.Roles)
- func (m *Model) SetWidth(w int)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
Constants ¶
This section is empty.
Variables ¶
var Reactions = []string{"👍", "👎", "❤", "🔥", "🎉", "🤩", "😁", "🤔", "😢", "🙏", "👏", "🤯"}
Reactions is the set offered, in Telegram's own order of popularity.
Twelve, because the row has to fit a narrow thread and because a chooser long enough to need scrolling has stopped being quicker than typing.
Functions ¶
Types ¶
type ChosenMsg ¶
ChosenMsg is a reaction the user picked. Emoji is empty when they chose the one they had already left, which Telegram models as removing it.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the picker.
func (Model) Mine ¶ added in v0.0.14
Mine is the reaction this account has already left on the message the row is open over, or "" when there is none.
Exposed for the hint registry: enter TAKES OFF a reaction you already left, so a row that said "enter pick" there would be describing the opposite of what happens (decision I-6).
func (*Model) Open ¶
Open points the picker at a message. mine is the reaction this account has already left on it, or "".
func (*Model) SetHints ¶ added in v0.0.14
SetHints supplies the row's own hint strip. See hintRow's comment in mediaview for why these are handed in rather than written here.