ui

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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 AdFlyerPage

func AdFlyerPage(d AdFlyerData) 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

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

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

func AdShareModal

func AdShareModal(path, flyerHref string) g.Node

func AdUnavailable

func AdUnavailable() []g.Node

func AdminContent

func AdminContent(activeTab string) g.Node

func AdminContentWithClicks

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

func AdminContentWithEmbeddings

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

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

func AdminDashboardContainerWithEmbeddings

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

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

func Autofocus

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 CategorySelect

func CategorySelect(selected CategoryOption, categories []CategoryOption,
	returnParam string) g.Node

func ChangePhoneRequestForm

func ChangePhoneRequestForm() g.Node

func ChangePhoneSection

func ChangePhoneSection() g.Node

func ChangePhoneSuccess

func ChangePhoneSuccess(userName, phoneE64 string) g.Node

func ChangePhoneVerifySection

func ChangePhoneVerifySection(phoneE64 string) g.Node

func ClicksTab

func ClicksTab(d ClickAdminData) g.Node

func CloseEventMessage

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

CloseEventMessage renders a journal entry for ad/account deletion.

func CloseRockThrowModalsOOB

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

func ConversationContentInputClearSwapOOB(conversationID int) g.Node

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

func ConversationEmptyMessageDeleteSwapOOB

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

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

func ConversationListSSESink() g.Node

func ConversationMessageActionsBanner

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

func ConversationMessageActionsSwapOOB

func ConversationMessageActionsSwapOOB(d ConversationModalData) g.Node

func ConversationMessageAppendOOB

func ConversationMessageAppendOOB(conversationID int) g.Node

func ConversationMessagesAppendSwapForTest

func ConversationMessagesAppendSwapForTest() string

ConversationMessagesAppendSwapForTest exposes the append swap spec for tests.

func ConversationMessagesArea

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

func ConversationMessagesPanel

func ConversationMessagesPanel(d ConversationModalData) g.Node

func ConversationMessagesSelector

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

func ConversationModalWithRock(d ConversationModalData) g.Node

func ConversationSSESink

func ConversationSSESink(conversationID int) g.Node

func CopyButton

func CopyButton(path string) g.Node

func CopyButtonCopied

func CopyButtonCopied(path string) g.Node

func DeleteAccountConfirmModal

func DeleteAccountConfirmModal(csrfToken string) g.Node

func DonatePage

func DonatePage() []g.Node

func EditAd

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

func EmbeddingActivityRows

func EmbeddingActivityRows(id string, rows []EmbeddingActivityRow) g.Node

func EmbeddingsTab

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

func FAQSectionIDs() []string

func FilterToggle

func FilterToggle(expanded bool) g.Node

func FunStatsPage

func FunStatsPage(d FunStatsData) []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, categories []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, categories []CategoryOption,
	fields g.Node) []g.Node

func NoInAreaMatchesMessage

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

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

func NotificationsSSESink

func NotificationsSSESink() g.Node

func NotificationsSection

func NotificationsSection(smsOptedOut bool) g.Node

func NotificationsSectionSwapOOB

func NotificationsSectionSwapOOB(smsOptedOut bool) g.Node

func OutsideAreaHeading

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

func PasswordField(view PasswordFieldView) g.Node

PasswordField renders a password input with an HTMX visibility toggle.

func PrivacyPolicyPage

func PrivacyPolicyPage() []g.Node

func RecoverExpiredPanel

func RecoverExpiredPanel() g.Node

func RecoverFailedPanel

func RecoverFailedPanel(message string) g.Node

func RecoverPage

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

func RecoverResetForm

func RecoverResetForm(username string) g.Node

func RecoverUnavailablePage

func RecoverUnavailablePage() []g.Node

func RecoverWaitingPanel

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

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

func RockCountBadge(rockCount int) g.Node

RockCountBadge shows user's remaining rocks

func RockEventMessage

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

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

func RockIcons

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

func RockOpinionModal(d RockOpinionModalData) g.Node

RockOpinionModal renders the cached or generated dispute assessment.

func RockThrowConfirmModal

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

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

func SSEEventConversation(conversationID int) string

func SearchArea

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

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, categories []CategoryOption,
	filterFacets []facet.Def, filters uiads.SearchFilters,
	results []g.Node) g.Node

func SearchLocationModal

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

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

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

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

SetAdImageURLFunc registers the resolver used by image templates.

func SetUserAccountPictureURLFunc

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

func StaticRockIcons(rockCount int) g.Node

func TermsOfServicePage

func TermsOfServicePage() []g.Node

func TurnstileWidget

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

func UnreadSSESink() g.Node

func UserAccountPictureBanner

func UserAccountPictureBanner(d UserProfileData) g.Node

UserAccountPictureBanner shows the optional full-width account picture.

func UserAccountPictureSrc

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

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

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

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 AdFlyerData

type AdFlyerData struct {
	ID           int
	ImageCount   int
	PriceDisplay string
	HasPrice     bool
	Title        string
	Location     string
	Description  string
	FacetLabel   string
	FacetDetails []string
	Tags         []string
	AdURL        string
}

AdFlyerData holds presentation fields for the print-only ad flyer.

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

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

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

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

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

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

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

EmbeddingAdminData holds presentation fields for the embeddings admin tab.

type EmbeddingCachePanel

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 FunStatsData

type FunStatsData struct {
	Months []FunStatsMonth
}

FunStatsData holds presentation fields for /funstats.

type FunStatsMonth

type FunStatsMonth struct {
	Label              string
	RegisteredUsers    int
	UsersWithActiveAds int
	ActiveAds          int
}

FunStatsMonth is one month on the public fun stats graphs.

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

type MissingEmbeddingRow struct {
	AdID         int
	Title        string
	CategoryName string
}

MissingEmbeddingRow holds one ad awaiting vector indexing.

type PasswordFieldView

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

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

type RockEventKind int

RockEventKind identifies a rock journal entry type.

const (
	RockEventThrown RockEventKind = iota
	RockEventUnthrown
)

type RockOpinionModalData

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

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

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 UserOption

type UserOption struct {
	ID   int
	Name string
}

UserOption holds presentation fields for an admin user picker item.

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