From 9e04469692af14a16b8ad63c0fbc3d50f382c28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Tue, 15 Sep 2026 17:31:30 +0300 Subject: [PATCH] =?UTF-8?q?style:=20=F0=9F=92=AC=20drop=20=C3=87elebi=20st?= =?UTF-8?q?arter=20suggestion=20cards=20for=20an=20illustrated=20empty=20s?= =?UTF-8?q?tate=20-=20remove=20CelebiSuggestions=20and=20its=20ai.suggest*?= =?UTF-8?q?=20strings=20-=20EmptyInline=20gains=20a=20roomier=20md=20size,?= =?UTF-8?q?=20used=20by=20the=20empty=20chat=20panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/celebi-panel.tsx | 15 ++------ src/components/layout/celebi-suggestions.tsx | 34 ------------------ src/components/ui/empty-inline.tsx | 8 +++-- src/i18n/messages.ts | 36 -------------------- 4 files changed, 8 insertions(+), 85 deletions(-) delete mode 100644 src/components/layout/celebi-suggestions.tsx diff --git a/src/components/layout/celebi-panel.tsx b/src/components/layout/celebi-panel.tsx index 32dcf37..12dd1ff 100644 --- a/src/components/layout/celebi-panel.tsx +++ b/src/components/layout/celebi-panel.tsx @@ -5,10 +5,10 @@ import { formatApiError } from "@/api/client"; import { CelebiComposer } from "@/components/layout/celebi-composer"; import { CelebiMarkdown } from "@/components/layout/celebi-markdown"; import { CelebiReplyActions } from "@/components/layout/celebi-reply-actions"; -import { CelebiSuggestions } from "@/components/layout/celebi-suggestions"; import { CelebiThinkingLabel } from "@/components/layout/celebi-thinking-label"; import { ConfirmDialog } from "@/components/ui/confirm-dialog"; -import { IconAlert, IconBotSquare, IconCopy, IconEdit, IconPlus, IconSparkles, IconTrash } from "@/components/ui/icons"; +import { EmptyInline } from "@/components/ui/empty-inline"; +import { IconAlert, IconBotSquare, IconCopy, IconEdit, IconPlus, IconTrash } from "@/components/ui/icons"; import { SidePanel } from "@/components/ui/side-panel"; import { cn } from "@/lib/cn"; import { usePreferences, useT } from "@/stores/preferences-context"; @@ -244,16 +244,7 @@ export function CelebiPanel(props: { open: boolean; onOpenChange: (open: boolean 0} fallback={ -
-
-
- - - - {t("ai.empty")} -
- void send(text)} /> -
+ } >
diff --git a/src/components/layout/celebi-suggestions.tsx b/src/components/layout/celebi-suggestions.tsx deleted file mode 100644 index d6c7c2c..0000000 --- a/src/components/layout/celebi-suggestions.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { For } from "solid-js"; -import type { MessageKey } from "@/i18n/messages"; -import { useAuth } from "@/stores/auth-context"; -import { useT } from "@/stores/preferences-context"; - -const STUDENT_KEYS: MessageKey[] = ["ai.suggest1", "ai.suggest2", "ai.suggest3", "ai.suggest4"]; -const STAFF_KEYS: MessageKey[] = ["ai.suggestStaff1", "ai.suggestStaff2", "ai.suggestStaff3", "ai.suggestStaff4"]; -const PARENT_KEYS: MessageKey[] = ["ai.suggestParent1", "ai.suggestParent2", "ai.suggestParent3", "ai.suggestParent4"]; - -export function CelebiSuggestions(props: { onPick: (text: string) => void }) { - const t = useT(); - const auth = useAuth(); - const keys = () => { - const role = auth.user()?.role; - if (role === "parent") return PARENT_KEYS; - if (role === "teacher" || role === "manager" || role === "admin") return STAFF_KEYS; - return STUDENT_KEYS; - }; - return ( -
- - {(key) => ( - - )} - -
- ); -} diff --git a/src/components/ui/empty-inline.tsx b/src/components/ui/empty-inline.tsx index 7a4eb7c..327a4f1 100644 --- a/src/components/ui/empty-inline.tsx +++ b/src/components/ui/empty-inline.tsx @@ -9,15 +9,17 @@ export function EmptyInline(props: { title: string; hint?: string; illustration?: IllustrationName; + /** "md" for roomy containers such as a side panel. */ + size?: "sm" | "md"; class?: string; }) { return (
- +
-

{props.title}

+

{props.title}

-

{props.hint}

+

{props.hint}

diff --git a/src/i18n/messages.ts b/src/i18n/messages.ts index af654cb..5c72da4 100644 --- a/src/i18n/messages.ts +++ b/src/i18n/messages.ts @@ -22,18 +22,6 @@ export type MessageKey = | "ai.thinking2" | "ai.thinking3" | "ai.hint" - | "ai.suggest1" - | "ai.suggest2" - | "ai.suggest3" - | "ai.suggest4" - | "ai.suggestStaff1" - | "ai.suggestStaff2" - | "ai.suggestStaff3" - | "ai.suggestStaff4" - | "ai.suggestParent1" - | "ai.suggestParent2" - | "ai.suggestParent3" - | "ai.suggestParent4" | "ai.goTo" | "ai.didYouMean" | "ai.skipTyping" @@ -1890,18 +1878,6 @@ const en: Dict = { "ai.thinking2": "Looking into it…", "ai.thinking3": "Almost there…", "ai.hint": "Enter to send · Shift+Enter for a new line · AI-generated", - "ai.suggest1": "What are my classes today?", - "ai.suggest2": "Which exams are coming up?", - "ai.suggest3": "Do I have any missing homework?", - "ai.suggest4": "How is my attendance this term?", - "ai.suggestStaff1": "What is on the schedule today?", - "ai.suggestStaff2": "Which exams are coming up?", - "ai.suggestStaff3": "Which students have low attendance?", - "ai.suggestStaff4": "Summarize this week's events.", - "ai.suggestParent1": "What are my child's classes today?", - "ai.suggestParent2": "Which exams does my child have soon?", - "ai.suggestParent3": "How is my child's attendance this term?", - "ai.suggestParent4": "What is on this week's meal menu?", "ai.goTo": "Go to the page", "ai.didYouMean": "Did you mean one of these?", "ai.skipTyping": "Show the whole answer", @@ -3769,18 +3745,6 @@ const tr: Dict = { "ai.thinking2": "Araştırıyor…", "ai.thinking3": "Neredeyse hazır…", "ai.hint": "Enter gönder · Shift+Enter alt satır · Yapay zekâ üretimi", - "ai.suggest1": "Bugün hangi derslerim var?", - "ai.suggest2": "Yaklaşan sınavlarım neler?", - "ai.suggest3": "Eksik ödevim var mı?", - "ai.suggest4": "Bu dönem devamsızlığım nasıl?", - "ai.suggestStaff1": "Bugün programda neler var?", - "ai.suggestStaff2": "Yaklaşan sınavlar neler?", - "ai.suggestStaff3": "Hangi öğrencilerin devamsızlığı yüksek?", - "ai.suggestStaff4": "Bu haftanın etkinliklerini özetle.", - "ai.suggestParent1": "Çocuğumun bugün hangi dersleri var?", - "ai.suggestParent2": "Çocuğumun yaklaşan sınavları neler?", - "ai.suggestParent3": "Çocuğumun bu dönem devamsızlığı nasıl?", - "ai.suggestParent4": "Bu haftanın yemek menüsünde ne var?", "ai.goTo": "Sayfaya git", "ai.didYouMean": "Bunu mu demek istedin?", "ai.skipTyping": "Cevabın tamamını göster",