From 91da02a33f80e02e91a40ad042a53f2f608c3bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A7=E9=A9=8A?= Date: Mon, 16 Nov 2026 22:58:52 +0800 Subject: [PATCH] =?UTF-8?q?design:=20=E9=96=8B=E5=A7=8B=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E8=AA=AA=E6=98=8E=E4=B8=8D=E5=86=8D=E8=A2=AB=E6=88=AA?= =?UTF-8?q?=E6=88=90=E4=B8=80=E8=A1=8C=EF=BC=8C=E5=AD=97=E4=B9=9F=E7=B8=AE?= =?UTF-8?q?=E7=9F=AD=EF=BC=9B=E6=96=B0=E5=A2=9E=20kit::note=EF=BC=88?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E8=A3=A1=E6=9C=83=E6=8F=9B=E8=A1=8C=E7=9A=84?= =?UTF-8?q?=E8=AA=AA=E6=98=8E=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 設定頁的 hint 是一行(長的滑過看全文),但開始使用這種流程裡,說明本身就是重點,不能截掉: 新增 kit::note(13 px 灰字、會換行),開始使用改用它,三段說明各縮成一句。 截圖模式多一個 welcome 畫面(還沒有 Bot 的新安裝)。 已驗證: cargo test 全過、截圖目視 --- src/app.rs | 5 +++++ src/app/kit.rs | 6 ++++++ src/app/welcome_ui.rs | 11 ++++++----- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/app.rs b/src/app.rs index 1b49dbf..0f0b070 100644 --- a/src/app.rs +++ b/src/app.rs @@ -904,6 +904,11 @@ impl App { } } } + // 開始使用: a new install, no bots yet. + Ok("welcome") => { + app.state.bots.clear(); + app.approvals.clear(); + } Ok("channels") => { app.show_settings = true; app.settings_tab = SettingsTab::Channels; diff --git a/src/app/kit.rs b/src/app/kit.rs index 1cacc53..ff95006 100644 --- a/src/app/kit.rs +++ b/src/app/kit.rs @@ -193,6 +193,12 @@ pub(super) fn form_row(ui: &mut egui::Ui, label: &str, p: Palette, body: impl Fn ui.horizontal(|ui| body(ui)); } +/// Guidance in a flow (開始使用, a form's how-to): 13 px grey that wraps — unlike `hint`, which is +/// one line on a settings page. For the few places where the explanation is the point. +pub(super) fn note(ui: &mut egui::Ui, text: impl Into, p: Palette) { + ui.add(egui::Label::new(RichText::new(t(&text.into())).size(FONT_SM).color(p.text2)).wrap()); +} + /// A form field whose name has a 「?」 beside it (what the field does, on hover) instead of a /// sentence under the box. pub(super) fn form_row_help(ui: &mut egui::Ui, label: &str, help: &str, p: Palette, body: impl FnOnce(&mut egui::Ui)) { diff --git a/src/app/welcome_ui.rs b/src/app/welcome_ui.rs index d6052fb..dbfac2d 100644 --- a/src/app/welcome_ui.rs +++ b/src/app/welcome_ui.rs @@ -47,9 +47,9 @@ impl App { let mut go_account = false; step(ui, p, 1, "連上 AI 模型", ready.is_some(), |ui| { match ready { - Some(k) => hint(ui, format!("已經可以用 {}。", k.label()), p), + Some(k) => note(ui, format!("已經可以用 {}。", k.label()), p), None => { - hint(ui, "選一個 AI 服務(xAI、OpenAI、Claude、Gemini…),貼上它的 API 金鑰。也可以用自己電腦上的 Ollama,不用金鑰。", p); + note(ui, "選一個 AI 服務,貼上它的 API 金鑰。用自己電腦上的 Ollama 不用金鑰。", p); ui.add_space(6.0); if ui.add(primary_button("設定模型", p)).clicked() { go_keys = true; @@ -58,7 +58,7 @@ impl App { } }); step(ui, p, 2, "建立你的第一個 Bot", false, |ui| { - hint(ui, "幫它取名字、寫下它要做什麼。之後隨時可以再加更多 Bot。", p); + note(ui, "取個名字,寫下它要做什麼。", p); ui.add_space(6.0); let b = if ready.is_some() { primary_button("建立 Bot", p) } else { secondary_button("建立 Bot") }; if ui.add(b).clicked() { @@ -70,9 +70,10 @@ impl App { ui.label(RichText::new(t("在別台電腦用過 AnyBot?")).strong().family(crate::bold())); if signed_in { let note = self.rm.note.lock().unwrap().clone(); - hint(ui, if note.is_empty() { "已登入帳號。帳號裡沒有別的 Bot,從上面建立第一個吧。".to_string() } else { note }, p); + let says = if note.is_empty() { "已登入帳號。帳號裡沒有別的 Bot,從上面建立第一個吧。".to_string() } else { note }; + self::note(ui, says, p); } else { - hint(ui, "登入你的帳號,那邊的 Bot、聊天和設定會自動同步到這台;這台的也會同步上去。", p); + note(ui, "登入帳號,那邊的 Bot、聊天和設定會同步過來。", p); ui.add_space(6.0); if ui.add(secondary_button("登入帳號")).clicked() { go_account = true;