Repository navigation
feat(chat-appearance): enhance chat appearance customization options #379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,14 +69,14 @@ export function ChatAppearancePicker({ appearance, onChange }: { | |
| </div> | ||
| <div className="mb-4 flex gap-2"> | ||
| {CHAT_APPEARANCE_PRESETS.map((preset) => ( | ||
| <button key={preset.name} type="button" title={preset.name} aria-label={`${preset.name} color preset`} aria-pressed={appearance.background === preset.background && appearance.ascii === preset.ascii} onClick={() => onChange({ background: preset.background, ascii: preset.ascii, text: null })} style={{ backgroundColor: preset.background, color: preset.ascii }} className="flex size-9 items-center justify-center rounded-full border border-current/30 font-mono text-sm transition hover:scale-110 focus-visible:outline-2 focus-visible:outline-offset-2 aria-pressed:ring-2 aria-pressed:ring-ring aria-pressed:ring-offset-2 aria-pressed:ring-offset-popover"> | ||
| <button key={preset.name} type="button" title={preset.name} aria-label={`${preset.name} color preset`} aria-pressed={appearance.background === preset.background && appearance.ascii === preset.ascii} onClick={() => onChange({ ...appearance, background: preset.background, ascii: preset.ascii, text: null })} style={{ backgroundColor: preset.background, color: preset.ascii }} className="flex size-9 items-center justify-center rounded-full border border-current/30 font-mono text-sm transition hover:scale-110 focus-visible:outline-2 focus-visible:outline-offset-2 aria-pressed:ring-2 aria-pressed:ring-ring aria-pressed:ring-offset-2 aria-pressed:ring-offset-popover"> | ||
| # | ||
| </button> | ||
| ))} | ||
| </div> | ||
| <fieldset className="mb-4"><legend className="mb-2 text-xs text-muted-foreground">Background image</legend><div className="grid grid-cols-2 gap-2">{([{ id: "night", label: "Night sky", src: "/nova/ascii-night.webp" }, { id: "clouds", label: "Clouds", src: "/cloudy.png" }] as const).map((item) => <button key={item.id} type="button" aria-pressed={(appearance.image ?? "night") === item.id} onClick={() => onChange({ ...appearance, image: item.id })} className="overflow-hidden rounded-lg border border-white/10 text-left text-xs text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white aria-pressed:ring-2 aria-pressed:ring-white/60"><span aria-hidden="true" className="block h-16 bg-cover bg-center" style={{ backgroundImage: `url(${item.src})` }} /><span className="block px-2 py-1.5">{item.label}</span></button>)}</div></fieldset> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new image section makes the appearance picker too tall for short browser windows. Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| <div className="space-y-3"> | ||
| <ColorPicker label="Background" value={appearance.background} onChange={(background) => onChange({ ...appearance, background })} /> | ||
| <ColorPicker label="ASCII animation" value={appearance.ascii} onChange={(ascii) => onChange({ ...appearance, ascii })} /> | ||
| <ColorPicker label="Text" value={text} onChange={(color) => onChange({ ...appearance, text: color })} /> | ||
| <label className="flex cursor-pointer items-center gap-2 text-xs text-muted-foreground"> | ||
| <input type="checkbox" checked={appearance.text === null} onChange={(event) => onChange({ ...appearance, text: event.target.checked ? null : text })} className="size-3.5 accent-current" /> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatic text contrast still uses only
appearance.background, butOriginal imagecovers that color at full opacity by default. The heading and project controls have no solid backing. For example,Paperkeeps black text even when the brightness slider darkens the photo behind it. Add a contrast-preserving backing for this text, or account for the displayed image when choosing its automatic color.