feed

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOptimisticRantMsg

type AddOptimisticRantMsg struct {
	Content string
}

type AddOptimisticReplyMsg

type AddOptimisticReplyMsg struct {
	LocalID  string
	ParentID string
	Content  string
}

type BlockResultMsg

type BlockResultMsg struct {
	AccountID string
	Username  string
	Err       error
}

type BlockUserMsg

type BlockUserMsg struct {
	AccountID string
	Username  string
}

type BlockedUsersLoadedMsg

type BlockedUsersLoadedMsg struct {
	Users []app.BlockedUser
	Err   error
}

type DeleteOptimisticRantMsg

type DeleteOptimisticRantMsg struct {
	ID string
}

type DeleteRantMsg

type DeleteRantMsg struct {
	ID string
}

type DeleteResultMsg

type DeleteResultMsg struct {
	ID  string
	Err error
}

DeleteResultMsg is sent after a rant deletion attempt.

type EditProfileMsg added in v0.4.0

type EditProfileMsg struct {
	UseInline bool
}

type EditRantMsg

type EditRantMsg struct {
	Rant      domain.Rant
	UseInline bool
}

EditRantMsg is sent when the user selects 'Edit' from the action menu.

type FeedPrefsChangedMsg

type FeedPrefsChangedMsg struct {
	Hashtag string
	Source  string
}

type FollowToggleMsg

type FollowToggleMsg struct {
	AccountID string
	Username  string
	Follow    bool
}

type FollowToggleResultMsg

type FollowToggleResultMsg struct {
	AccountID string
	Username  string
	Follow    bool
	Err       error
}

type HideAuthorPostsMsg

type HideAuthorPostsMsg struct {
	AccountID string
}

type LikeRantMsg

type LikeRantMsg struct {
	ID       string
	WasLiked bool
}

LikeRantMsg is sent when the user wants to like a rant.

type LikeResultMsg

type LikeResultMsg struct {
	ID  string
	Err error
}

LikeResultMsg is sent after a like attempt.

type MediaPreviewLoadedMsg

type MediaPreviewLoadedMsg struct {
	Key     string
	Preview string
	Frames  []string
	Err     error
}

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model holds the state for the feed (timeline) view.

func New

func New(timeline app.TimelineService, account app.AccountService, hashtag, initialSource string) Model

New creates a feed model with injected dependencies.

func (Model) Init

func (m Model) Init() tea.Cmd

Init starts the initial feed fetch.

func (Model) IsDialogOpen

func (m Model) IsDialogOpen() bool

IsDialogOpen reports whether a modal/overlay should capture quit/back keys.

func (Model) IsInDetailView

func (m Model) IsInDetailView() bool

IsInDetailView returns true if the detail view is active.

func (Model) Rants

func (m Model) Rants() []domain.Rant

func (Model) Refresh

func (m Model) Refresh() tea.Cmd

Refresh returns a Cmd that re-fetches the timeline.

func (Model) SelectedRant

func (m Model) SelectedRant() (domain.Rant, bool)

SelectedRant returns the currently highlighted rant, if any.

func (Model) Update

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

Update handles messages for the feed view.

func (Model) View

func (m Model) View() string

View renders the feed as a string.

type OpenDetailWithoutRepliesMsg

type OpenDetailWithoutRepliesMsg struct {
	ID string
}

type OpenProfileMsg

type OpenProfileMsg struct {
	AccountID string
}

type PrefsSavedMsg

type PrefsSavedMsg struct {
	Err error
}

type ProfileLoadedMsg

type ProfileLoadedMsg struct {
	AccountID string
	Profile   app.Profile
	Posts     []domain.Rant
	Err       error
}

type RantItem

type RantItem struct {
	Rant       domain.Rant
	Status     RantStatus
	Err        error
	OldContent string // For rollback
}

type RantStatus

type RantStatus int
const (
	StatusNormal RantStatus = iota
	StatusPendingCreate
	StatusPendingUpdate
	StatusPendingDelete
	StatusFailed
)

type RantsErrorMsg

type RantsErrorMsg struct {
	Err      error
	QueryKey string
	ReqSeq   int
}

RantsErrorMsg is sent when the timeline fetch fails.

type RantsLoadedMsg

type RantsLoadedMsg struct {
	Rants    []domain.Rant
	QueryKey string
	RawCount int
	ReqSeq   int
}

RantsLoadedMsg is sent when the timeline fetch completes successfully.

type RantsPageErrorMsg

type RantsPageErrorMsg struct {
	Err      error
	QueryKey string
	ReqSeq   int
}

RantsPageErrorMsg is sent when loading an older feed page fails.

type RantsPageLoadedMsg

type RantsPageLoadedMsg struct {
	Rants    []domain.Rant
	QueryKey string
	RawCount int
	ReqSeq   int
}

RantsPageLoadedMsg is sent when an older feed page is loaded.

type RelationshipsLoadedMsg

type RelationshipsLoadedMsg struct {
	Following map[string]bool
	Err       error
}

type ReplyRantMsg

type ReplyRantMsg struct {
	Rant      domain.Rant
	UseInline bool
}

ReplyRantMsg is sent when the user wants to reply to a rant.

type RequestBlockedUsersMsg

type RequestBlockedUsersMsg struct{}

type ResetFeedStateMsg

type ResetFeedStateMsg struct {
	ForceReset bool
}

type ResultMsg

type ResultMsg struct {
	ID         string // Local or Server ID
	Rant       domain.Rant
	IsEdit     bool
	Err        error
	OldContent string
}

ResultMsg is a generic success/fail result for creation or update.

type SwitchToTerminalRantMsg added in v0.4.0

type SwitchToTerminalRantMsg struct{}

type ThreadErrorMsg

type ThreadErrorMsg struct {
	ID  string
	Err error
}

ThreadErrorMsg is sent when a thread fetch fails.

type ThreadLoadedMsg

type ThreadLoadedMsg struct {
	ID          string
	Ancestors   []domain.Rant
	Descendants []domain.Rant
}

ThreadLoadedMsg is sent when a thread (ancestors and replies) is loaded.

type UnblockResultMsg

type UnblockResultMsg struct {
	AccountID string
	Username  string
	Err       error
}

type UnblockUserMsg

type UnblockUserMsg struct {
	AccountID string
	Username  string
}

type UpdateOptimisticRantMsg

type UpdateOptimisticRantMsg struct {
	ID      string
	Content string
}

Jump to

Keyboard shortcuts

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