Files
supermarket/internal/ui/styles.go
T
davidandClaude Opus 5.5 4d304cd65b Stop committing credentials; fix posting length, partial posts, and data safety
- Untrack config.yaml (now gitignored) and add config.example.yaml with
  blank credentials; install.sh copies the example and sets mode 600
- Reserve room for the appended source link when asking Claude for a
  post, count length the way X does, and refuse over-length tweets
  before posting
- Return https://x.com/i/status/<id> for posted tweets
- Track which platforms each queued post reached so a partial failure
  can be retried without double-posting
- Write config, state, posts and dismissed files atomically with 0600
- Keep refreshed Twitter tokens in memory if saving them fails, and log
  the failure instead of writing to the hidden stderr
- Exit with a clear message on corrupt data files instead of panicking
- Surface save errors in the UI; show status/error messages on home
- Add tests for X length counting, the post store, and token updates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 06:14:40 -07:00

86 lines
2.0 KiB
Go

package ui
import "github.com/charmbracelet/lipgloss"
var (
colorPurple = lipgloss.Color("135")
colorGreen = lipgloss.Color("82")
colorRed = lipgloss.Color("196")
colorYellow = lipgloss.Color("226")
colorGray = lipgloss.Color("240")
colorFaint = lipgloss.Color("238")
colorWhite = lipgloss.Color("255")
titleStyle = lipgloss.NewStyle().
Bold(true).
Foreground(colorPurple).
Padding(0, 1)
subtitleStyle = lipgloss.NewStyle().
Foreground(colorGray).
Padding(0, 1)
headerStyle = lipgloss.NewStyle().
Bold(true).
Foreground(colorWhite).
Background(colorPurple).
Padding(0, 2).
Width(60)
statusBarStyle = lipgloss.NewStyle().
Foreground(colorGray).
Padding(0, 1)
keyStyle = lipgloss.NewStyle().
Foreground(colorPurple).
Bold(true)
keyDescStyle = lipgloss.NewStyle().
Foreground(colorGray)
itemNormalStyle = lipgloss.NewStyle().
PaddingLeft(2)
itemFocusedStyle = lipgloss.NewStyle().
PaddingLeft(0).
Foreground(colorPurple).
SetString("▸ ")
itemSelectedStyle = lipgloss.NewStyle().
PaddingLeft(2).
Foreground(colorGreen)
itemSelectedFocusedStyle = lipgloss.NewStyle().
PaddingLeft(0).
Foreground(colorGreen).
SetString("▸ ")
checkboxOn = lipgloss.NewStyle().Foreground(colorGreen).Render("●")
checkboxOff = lipgloss.NewStyle().Foreground(colorGray).Render("○")
spinnerStyle = lipgloss.NewStyle().Foreground(colorPurple)
errorStyle = lipgloss.NewStyle().
Foreground(colorRed).
Bold(true)
successStyle = lipgloss.NewStyle().
Foreground(colorGreen).
Bold(true)
warningStyle = lipgloss.NewStyle().
Foreground(colorYellow)
charCountOK = lipgloss.NewStyle().Foreground(colorGreen)
charCountWarn = lipgloss.NewStyle().Foreground(colorYellow)
charCountOver = lipgloss.NewStyle().Foreground(colorRed).Bold(true)
borderStyle = lipgloss.NewStyle().
Border(lipgloss.RoundedBorder()).
BorderForeground(colorFaint)
)
func keyHint(key, desc string) string {
return keyStyle.Render(key) + keyDescStyle.Render(" "+desc)
}