appearance

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: AGPL-3.0 Imports: 10 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

Overview

Package appearance holds how a member sees the app: the light or dark theme they chose in Account & security › Appearance (M54). It is saved on the account so it follows them to every browser they sign in on; the web app keeps a copy per browser so the first paint is already right.

Index

Constants

View Source
const (
	System = "system"
	Light  = "light"
	Dark   = "dark"
)

The themes a member can choose. System is stored as NULL.

Variables

This section is empty.

Functions

func Register

func Register(h huma.API, s *Service)

Register adds Account & security › Appearance.

func ThemeOf

func ThemeOf(u store.User) string

ThemeOf returns the theme a member chose; System when they haven't.

Types

type Choice

type Choice struct {
	Theme string `json:"theme" enum:"system,light,dark" doc:"system follows the device's light or dark setting"`
}

Choice is what a member chose in Appearance.

type Service

type Service struct {
	Pool  *pgxpool.Pool
	Q     *store.Queries
	Audit *audit.Logger
}

Service saves members' appearance choices.

func (*Service) Save

func (s *Service) Save(ctx context.Context, in Choice) (Choice, error)

Save stores a member's theme. A change is audited as account.appearance_update; saving the same theme again changes nothing.

Jump to

Keyboard shortcuts

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