feat: human-friendly session titles in header and sidebar

Replace raw session keys/UUIDs with readable names derived from
session metadata (label, kind, channel). Priority: label > kind-based
name (Main, Cron, Task) with channel suffix > cleaned key fallback.

New utility: src/lib/sessionName.ts used by both Header and Sidebar.
This commit is contained in:
Nicolas Varrot
2026-02-12 17:35:53 +00:00
parent 79b516bf9d
commit 52a1a7f270
3 changed files with 54 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import { Menu, Sparkles, LogOut, Volume2, VolumeOff, Cpu } from 'lucide-react';
import type { ConnectionStatus, Session } from '../types';
import { useT } from '../hooks/useLocale';
import { LanguageSelector } from './LanguageSelector';
import { sessionDisplayName } from '../lib/sessionName';
interface Props {
status: ConnectionStatus;
@@ -15,7 +16,7 @@ interface Props {
export function Header({ status, sessionKey, onToggleSidebar, activeSessionData, onLogout, soundEnabled, onToggleSound }: Props) {
const t = useT();
const sessionLabel = sessionKey.split(':').pop() || sessionKey;
const sessionLabel = activeSessionData ? sessionDisplayName(activeSessionData) : (sessionKey.split(':').pop() || sessionKey);
return (
<>