ui

package
v0.0.93 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSEEventUnread           = "unread"
	SSEEventConversationList = "conversation-list"
	SSEEventNotifications    = "notifications"
)

Named SSE events — listeners exist only when the matching UI is mounted, so missing-target OOB errors are avoided on other pages.

View Source
const (
	SettingsChangePasswordErrorID = "change-password-error"
	SettingsChangePhoneErrorID    = "change-phone-error"
	SettingsDeleteAccountErrorID  = "delete-account-error"
	SettingsAccountPictureErrorID = "account-picture-error"
)
View Source
const (
	ViewGrid int = iota + 1
	ViewList
)

View types

View Source
const RecoverPasswordErrorID = "recover-password-error"

Variables

This section is empty.

Functions

func AboutPage

func AboutPage() []g.Node

func AccountPictureSection added in v0.0.72

func AccountPictureSection(userID int, hasPicture bool,
	pictureURL, errMsg string) g.Node

AccountPictureSection is the settings block for upload/URL/remove.

func Ad(d AdDetail, userID int, csrfToken string) []g.Node

func AdGridNode

func AdGridNode(userID, adID, imageCount, nextPage int, priceDisplay, title,
	location, facetLabel, csrfToken string, hasPrice bool, createdAt time.Time,
	active, bookmarked, isLast bool, rockCount int) g.Node

func AdImageSrc added in v0.0.56

func AdImageSrc(adID, index int, size string) string

AdImageSrc returns a reused PresignGet URL, or "" when the object is missing.

func AdListNode

func AdListNode(userID, adID int, priceDisplay, title, location,
	facetLabel string, hasPrice bool, createdAt time.Time, active, bookmarked bool,
	csrfToken string, isLast bool, nextPage int, rockCount int) g.Node

func AdNodes

func AdNodes(cards []AdCard, userID, view, page int, csrfToken string,
	pagination bool) []g.Node

AdNodes renders search or list ad cards into gomponents nodes.

func AdRemoveModal added in v0.0.44

func AdRemoveModal(adID int, csrfToken string) g.Node

func AdShareModal

func AdShareModal(path string) g.Node

func AdUnavailable added in v0.0.44

func AdUnavailable() []g.Node

func AdminContent

func AdminContent(activeTab string) g.Node

func AdminContentWithClicks added in v0.0.18

func AdminContentWithClicks(activeTab string, clicks ClickAdminData) g.Node

func AdminContentWithEmbeddings added in v0.0.18

func AdminContentWithEmbeddings(activeTab string,
	emb EmbeddingAdminData) g.Node

func AdminContentWithQueue

func AdminContentWithQueue(activeTab string, queueStats QueueStats,
	queueEntries []SMSQueueEntry) g.Node

func AdminDashboardContainer

func AdminDashboardContainer(activeTab string) g.Node

func AdminDashboardContainerWithClicks added in v0.0.18

func AdminDashboardContainerWithClicks(activeTab string,
	clicks ClickAdminData) g.Node

func AdminDashboardContainerWithEmbeddings added in v0.0.18

func AdminDashboardContainerWithEmbeddings(activeTab string,
	emb EmbeddingAdminData) g.Node

func AdminDashboardContainerWithQueue

func AdminDashboardContainerWithQueue(activeTab string, queueStats QueueStats,
	queueEntries []SMSQueueEntry) g.Node

func AdminDashboardPage

func AdminDashboardPage(stats QueueStats,
	entries []SMSQueueEntry) []g.Node

func AdminSettingsTab

func AdminSettingsTab() g.Node

func AdminTabs

func AdminTabs(activeTab string) g.Node

func AdsContent added in v0.0.71

func AdsContent(view int, adNodes []g.Node) g.Node

func Autofocus added in v0.0.43

func Autofocus() g.Node

Autofocus marks a field for initial focus. HTMX focuses [autofocus] after swaps.

func BookmarkButton

func BookmarkButton(adID int, bookmarked bool, csrfToken string) g.Node

func CategoryItem

func CategoryItem(currentCategoryID, categoryID int, name, imageFile,
	returnParam string) g.Node

func CategorySelectModal

func CategorySelectModal(selectedID int, returnParam string,
	categories []CategoryOption) g.Node

func ChangePhoneRequestForm added in v0.0.48

func ChangePhoneRequestForm() g.Node

func ChangePhoneSection added in v0.0.48

func ChangePhoneSection() g.Node

func ChangePhoneSuccess added in v0.0.48

func ChangePhoneSuccess(userName, phoneE64 string) g.Node

func ChangePhoneVerifySection added in v0.0.48

func ChangePhoneVerifySection(phoneE64 string) g.Node

func ClicksTab added in v0.0.18

func ClicksTab(d ClickAdminData) g.Node

func CloseEventMessage added in v0.0.44

func CloseEventMessage(d CloseEventData, attrs ...g.Node) g.Node

CloseEventMessage renders a journal entry for ad/account deletion.

func CloseRockThrowModalsOOB added in v0.0.87

func CloseRockThrowModalsOOB() []g.Node

CloseRockThrowModalsOOB removes confirm/preview modals after a successful throw.

func ConversationContentInput

func ConversationContentInput(conversationID int, attrs ...g.Node) g.Node

func ConversationContentInputClearSwapOOB added in v0.0.42

func ConversationContentInputClearSwapOOB(conversationID int) g.Node

ConversationContentInputClearSwapOOB replaces the message input with an empty field after send.

func ConversationEmptyMessageDeleteSwapOOB added in v0.0.43

func ConversationEmptyMessageDeleteSwapOOB(conversationID int) g.Node

ConversationEmptyMessageDeleteSwapOOB removes the empty-state placeholder when the first message is appended.

func ConversationForm

func ConversationForm(conversationID, adID int, csrfToken string,
	canPost bool, disabledPlaceholder string, extraAttrs ...g.Node) g.Node

func ConversationFormSwapOOB added in v0.0.44

func ConversationFormSwapOOB(conversationID, adID int, csrfToken string,
	canPost bool) g.Node

func ConversationListItem

func ConversationListItem(d ConversationListItemData) g.Node

func ConversationListItemSwapOOB

func ConversationListItemSwapOOB(conversationID int,
	conversationItemNode g.Node) g.Node

func ConversationListSSESink added in v0.0.43

func ConversationListSSESink() g.Node

func ConversationMessageActionsBanner added in v0.0.42

func ConversationMessageActionsBanner(d ConversationModalData,
	extraAttrs ...g.Node) g.Node

func ConversationMessageActionsSwapOOB added in v0.0.42

func ConversationMessageActionsSwapOOB(d ConversationModalData) g.Node

func ConversationMessageAppendOOB added in v0.0.43

func ConversationMessageAppendOOB(conversationID int) g.Node

func ConversationMessagesAppendSwapForTest added in v0.0.43

func ConversationMessagesAppendSwapForTest() string

ConversationMessagesAppendSwapForTest exposes the append swap spec for tests.

func ConversationMessagesArea added in v0.0.42

func ConversationMessagesArea(conversationID int, canPost bool,
	messageNodes []g.Node, extraAttrs ...g.Node) g.Node

func ConversationMessagesPanel added in v0.0.42

func ConversationMessagesPanel(d ConversationModalData) g.Node

func ConversationMessagesSelector added in v0.0.43

func ConversationMessagesSelector(conversationID int) string

func ConversationModalSwapOOB

func ConversationModalSwapOOB(d ConversationModalData) g.Node

ConversationModalSwapOOB returns the modal div with hx-swap-oob="outerHTML". Used when the first message creates a conversation.

func ConversationModalWithRock added in v0.0.35

func ConversationModalWithRock(d ConversationModalData) g.Node

func ConversationSSESink added in v0.0.43

func ConversationSSESink(conversationID int) g.Node

func CopyButton

func CopyButton(path string) g.Node

func CopyButtonCopied

func CopyButtonCopied(path string) g.Node

func DeleteAccountConfirmModal added in v0.0.44

func DeleteAccountConfirmModal(csrfToken string) g.Node

func DonatePage added in v0.0.93

func DonatePage() []g.Node

func EditAd

func EditAd(category CategoryOption, cfg uiads.AdFormConfig,
	fields g.Node) []g.Node

func EmbeddingsTab added in v0.0.18

func EmbeddingsTab(d EmbeddingAdminData) g.Node

func ErrorDiv

func ErrorDiv(errMsg string) g.Node

func ErrorDivWithID

func ErrorDivWithID(id, errMsg string) g.Node

func ErrorPageContent

func ErrorPageContent(code int, message string) []g.Node

ErrorPageContent returns the content for error pages

func FAQPage

func FAQPage(expandedSection string) []g.Node

func FAQSectionIDs added in v0.0.91

func FAQSectionIDs() []string

func FilterToggle

func FilterToggle(expanded bool) g.Node

func GenerateSVG

func GenerateSVG(adID, imageID int, size, class string) g.Node

GenerateSVG is a missing-image placeholder sized like an <img> via class.

func GetViewName

func GetViewName(view int) string

func HomePage

func HomePage(userID, view int, q string, filtersExpanded, searchVisible bool,
	category CategoryOption, filterFacets []facet.Def, filters uiads.SearchFilters,
	results []g.Node) []g.Node

func ImageFullScreen

func ImageFullScreen(adID, current, count int, size string) g.Node

func ImageFullScreenUpdate

func ImageFullScreenUpdate(adID, current, count int, size string) g.Node

func ImageNode

func ImageNode(adID, count, current int, size, heightClass string,
	clickable bool) g.Node

func ImageNodeWithThumbnails

func ImageNodeWithThumbnails(adID, count, current int, size, heightClass string,
	clickable bool) g.Node

func ImageThumbnails

func ImageThumbnails(adID, current, count int, size, heightClass string,
	clickable bool) g.Node

func LoginForm

func LoginForm(returnPath string) g.Node

func LoginPage

func LoginPage(returnPath string) []g.Node

func MessageItem

func MessageItem(d MessageItemData, attrs ...g.Node) g.Node

func MessageTimeline

func MessageTimeline(messages []MessageItemData,
	rocks []RockEventData, closes []CloseEventData) []g.Node

MessageTimeline renders chat messages with rock and close journal entries inserted chronologically. Timestamps must already be in the viewer's timezone.

func MessagesPage

func MessagesPage(items []ConversationListItemData) []g.Node

func MyAdsContainer

func MyAdsContainer(activeTab string, view int, adNodes []g.Node) g.Node

func MyAdsPage

func MyAdsPage(activeTab string, view int, adNodes []g.Node) []g.Node

func MyAdsTabs

func MyAdsTabs(activeTab string) g.Node

func NewAd

func NewAd(category CategoryOption, fields g.Node) []g.Node

func NoInAreaMatchesMessage added in v0.0.20

func NoInAreaMatchesMessage(within int, unit, location string) g.Node

NoInAreaMatchesMessage is shown when geo search has no matches in the within area.

func NotificationsSSESink added in v0.0.84

func NotificationsSSESink() g.Node

func NotificationsSection

func NotificationsSection(smsOptedOut bool) g.Node

func NotificationsSectionSwapOOB added in v0.0.84

func NotificationsSectionSwapOOB(smsOptedOut bool) g.Node

func OutsideAreaHeading added in v0.0.20

func OutsideAreaHeading() g.Node

OutsideAreaHeading separates in-area from out-of-area search results.

func Page

func Page(userID int, hasUnread bool, userName, title, currentPath,
	csrfToken string, showIntroBanner bool, body []g.Node) g.Node

func PasswordField added in v0.0.20

func PasswordField(view PasswordFieldView) g.Node

PasswordField renders a password input with an HTMX visibility toggle.

func PrivacyPolicyPage added in v0.0.76

func PrivacyPolicyPage() []g.Node

func RecoverExpiredPanel added in v0.0.51

func RecoverExpiredPanel() g.Node

func RecoverFailedPanel added in v0.0.51

func RecoverFailedPanel(message string) g.Node

func RecoverPage added in v0.0.51

func RecoverPage(code, twilioFrom string, expiresAt time.Time) []g.Node

func RecoverResetForm added in v0.0.51

func RecoverResetForm(username string) g.Node

func RecoverUnavailablePage added in v0.0.51

func RecoverUnavailablePage() []g.Node

func RecoverWaitingPanel added in v0.0.51

func RecoverWaitingPanel(code, twilioFrom string, expiresAt time.Time) g.Node

func RegisterForm

func RegisterForm(username string) g.Node

func RegisterPage

func RegisterPage(username string) []g.Node

func RegisterPassword

func RegisterPassword(username, phoneE64 string) g.Node

func RegisterVerify

func RegisterVerify(username, phoneE64 string) g.Node

func RemoveIntroBanner added in v0.0.37

func RemoveIntroBanner() g.Node

func RemoveModal

func RemoveModal(name string) []g.Node

RemoveModal returns swap-oob delete elements to remove a modal and its backdrop

func RockCountBadge added in v0.0.35

func RockCountBadge(rockCount int) g.Node

RockCountBadge shows user's remaining rocks

func RockEventMessage added in v0.0.42

func RockEventMessage(d RockEventData, attrs ...g.Node) g.Node

RockEventMessage renders a journal entry for a rock throw or unthrow.

func RockIcons added in v0.0.35

func RockIcons(adID int, rockCount int) g.Node

RockIcons renders clickable rock icons for an ad Each icon links to a rock by ordinal position Only shows rocks bound to the ad (when inquirer throws)

func RockOpinionLink(conversationID int) g.Node

RockOpinionLink renders a link for participants to view the assessment.

func RockOpinionModal added in v0.0.35

func RockOpinionModal(d RockOpinionModalData) g.Node

RockOpinionModal renders the cached or generated dispute assessment.

func RockThrowConfirmModal added in v0.0.87

func RockThrowConfirmModal(d RockThrowConfirmData) g.Node

RockThrowConfirmModal is a single scrollable confirm before throwing a rock.

func RockThrowLink(d ConversationModalData) g.Node

RockThrowLink renders a button to throw/unthrow a rock in the conversation modal

func RockThrowPreviewModal added in v0.0.87

func RockThrowPreviewModal(d RockThrowPreviewData) g.Node

RockThrowPreviewModal is a stacked modal for pre-throw dispute assessment.

func SMSQueueFilters

func SMSQueueFilters() g.Node

func SMSQueueRow

func SMSQueueRow(entry SMSQueueEntry) g.Node

func SMSQueueRows

func SMSQueueRows(entries []SMSQueueEntry) g.Node

func SMSQueueStats

func SMSQueueStats(stats QueueStats) g.Node

func SMSQueueTab

func SMSQueueTab(stats QueueStats, entries []SMSQueueEntry) g.Node

func SMSQueueTableHeader

func SMSQueueTableHeader() g.Node

func SMSQueueTableWithEntries

func SMSQueueTableWithEntries(entries []SMSQueueEntry) g.Node

func SSEEventConversation added in v0.0.43

func SSEEventConversation(conversationID int) string

func SearchArea added in v0.0.22

func SearchArea(q string, expanded bool, filterFacets []facet.Def,
	filters uiads.SearchFilters, searchVisible bool) g.Node

SearchArea renders the search box, filter toggle, and optional expanded facets.

func SearchAreaOOB added in v0.0.22

func SearchAreaOOB(q string, expanded bool, filterFacets []facet.Def,
	filters uiads.SearchFilters, searchVisible bool) g.Node

SearchAreaOOB swaps #search-area when the filter panel is shown or hidden.

func SearchContainer

func SearchContainer(userID, view int, q string, filtersExpanded,
	searchVisible bool, category CategoryOption, filterFacets []facet.Def,
	filters uiads.SearchFilters, results []g.Node) g.Node

func SearchLocationModal added in v0.0.20

func SearchLocationModal(f uiads.SearchFilters) g.Node

SearchLocationModal renders the modal to edit location and within distance.

func SearchResults

func SearchResults(view int, results []g.Node) g.Node

func SearchResultsEmptyMessage added in v0.0.20

func SearchResultsEmptyMessage() g.Node

SearchResultsEmptyMessage is the standard no-results copy for search grids.

func SearchResultsOOB

func SearchResultsOOB(view int, results []g.Node) g.Node

SearchResultsOOB swaps #search-results out-of-band (show/hide filters).

func SearchResultsResponse

func SearchResultsResponse(view, page int, results []g.Node) g.Node

SearchResultsResponse is the HTMX body for /api/search/. Page 1: #search-results with sorry message or first page of ads. Page 2+: ad nodes only (replaces the scroll sentinel).

func SearchToggleOOB added in v0.0.23

func SearchToggleOOB(searchVisible bool) g.Node

SearchToggleOOB swaps #search-toggle out-of-band after show/hide search.

func SearchView

func SearchView(view int, filters uiads.SearchFilters, results []g.Node) g.Node

func SearchWidget

func SearchWidget(userID, view int, q string, filtersExpanded,
	searchVisible bool, category CategoryOption, filterFacets []facet.Def,
	filters uiads.SearchFilters, results []g.Node) g.Node

func SetAdImageURLFunc added in v0.0.56

func SetAdImageURLFunc(f func(adID, index int, size string) string)

SetAdImageURLFunc registers the resolver used by image templates.

func SetUserAccountPictureURLFunc added in v0.0.72

func SetUserAccountPictureURLFunc(f func(userID int) string)

SetUserAccountPictureURLFunc registers the resolver for account pictures.

func SettingsPage

func SettingsPage(name, phoneE64 string, smsOptedOut bool,
	userID int, hasAccountPicture bool, accountPictureURL string) []g.Node
func SiteFooter() g.Node

func StaticRockIcons added in v0.0.43

func StaticRockIcons(rockCount int) g.Node

func TermsOfServicePage added in v0.0.76

func TermsOfServicePage() []g.Node

func TurnstileWidget added in v0.0.79

func TurnstileWidget() g.Node

TurnstileWidget renders Cloudflare Turnstile when keys are configured and enforcement is required (not under ALLOW_TEST_REGISTRATION).

func UnreadIndicatorSwapOOB

func UnreadIndicatorSwapOOB(hasUnread bool) g.Node

func UnreadSSESink added in v0.0.43

func UnreadSSESink() g.Node

func UserAccountPictureBanner added in v0.0.72

func UserAccountPictureBanner(d UserProfileData) g.Node

UserAccountPictureBanner shows the optional full-width account picture.

func UserAccountPictureSrc added in v0.0.72

func UserAccountPictureSrc(userID int) string

UserAccountPictureSrc returns a PresignGet URL, or "" when missing.

func UserMenu

func UserMenu(userName, memberSince string, userID int, isAdmin bool,
	hasUnread bool, rockCount int, userRockCount int) g.Node
func UserNameLink(userID int, userName string, extra ...g.Node) g.Node

UserNameLink renders a link to the user's profile with a hover popup summary

func UserProfileAds added in v0.0.71

func UserProfileAds(pathPrefix string, view int, adNodes []g.Node) g.Node

UserProfileAds is the active-ads list with grid/list toggles.

func UserProfilePage

func UserProfilePage(d UserProfileData, view int, adNodes []g.Node) []g.Node

UserProfilePage renders the user profile page body

func UserRockIcons added in v0.0.35

func UserRockIcons(userID int, rockCount int) g.Node

UserRockIcons renders clickable rock icons for a user Each icon links to a rock by ordinal position Shows rocks bound to the user (when owner throws)

func UserShareModal added in v0.0.92

func UserShareModal(path string) g.Node

func UserSummaryFragment

func UserSummaryFragment(d UserProfileData) g.Node

UserSummaryFragment is the popup content loaded on hover

func ValidFAQSection

func ValidFAQSection(id string) bool

func ValidateView

func ValidateView(viewStr string) int

func WelcomePage

func WelcomePage(rockCount int) []g.Node

Types

type AdCard

type AdCard struct {
	ID           int
	PriceDisplay string
	HasPrice     bool
	Title        string
	Location     string
	CreatedAt    time.Time
	ImageCount   int
	Active       bool
	Bookmarked   bool
	RockCount    int
	FacetLabel   string
}

AdCard holds presentation fields for an ad in search or list views.

func AdCardFromFields

func AdCardFromFields(id, imageCount, rockCount int, priceDisplay, title,
	location, facetLabel string, hasPrice bool, createdAt time.Time, active,
	bookmarked bool) AdCard

AdCardFromFields builds an AdCard from presentation field values.

type AdDetail

type AdDetail struct {
	ID                  int
	OwnerID             int
	ImageCount          int
	PriceDisplay        string
	HasPrice            bool
	Title               string
	Location            string
	DescriptionOriginal string
	DescriptionHistory  []AdHistoryEntry
	// ShowLoginForDetails is true when edit history exists but is hidden
	// until the viewer logs in.
	ShowLoginForDetails bool
	CreatedAt           time.Time
	ExpiresAt           time.Time
	Bookmarked          bool
	Active              bool
	Inactive            bool
	Deleted             bool
	IsTest              bool
	Reachable           bool
	RockCount           int
	FacetLabel          string
	FacetDetails        []string // formal facets not shown in title or price row
	Tags                []string
}

AdDetail holds presentation fields for a single ad page.

type AdHistoryEntry

type AdHistoryEntry struct {
	Header       string
	Body         string
	ImageIndices []int
}

AdHistoryEntry holds one edit-history block on the ad detail page.

type CategoryOption

type CategoryOption struct {
	ID        int
	Name      string
	ImageFile string
}

CategoryOption holds presentation fields for a category picker item.

type ClickAdRow added in v0.0.18

type ClickAdRow struct {
	AdID         int
	Title        string
	CategoryName string
	UserCount    int
	AdViews      int
	ImageClicks  int
	LastActivity string
}

ClickAdRow is one row in the top-ads table.

type ClickAdminData added in v0.0.18

type ClickAdminData struct {
	UsersWithClicks int
	AdsClicked      int
	AdDetailViews   int
	ImageNavClicks  int
	ActiveLast7Days int
	TopAds          []ClickAdRow
	TopImages       []ClickImageRow
}

ClickAdminData holds presentation fields for the clicks admin tab.

type ClickImageRow added in v0.0.18

type ClickImageRow struct {
	AdID       int
	Title      string
	ImageIndex int
	UserCount  int
	Clicks     int
	LastClick  string
}

ClickImageRow is one row in the top-images table.

type CloseEventData added in v0.0.44

type CloseEventData struct {
	Text    string
	EventAt time.Time
}

CloseEventData holds presentation fields for an ad/account close journal entry. EventAt is in the viewer's timezone.

type ConversationListItemData

type ConversationListItemData struct {
	ConversationID     int
	AdID               int
	OwnerID            int
	InquirerID         int
	CurrentUserID      int
	AdTitle            string
	LastMessageContent string
	OtherUserName      string
	LastMessageAt      *time.Time
	UpdatedAt          time.Time
	HasUnread          bool
	RockCount          int
	OtherUserRockCount int
	OtherUserDeleted   bool
}

ConversationListItemData holds presentation fields for a messages list row. LastMessageAt and UpdatedAt are in the viewer's timezone when set.

type ConversationModalData

type ConversationModalData struct {
	ConversationID    int
	AdID              int
	OwnerID           int
	InquirerID        int
	CurrentUserID     int
	InquirerRockCount int
	OwnerRockCount    int
	AdTitle           string
	OwnerName         string
	InquirerName      string
	OwnerDeleted      bool
	InquirerDeleted   bool
	CSRFToken         string
	CanPost           bool
	HasThrownRock     bool
	CanThrowRock      bool
	MessageNodes      []g.Node
	RockThrowerID     *int
	TargetModalID     string
	// DisabledInputPlaceholder overrides the closed send-field placeholder.
	DisabledInputPlaceholder string
}

ConversationModalData holds presentation fields for a conversation modal.

type EmbeddingActivityRow added in v0.0.25

type EmbeddingActivityRow struct {
	AdID         int
	AdTitle      string
	ActivityType string
	Weight       float32
	Timestamp    string
}

EmbeddingActivityRow holds one weighted activity used to build an embedding.

type EmbeddingAdminData added in v0.0.18

type EmbeddingAdminData struct {
	EmbedderProvider string
	EmbedderModel    string
	EmbeddedCount    int
	MissingCount     int
	QueueDepth       int
	Caches           []EmbeddingCachePanel
	MissingAds       []MissingEmbeddingRow
	CategoryID       int
	Categories       []CategoryOption
	UserActivities   []EmbeddingActivityRow
	SiteActivities   []EmbeddingActivityRow
}

EmbeddingAdminData holds presentation fields for the embeddings admin tab.

type EmbeddingCachePanel added in v0.0.18

type EmbeddingCachePanel struct {
	Name       string
	Hits       int64
	Misses     int64
	HitRatePct float64
	ItemCount  int64
	MemoryKB   float64
}

EmbeddingCachePanel holds cache metrics for one embedding cache tier.

type MessageItemData

type MessageItemData struct {
	SenderID      int
	CurrentUserID int
	Content       string
	CreatedAt     time.Time
}

MessageItemData holds presentation fields for a single chat message. CreatedAt is in the viewer's timezone.

type MissingEmbeddingRow added in v0.0.18

type MissingEmbeddingRow struct {
	AdID         int
	Title        string
	CategoryName string
}

MissingEmbeddingRow holds one ad awaiting vector indexing.

type PasswordFieldView added in v0.0.20

type PasswordFieldView struct {
	Name         string
	ID           string // DOM id stem; defaults to Name when empty
	Autocomplete string
	Value        string
	Visible      bool
	Autofocus    bool
	// PreventAutofill uses readonly-until-focus so password managers
	// don't fill the field on page load (e.g. change-password forms
	// that also include a username for the save prompt).
	PreventAutofill bool
}

PasswordFieldView holds state for a password input with visibility toggle.

type QueueStats

type QueueStats struct {
	Pending    int
	Processed  int
	Suppressed int
}

QueueStats holds SMS queue counts for the admin dashboard.

type RockEventData added in v0.0.35

type RockEventData struct {
	ConversationID     int
	ThrowerID          int
	CurrentUserID      int
	Kind               RockEventKind
	EventAt            time.Time
	OwnerID            int
	InquirerID         int
	OwnerName          string
	InquirerName       string
	Reason             string
	ShowAssessmentHint bool
}

RockEventData holds presentation fields for a rock journal timeline entry. EventAt is in the viewer's timezone.

type RockEventKind added in v0.0.42

type RockEventKind int

RockEventKind identifies a rock journal entry type.

const (
	RockEventThrown RockEventKind = iota
	RockEventUnthrown
)

type RockOpinionModalData added in v0.0.35

type RockOpinionModalData struct {
	ConversationID   int
	AdID             int
	AdTitle          string
	Unavailable      bool
	Summary          string
	AssessmentScore  int
	AssessmentDetail string
	Resolution       string
	Reasoning        string
	AdFacts          []string
	GeneratedAt      *time.Time
}

RockOpinionModalData holds presentation fields for a dispute assessment modal. Party identities are never shown; roles are Owner / Inquirer only.

type RockThrowConfirmData added in v0.0.87

type RockThrowConfirmData struct {
	ConversationID int
	AdID           int
	CSRFToken      string
	Remaining      int
	ThrowLabel     string
	// AtAd is true when the inquirer is throwing at the listing.
	AtAd bool
	// OtherUserID / OtherName are the counterparty (ad owner when AtAd, else inquirer).
	OtherUserID int
	OtherName   string
}

RockThrowConfirmData drives the pre-throw confirmation modal.

type RockThrowPreviewData added in v0.0.87

type RockThrowPreviewData struct {
	Unavailable      bool
	Summary          string
	AssessmentScore  int
	AssessmentDetail string
	Resolution       string
	Reasoning        string
}

RockThrowPreviewData is the inline assessment preview inside the confirm modal.

type SMSQueueEntry

type SMSQueueEntry struct {
	ID          int
	AdTitle     string
	Status      string
	CreatedAt   string
	ProcessedAt *string
}

SMSQueueEntry represents a queue entry for UI rendering

func SMSQueueEntriesFrom

func SMSQueueEntriesFrom(entries []SMSQueueEntryInput) []SMSQueueEntry

type SMSQueueEntryInput

type SMSQueueEntryInput struct {
	ID          int
	AdTitle     string
	Status      string
	CreatedAt   time.Time
	ProcessedAt *time.Time
}

SMSQueueEntryInput holds raw queue entry fields for UI formatting.

type UserProfileData

type UserProfileData struct {
	ID                int
	Name              string
	MemberSince       string
	ActiveAdCount     int
	UserRockCount     int
	HasAccountPicture bool
	AccountPictureURL string
	ShowShare         bool
	AdsViewPathPrefix string
}

UserProfileData holds presentation fields for a user profile or summary.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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