views

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

func Base(title string, noAnim bool) templ.Component

func Diff

func Diff(d DiffData) templ.Component

func GalleryDetail

func GalleryDetail(d GalleryDetailData) templ.Component

func GalleryIndex

func GalleryIndex(d GalleryIndexData) templ.Component

func Index

func Index(d IndexData) templ.Component

Types

type AxisOption

type AxisOption struct {
	Value   string
	Active  bool
	Missing bool
	URL     string // navigation target
}

type Counts

type Counts struct {
	Total, Pending, Approved, Rejected int
}

type DiffData

type DiffData struct {
	Item      *review.Item
	AxisNames []string
	Position  int         // 1-based position among all items
	Total     int         // total items
	PrevID    string      // empty if no prev
	NextID    string      // empty if no next
	NoAnim    bool        // set by ?noanim=1 for deterministic screenshot tests
	Groups    []ItemGroup // grouped by leaf directory of Path (for left sidebar)
	Counts    Counts      // session totals (for sidebar header / progress)
}

type FilterAxisOption

type FilterAxisOption struct {
	Value    string
	Matches  int
	Disabled bool
}

FilterAxisOption is one value of an axis as it should appear in the filterbar dropdown. Available options (those that would yield at least one match given the other current filters) precede Disabled ones.

type GalleryDetailData

type GalleryDetailData struct {
	RepoLabel string

	// Identifies the "current state" — axes the user is looking at. May not
	// correspond to a real PNG (then Found is false and Placeholder is shown).
	Path        string // empty when Found is false
	FoundID     string // item ID when Found is true
	Found       bool
	AxesCurrent map[string]string
	AxisNames   []string

	Mode       string // "focused" | "matrix"
	FocusedURL string
	MatrixURL  string

	// Focused mode.
	Options map[string][]AxisOption // axis -> dropdown options

	// Matrix mode.
	Rows        string
	Cols        string
	RowVals     []string
	ColVals     []string
	Locked      []LockedAxisDisplay
	Cells       [][]MatrixCell
	AxisChoices []string // axes available for rows/cols dropdowns

	NoAnim bool
}

type GalleryIndexData

type GalleryIndexData struct {
	RepoLabel string
	Items     []GalleryItemView             // already filtered
	AxisNames []string                      // sorted
	AxisOpts  map[string][]FilterAxisOption // axis -> ordered options (available first, then disabled)
	Filter    map[string]string             // axis -> selected value (empty = "any")
	Search    string
	Matched   int
	Total     int
	NoAnim    bool
}

type GalleryItemView

type GalleryItemView struct {
	ID   string
	Path string
	Name string // basename(Path)
	Axes map[string]string
}

type IndexData

type IndexData struct {
	Items     []*review.Item
	AxisNames []string            // sorted, derived from items
	AxisVals  map[string][]string // axis -> sorted unique values
	Groups    []ItemGroup         // grouped by leaf directory of Path
	Counts    Counts
	RepoLabel string // shown in the top bar (e.g. "ios-app/")
	NoAnim    bool   // set by ?noanim=1 for deterministic screenshot tests
}

type ItemGroup

type ItemGroup struct {
	Label  string // e.g. "ProfileViewTests"
	Prefix string // namespace shown before the label
	Items  []*review.Item
	Counts Counts
}

type LockedAxisDisplay

type LockedAxisDisplay struct {
	Name   string
	Values []LockedAxisValue
}

type LockedAxisValue

type LockedAxisValue struct {
	Value  string
	Active bool
	URL    string
}

type MatrixCell

type MatrixCell struct {
	RowVal   string
	ColVal   string
	ImageURL string // /screenshot/{id}/image.png — empty when missing
	LinkURL  string // /screenshot/{id} — empty when missing
	Path     string
	Missing  bool
}

Jump to

Keyboard shortcuts

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