Show a colour-coded team picker instead of cycling with T
T used to silently cycle Model.activeTeamID through the caller's teams with no visible list of choices. It now opens a full picker (modelled on the existing user picker) listing every team plus "All teams", each with a stable identity colour from a new six-colour theme palette. The same colour now also shows as a bullet next to "team: <name>" in the header, so the active team stays visible without opening the picker. Adds an Identity palette to the theme package (six hues, skipping the ones that already mean firing/critical), Styles.TeamColor to pick one by team id, and identity_1..6 as theme-file tokens alongside the existing twelve so a fully custom theme can still set every token.
This commit is contained in:
@@ -125,6 +125,17 @@ func (s Styles) IncidentStatus(status string) lipgloss.Style {
|
||||
}
|
||||
}
|
||||
|
||||
// TeamColor picks a stable identity colour for a team id, so the same team
|
||||
// always reads the same colour without the server needing to store one.
|
||||
func (s Styles) TeamColor(teamID int64) lipgloss.Style {
|
||||
n := int64(len(s.theme.Identity))
|
||||
i := teamID % n
|
||||
if i < 0 { // ids are never negative in practice, but % can still return one
|
||||
i += n
|
||||
}
|
||||
return lipgloss.NewStyle().Foreground(s.theme.Identity[i])
|
||||
}
|
||||
|
||||
// ── Embedded bubbles components ────────────────────────────────────────────
|
||||
//
|
||||
// Each ships its own hardcoded palette, so a theme that stopped at this
|
||||
|
||||
Reference in New Issue
Block a user