Polish remaining UX items: avatar fallback, chat truncation, delete confirmations

- PlayerAvatar component with onError fallback to initial badge; used in
  PlayerManager and ChatBridge.
- ChatBridge: truncate long usernames to 16 chars with tooltip, add avatar
  column, bump tinted text colors to -300 for better dark-mode contrast.
- BackupManager: confirm step for Delete (was one-click).
- ModManager: confirm step for snapshot Delete, clearer "Confirm Restore" /
  "Confirm Delete" labels, unify outer spacing with the rest of admin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hurkicorgi 2026-04-13 00:51:35 -06:00
parent dd69c17c3b
commit b6b10159ad
5 changed files with 140 additions and 50 deletions

View file

@ -21,6 +21,7 @@ type Backup = {
export function BackupManager() {
const queryClient = useQueryClient();
const [confirmRestore, setConfirmRestore] = useState<string | null>(null);
const [confirmDelete, setConfirmDelete] = useState<string | null>(null);
const [result, setResult] = useState<{ ok: boolean; message: string } | null>(null);
const { data: backups = [] } = useQuery<Backup[]>({
@ -151,6 +152,29 @@ export function BackupManager() {
Cancel
</Button>
</>
) : confirmDelete === b.name ? (
<>
<Button
size="sm"
variant="destructive"
onClick={() => {
deleteBackup.mutate(b.name);
setConfirmDelete(null);
}}
disabled={isBusy}
className="text-xs h-9"
>
Confirm Delete
</Button>
<Button
size="sm"
variant="ghost"
onClick={() => setConfirmDelete(null)}
className="text-xs h-9"
>
Cancel
</Button>
</>
) : (
<>
<a
@ -173,7 +197,7 @@ export function BackupManager() {
<Button
size="sm"
variant="ghost"
onClick={() => deleteBackup.mutate(b.name)}
onClick={() => setConfirmDelete(b.name)}
disabled={isBusy}
className="text-xs h-9 text-muted-foreground sm:opacity-0 sm:group-hover:opacity-100 transition"
>