appearance

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

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