feat: per-user assistant name and system prompt customization
Each user can rename the AI assistant and edit their own system prompt in Settings.
This commit is contained in:
@@ -15,9 +15,10 @@ import {
|
||||
type Props = {
|
||||
configured: boolean;
|
||||
userId: string;
|
||||
assistantName: string;
|
||||
};
|
||||
|
||||
export function AssistantPanel({ configured, userId }: Props) {
|
||||
export function AssistantPanel({ configured, userId, assistantName }: Props) {
|
||||
const [messages, setMessages] = useState<AssistantChatMessage[]>(() => loadAssistantChat(userId));
|
||||
const [input, setInput] = useState("");
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
@@ -144,7 +145,7 @@ export function AssistantPanel({ configured, userId }: Props) {
|
||||
style={message.role === "assistant" ? { borderColor: "var(--hair)" } : undefined}
|
||||
>
|
||||
<div className="eyebrow mb-0.5 text-[10px]">
|
||||
{message.role === "user" ? "You" : "Assistant"}
|
||||
{message.role === "user" ? "You" : assistantName}
|
||||
</div>
|
||||
{message.content}
|
||||
</div>
|
||||
@@ -157,7 +158,7 @@ export function AssistantPanel({ configured, userId }: Props) {
|
||||
aria-live="polite"
|
||||
aria-busy="true"
|
||||
>
|
||||
<div className="eyebrow mb-1 text-[10px]">Assistant</div>
|
||||
<div className="eyebrow mb-1 text-[10px]">{assistantName}</div>
|
||||
<div className="flex items-center gap-2 text-[12.5px] text-muted-foreground">
|
||||
<Loader2 className="size-3.5 shrink-0 animate-spin" />
|
||||
<span>{activityLabel ?? "Working…"}</span>
|
||||
@@ -180,9 +181,9 @@ export function AssistantPanel({ configured, userId }: Props) {
|
||||
<Input
|
||||
value={input}
|
||||
onChange={(event) => setInput(event.target.value)}
|
||||
placeholder="Ask the assistant…"
|
||||
placeholder={`Ask ${assistantName}…`}
|
||||
disabled={isPending}
|
||||
aria-label="Assistant message"
|
||||
aria-label={`Message for ${assistantName}`}
|
||||
className="h-9"
|
||||
/>
|
||||
<Button type="submit" size="sm" disabled={isPending || !input.trim()} aria-label="Send">
|
||||
|
||||
Reference in New Issue
Block a user