A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.
Rust agentagent-orchestrationaiai-agentsclaude-codecodexcoding-agentlinuxmacosmultiplayermultiplexerrustterminalterminal-emulatorterminal-multiplexertmuxtuiweztermwindows
gui: redesign Settings; add Software Update, About, and sidebar panel toggles
RoversXfbea5689fb29
diff --git a/wezterm-gui/i18n/en-US.ftl b/wezterm-gui/i18n/en-US.ftlindex bea2167a..bc2d6b82 100644--- a/wezterm-gui/i18n/en-US.ftl+++ b/wezterm-gui/i18n/en-US.ftl@@ -48,10 +48,10 @@ settings-section-keymap = Keymapsettings-section-compatibility = Import from WezTermsettings-section-developer = Developersettings-section-about = About-settings-search-placeholder = Search settings…+settings-search-placeholder = Searchsettings-search-no-results = No settings foundsettings-keymap-description = Keyboard shortcuts and command palette actions.-settings-about-description = ThinkTerm version, project information, and app metadata.+settings-about-description = ThinkTerm version, build details, project links, and where its files live.settings-general-heading = Configurationsettings-config-source = Config Sourcesettings-native-settings = ThinkTerm Settings@@ -210,7 +210,7 @@ sidebar-settings = Settingstooltip-sidebar-settings = Settingstooltip-sidebar-view-options = View Optionstooltip-sidebar-thread-search = Find Thread-tooltip-sidebar-ssh-hosts = SSH Hosts+tooltip-sidebar-ssh-hosts = Remote Hoststooltip-sidebar-live-overview = Live Overviewtooltip-sidebar-notifications = Notificationsmenu-rename-project = Rename Project…@@ -245,6 +245,7 @@ menu-space-server-group-connecting = { $name } (connecting…)menu-space-server-group-reconnecting = { $name } (reconnecting…)remote-tree-mutation-offline = { $name } is disconnected. Reconnect and try again.menu-new-space-here = New Space Here+menu-add-remote-host = Add Remote Host…menu-add-to-space = Add to Spacemenu-add-to-space-named = Add to “{ $name }”menu-move-to-space = Move to Space@@ -389,7 +390,17 @@ right-confirm-download = Download { $count } itemsright-confirm-delete-items = Delete { $count } items permanentlyright-confirm-delete-name = Delete “{ $name }” permanentlyright-confirm-upload = Upload { $count } items-ssh-hosts-title = SSH Hosts+ssh-hosts-title = Remote Hosts+ssh-group-hosts = Hosts+ssh-mode-mosh = Mosh+ssh-mode-connect = Persistent+ssh-connect = Connect+ssh-menu-connect = Connect+ssh-menu-edit = Edit Host…+ssh-menu-duplicate = Duplicate+ssh-menu-delete-named = Delete “{ $name }”+ssh-menu-delete-explain = Deletes this host, its threads, and any Spaces mirrored from it. This cannot be undone.+ssh-menu-delete-confirm = Delete Permanentlylive-overview-title = Live Overviewlive-overview-offline = Offlinelive-overview-empty = No live terminals@@ -410,13 +421,15 @@ ssh-field-user = Userssh-field-password = Passwordssh-field-identity = Identity filessh-field-workspace = Workspace+ssh-field-mosh-server = Mosh server command+ssh-error-duplicate = A saved host already uses { $endpoint }. Change the host, user or port, or edit that host instead.ssh-group-connection = Connectionssh-group-authentication = Authenticationssh-group-session = Session-ssh-detect-os = Detect OS on connect+ssh-detect-os = Detect OSssh-use-mosh = Connect with Mosh-ssh-use-mux = ThinkTerm Connect (persistent mux)-ssh-advanced = Advanced (ssh_config options)+ssh-use-mux = ThinkTerm Connect+ssh-advanced = Advancedssh-add-option = + Add optionssh-save-open = Save & Openssh-save = Save@@ -445,7 +458,7 @@ remote-thread-delete = Delete Threadremote-thread-cancel = Cancelremote-thread-retry = Retryremote-thread-stale = This saved SSH thread no longer exists.-remote-thread-host-stale = The saved SSH host for this thread no longer exists.+remote-thread-host-stale = The saved remote host for this thread no longer exists.menu-reveal-finder = Reveal in Findermenu-reveal-explorer = Show in File Explorermenu-reveal-folder = Show in Folder@@ -486,8 +499,6 @@ settings-developer-tabs-value = UI Kit, Memory/Inputsettings-onboarding-launcher = Onboardingsettings-onboarding-launcher-description = Open the setup wizard without changing the saved seen version.settings-onboarding-launcher-value = Manual test entry-settings-disable-developer = Disable Developer Mode-settings-enable-developer = Enable Developer Modesettings-show-onboarding = Show Onboarding Nowsettings-config-source-file = File: { $path }settings-config-source-default = No config file loaded; using built-in defaults@@ -556,11 +567,7 @@ onboarding-skip = Skiponboarding-start = Get Started# Agent status detection + Agents panel-settings-agents-heading = Agents-settings-agent-panel = Agent Panelsettings-agent-panel-description = Detect coding agents (Claude Code, Codex, …) running in panes and show them in the right sidebar.-settings-agent-panel-enabled = Agent panel enabled.-settings-agent-panel-disabled = Agent panel disabled.right-mode-agents = Agentsright-agents-rules-reloaded = Detection rules reloaded.right-agents-rules-reload-errors = Rules reloaded; { $count ->@@ -592,3 +599,52 @@ settings-agent-details-states = Recognized states: working, waiting for your inpsettings-agent-details-native = Reports working / waiting / idle itself via the THINKTERM_AGENT protocol; full lifecycle, no gaps.settings-agent-details-native-doc = Protocol reference: docs/agent-status.md in the ThinkTerm repository.settings-agent-details-pending = No screen rules exist for this agent; a lifecycle adapter is planned. It runs fine — status just isn't shown yet.+# --- Software Update -------------------------------------------------------+settings-section-update = Software Update+settings-update-current = ThinkTerm is up to date.+settings-update-current-detail = ThinkTerm { $version }+settings-update-available = An update is available.+settings-update-available-detail = ThinkTerm { $latest } — you have { $current }+settings-update-local-build = Running a local build.+settings-update-local-build-detail = { $version } — not a release build+settings-update-unknown = No update check has run yet.+settings-update-unknown-detail = ThinkTerm { $version }+settings-update-check-now = Check for Updates+settings-update-checked = Checked+settings-update-automatic = Automatic Updates+settings-update-frequency = Check Frequency+settings-update-frequency-off = Off+settings-update-frequency-daily = Daily+settings-update-frequency-weekly = Weekly+settings-update-frequency-days = Every { $count } days+settings-update-frequency-hours = Every { $count } hours+settings-update-frequency-minutes = Every { $count } minutes+settings-update-last-checked = Last Checked+settings-update-never = Never+settings-update-just-now = Just now+settings-update-minutes-ago = { $count } minutes ago+settings-update-hours-ago = { $count } hours ago+settings-update-whats-new = What's New+settings-update-all-releases = View All Releases+settings-update-manual-note = ThinkTerm never installs an update on its own.++# --- About -----------------------------------------------------------------+settings-about-version-line = Version { $version }+settings-about-copy = Copy Info+settings-about-copied = Copied+settings-about-version = Version+settings-about-build = Build+settings-about-platform = Platform+settings-about-source = Source Code+settings-about-release-notes = Release Notes+settings-about-license = License+settings-about-notices = Notices+settings-about-privacy = Privacy+settings-about-config-file = Config File+settings-about-data-folder = Data Folder+# --- Sidebar ---------------------------------------------------------------+settings-section-sidebar = Sidebar+settings-sidebar-description = Choose which panels the right sidebar offers. Turn them all off and the sidebar goes away.+settings-sidebar-files-description = Browse the working directory, and remote directories over SFTP.+settings-sidebar-notes-description = Markdown notes kept alongside the project.+settings-sidebar-snippets-description = Saved commands and text you can paste into a pane.diff --git a/wezterm-gui/i18n/fr-FR.ftl b/wezterm-gui/i18n/fr-FR.ftlindex e9816f6a..19f2c3b4 100644--- a/wezterm-gui/i18n/fr-FR.ftl+++ b/wezterm-gui/i18n/fr-FR.ftl@@ -48,10 +48,10 @@ settings-section-keymap = Raccourcis claviersettings-section-compatibility = Importer depuis WezTermsettings-section-developer = Développeursettings-section-about = À propos-settings-search-placeholder = Rechercher dans les réglages…+settings-search-placeholder = Recherchersettings-search-no-results = Aucun réglage trouvésettings-keymap-description = Raccourcis clavier et actions de la palette de commandes.-settings-about-description = Version de ThinkTerm, informations du projet et métadonnées de l’application.+settings-about-description = Version de ThinkTerm, détails de compilation, liens du projet et emplacement de ses fichiers.settings-general-heading = Configurationsettings-config-source = Source de configurationsettings-native-settings = Réglages ThinkTerm@@ -210,7 +210,7 @@ sidebar-settings = Réglagestooltip-sidebar-settings = Réglagestooltip-sidebar-view-options = Options d'affichagetooltip-sidebar-thread-search = Trouver un fil-tooltip-sidebar-ssh-hosts = Hôtes SSH+tooltip-sidebar-ssh-hosts = Hôtes distantstooltip-sidebar-live-overview = Aperçu en directtooltip-sidebar-notifications = Notificationsmenu-rename-project = Renommer le projet…@@ -245,6 +245,7 @@ menu-space-server-group-connecting = { $name } (connexion…)menu-space-server-group-reconnecting = { $name } (reconnexion…)remote-tree-mutation-offline = { $name } est déconnecté. Reconnectez-vous et réessayez.menu-new-space-here = Nouvel espace ici+menu-add-remote-host = Ajouter un hôte distant…menu-add-to-space = Ajouter à l’espacemenu-add-to-space-named = Ajouter à « { $name } »menu-move-to-space = Déplacer vers l’espace@@ -389,7 +390,17 @@ right-confirm-download = Télécharger { $count } élémentsright-confirm-delete-items = Supprimer définitivement { $count } élémentsright-confirm-delete-name = Supprimer définitivement « { $name } »right-confirm-upload = Envoyer { $count } éléments-ssh-hosts-title = Hôtes SSH+ssh-hosts-title = Hôtes distants+ssh-group-hosts = Hôtes+ssh-mode-mosh = Mosh+ssh-mode-connect = Persistant+ssh-connect = Connexion+ssh-menu-connect = Se connecter+ssh-menu-edit = Modifier l'hôte…+ssh-menu-duplicate = Dupliquer+ssh-menu-delete-named = Supprimer « { $name } »+ssh-menu-delete-explain = Supprime cet hôte, ses fils et les Spaces qui en proviennent. Irréversible.+ssh-menu-delete-confirm = Supprimer définitivementlive-overview-title = Aperçu en directlive-overview-offline = Hors lignelive-overview-empty = Aucun terminal actif@@ -410,13 +421,15 @@ ssh-field-user = Utilisateurssh-field-password = Mot de passessh-field-identity = Fichier d’identitéssh-field-workspace = Espace de travail+ssh-field-mosh-server = Commande du serveur Mosh+ssh-error-duplicate = Un hôte enregistré utilise déjà { $endpoint }. Changez l'hôte, l'utilisateur ou le port, ou modifiez cet hôte.ssh-group-connection = Connexionssh-group-authentication = Authentificationssh-group-session = Session-ssh-detect-os = Détecter le système à la connexion+ssh-detect-os = Détecter le systèmessh-use-mosh = Se connecter avec Mosh-ssh-use-mux = ThinkTerm Connect (mux persistant)-ssh-advanced = Avancé (options ssh_config)+ssh-use-mux = ThinkTerm Connect+ssh-advanced = Avancéssh-add-option = + Ajouter une optionssh-save-open = Enregistrer et ouvrirssh-save = Enregistrer@@ -445,7 +458,7 @@ remote-thread-delete = Supprimer la sessionremote-thread-cancel = Annulerremote-thread-retry = Réessayerremote-thread-stale = Cette session SSH enregistrée n’existe plus.-remote-thread-host-stale = L’hôte SSH enregistré pour cette session n’existe plus.+remote-thread-host-stale = L’hôte distant enregistré pour cette session n’existe plus.menu-reveal-finder = Afficher dans le Findermenu-reveal-explorer = Afficher dans l’Explorateur de fichiersmenu-reveal-folder = Afficher dans le dossier@@ -486,8 +499,6 @@ settings-developer-tabs-value = UI Kit, Mémoire/Entréesettings-onboarding-launcher = Configuration initialesettings-onboarding-launcher-description = Ouvre l’assistant sans modifier la version enregistrée comme déjà vue.settings-onboarding-launcher-value = Accès de test manuel-settings-disable-developer = Désactiver le mode développeur-settings-enable-developer = Activer le mode développeursettings-show-onboarding = Afficher la configuration initialesettings-config-source-file = Fichier : { $path }settings-config-source-default = Aucun fichier chargé ; utilisation des valeurs intégrées@@ -556,11 +567,7 @@ onboarding-skip = Ignoreronboarding-start = Commencer# Détection d'état des agents + panneau Agents-settings-agents-heading = Agents-settings-agent-panel = Panneau des agentssettings-agent-panel-description = Détecter les agents de codage (Claude Code, Codex, …) dans les panneaux et les afficher dans la barre latérale droite.-settings-agent-panel-enabled = Panneau des agents activé.-settings-agent-panel-disabled = Panneau des agents désactivé.right-mode-agents = Agentsright-agents-rules-reloaded = Règles de détection rechargées.right-agents-rules-reload-errors = Règles rechargées ; { $count ->@@ -589,3 +596,52 @@ settings-agent-details-states = États reconnus : en cours, en attente de votresettings-agent-details-native = Rapporte lui-même en cours / en attente / inactif via le protocole THINKTERM_AGENT ; cycle de vie complet, sans angle mort.settings-agent-details-native-doc = Référence du protocole : docs/agent-status.md dans le dépôt ThinkTerm.settings-agent-details-pending = Pas encore de règles d'écran pour cet agent ; un adaptateur est prévu. Il fonctionne normalement, seul l'état n'est pas affiché.+# --- Mise à jour logicielle ------------------------------------------------+settings-section-update = Mise à jour+settings-update-current = ThinkTerm est à jour.+settings-update-current-detail = ThinkTerm { $version }+settings-update-available = Une mise à jour est disponible.+settings-update-available-detail = ThinkTerm { $latest } — vous avez { $current }+settings-update-local-build = Compilation locale en cours d’exécution.+settings-update-local-build-detail = { $version } — pas une version publiée+settings-update-unknown = Aucune vérification n’a encore eu lieu.+settings-update-unknown-detail = ThinkTerm { $version }+settings-update-check-now = Rechercher les mises à jour+settings-update-checked = Vérifié+settings-update-automatic = Mises à jour automatiques+settings-update-frequency = Fréquence de vérification+settings-update-frequency-off = Désactivé+settings-update-frequency-daily = Chaque jour+settings-update-frequency-weekly = Chaque semaine+settings-update-frequency-days = Tous les { $count } jours+settings-update-frequency-hours = Toutes les { $count } heures+settings-update-frequency-minutes = Toutes les { $count } minutes+settings-update-last-checked = Dernière vérification+settings-update-never = Jamais+settings-update-just-now = À l’instant+settings-update-minutes-ago = il y a { $count } minutes+settings-update-hours-ago = il y a { $count } heures+settings-update-whats-new = Nouveautés+settings-update-all-releases = Voir toutes les versions+settings-update-manual-note = ThinkTerm n’installe jamais une mise à jour de lui-même.++# --- À propos --------------------------------------------------------------+settings-about-version-line = Version { $version }+settings-about-copy = Copier les infos+settings-about-copied = Copié+settings-about-version = Version+settings-about-build = Compilation+settings-about-platform = Plateforme+settings-about-source = Code source+settings-about-release-notes = Notes de version+settings-about-license = Licence+settings-about-notices = Mentions+settings-about-privacy = Confidentialité+settings-about-config-file = Fichier de configuration+settings-about-data-folder = Dossier de données+# --- Barre latérale --------------------------------------------------------+settings-section-sidebar = Barre latérale+settings-sidebar-description = Choisissez les panneaux proposés par la barre latérale droite. Désactivez-les tous et elle disparaît.+settings-sidebar-files-description = Parcourir le répertoire de travail, et les répertoires distants via SFTP.+settings-sidebar-notes-description = Notes Markdown conservées avec le projet.+settings-sidebar-snippets-description = Commandes et textes enregistrés, à coller dans un panneau.diff --git a/wezterm-gui/i18n/ja-JP.ftl b/wezterm-gui/i18n/ja-JP.ftlindex 83b21333..cd4c9bf7 100644--- a/wezterm-gui/i18n/ja-JP.ftl+++ b/wezterm-gui/i18n/ja-JP.ftl@@ -45,10 +45,10 @@ settings-section-keymap = キーマップsettings-section-compatibility = WezTerm からインポートsettings-section-developer = 開発者settings-section-about = 情報-settings-search-placeholder = 設定を検索…+settings-search-placeholder = 検索settings-search-no-results = 設定が見つかりませんsettings-keymap-description = キーボードショートカットとコマンドパレットのアクションです。-settings-about-description = ThinkTerm のバージョン、プロジェクト情報、アプリのメタデータです。+settings-about-description = ThinkTerm のバージョン、ビルド情報、プロジェクトのリンク、ファイルの場所です。settings-general-heading = 構成settings-config-source = 構成元settings-native-settings = ThinkTerm 設定@@ -207,7 +207,7 @@ sidebar-settings = 設定tooltip-sidebar-settings = 設定tooltip-sidebar-view-options = 表示オプションtooltip-sidebar-thread-search = スレッドを検索-tooltip-sidebar-ssh-hosts = SSH ホスト+tooltip-sidebar-ssh-hosts = リモートホストtooltip-sidebar-live-overview = ライブ概要tooltip-sidebar-notifications = 通知menu-rename-project = プロジェクト名を変更…@@ -236,6 +236,7 @@ menu-space-server-group-connecting = { $name }(接続中…)menu-space-server-group-reconnecting = { $name }(再接続中…)remote-tree-mutation-offline = { $name } は切断されています。再接続してからもう一度お試しください。menu-new-space-here = このサーバーに新しいスペース+menu-add-remote-host = リモートホストを追加…menu-add-to-space = スペースに追加menu-add-to-space-named = “{ $name }”に追加menu-move-to-space = スペースへ移動@@ -380,7 +381,17 @@ right-confirm-download = { $count } 項目をダウンロードright-confirm-delete-items = { $count } 項目を完全に削除right-confirm-delete-name = 「{ $name }」を完全に削除right-confirm-upload = { $count } 項目をアップロード-ssh-hosts-title = SSH ホスト+ssh-hosts-title = リモートホスト+ssh-group-hosts = ホスト+ssh-mode-mosh = Mosh+ssh-mode-connect = 常駐+ssh-connect = 接続+ssh-menu-connect = 接続+ssh-menu-edit = ホストを編集…+ssh-menu-duplicate = 複製+ssh-menu-delete-named = 「{ $name }」を削除+ssh-menu-delete-explain = このホスト、そのスレッド、ミラーされたスペースをすべて削除します。取り消せません。+ssh-menu-delete-confirm = 完全に削除live-overview-title = ライブ概要live-overview-offline = オフラインlive-overview-empty = ライブターミナルはありません@@ -401,13 +412,15 @@ ssh-field-user = ユーザーssh-field-password = パスワードssh-field-identity = Identity ファイルssh-field-workspace = ワークスペース+ssh-field-mosh-server = Mosh サーバーコマンド+ssh-error-duplicate = 既存のホストが { $endpoint } を使用しています。ホスト・ユーザー・ポートを変更するか、そのホストを編集してください。ssh-group-connection = 接続ssh-group-authentication = 認証ssh-group-session = セッション-ssh-detect-os = 接続時に OS を検出+ssh-detect-os = OS を検出ssh-use-mosh = Mosh で接続-ssh-use-mux = ThinkTerm Connect(永続 mux)-ssh-advanced = 詳細(ssh_config オプション)+ssh-use-mux = ThinkTerm Connect+ssh-advanced = 詳細設定ssh-add-option = + オプションを追加ssh-save-open = 保存して開くssh-save = 保存@@ -436,7 +449,7 @@ remote-thread-delete = セッションを削除remote-thread-cancel = キャンセルremote-thread-retry = 再試行remote-thread-stale = 保存済みの SSH セッションは存在しません。-remote-thread-host-stale = このセッションに保存された SSH ホストは存在しません。+remote-thread-host-stale = このセッションに保存されたリモートホストは存在しません。menu-reveal-finder = Finder に表示menu-reveal-explorer = エクスプローラーに表示menu-reveal-folder = フォルダーに表示@@ -477,8 +490,6 @@ settings-developer-tabs-value = UI Kit、メモリ/入力settings-onboarding-launcher = 初期設定settings-onboarding-launcher-description = 保存済みの完了バージョンを変えずに設定ウィザードを開きます。settings-onboarding-launcher-value = 手動テスト入口-settings-disable-developer = 開発者モードを無効化-settings-enable-developer = 開発者モードを有効化settings-show-onboarding = 初期設定を今すぐ表示settings-config-source-file = ファイル:{ $path }settings-config-source-default = 設定ファイルは未読み込みです。内蔵デフォルトを使用しています@@ -547,11 +558,7 @@ onboarding-skip = スキップonboarding-start = 使ってみる# エージェント状態検出 + Agents パネル-settings-agents-heading = エージェント-settings-agent-panel = エージェントパネルsettings-agent-panel-description = ペインで動作するコーディングエージェント(Claude Code、Codex など)を検出し、右サイドバーに表示します。-settings-agent-panel-enabled = エージェントパネルを有効にしました。-settings-agent-panel-disabled = エージェントパネルを無効にしました。right-mode-agents = エージェントright-agents-rules-reloaded = 検出ルールを再読み込みしました。right-agents-rules-reload-errors = ルールを再読み込みしましたが、{ $count } 件のファイルが拒否されました — ログをご確認ください。@@ -577,3 +584,52 @@ settings-agent-details-states = 認識する状態: 作業中、入力待ち、settings-agent-details-native = THINKTERM_AGENT プロトコルで自ら状態を報告します。完全なライフサイクルで盲点はありません。settings-agent-details-native-doc = プロトコル資料: ThinkTerm リポジトリの docs/agent-status.md。settings-agent-details-pending = このエージェントにはまだスクリーンルールがありません。アダプターを計画中です。動作には問題なく、状態表示だけ未対応です。+# --- ソフトウェアアップデート ----------------------------------------------+settings-section-update = ソフトウェアアップデート+settings-update-current = ThinkTerm は最新です。+settings-update-current-detail = ThinkTerm { $version }+settings-update-available = アップデートがあります。+settings-update-available-detail = ThinkTerm { $latest } — 現在は { $current }+settings-update-local-build = ローカルビルドで実行中です。+settings-update-local-build-detail = { $version } — リリースビルドではありません+settings-update-unknown = まだ確認していません。+settings-update-unknown-detail = ThinkTerm { $version }+settings-update-check-now = アップデートを確認+settings-update-checked = 確認しました+settings-update-automatic = 自動アップデート+settings-update-frequency = 確認の頻度+settings-update-frequency-off = オフ+settings-update-frequency-daily = 毎日+settings-update-frequency-weekly = 毎週+settings-update-frequency-days = { $count } 日ごと+settings-update-frequency-hours = { $count } 時間ごと+settings-update-frequency-minutes = { $count } 分ごと+settings-update-last-checked = 最終確認+settings-update-never = なし+settings-update-just-now = たった今+settings-update-minutes-ago = { $count } 分前+settings-update-hours-ago = { $count } 時間前+settings-update-whats-new = 新機能+settings-update-all-releases = すべてのリリースを見る+settings-update-manual-note = ThinkTerm が自動でアップデートをインストールすることはありません。++# --- 情報 ------------------------------------------------------------------+settings-about-version-line = バージョン { $version }+settings-about-copy = 情報をコピー+settings-about-copied = コピーしました+settings-about-version = バージョン+settings-about-build = ビルド+settings-about-platform = プラットフォーム+settings-about-source = ソースコード+settings-about-release-notes = リリースノート+settings-about-license = ライセンス+settings-about-notices = 表記+settings-about-privacy = プライバシー+settings-about-config-file = 設定ファイル+settings-about-data-folder = データフォルダ+# --- サイドバー ------------------------------------------------------------+settings-section-sidebar = サイドバー+settings-sidebar-description = 右サイドバーに表示するパネルを選びます。すべてオフにするとサイドバー自体が消えます。+settings-sidebar-files-description = 作業ディレクトリと、SFTP 経由のリモートディレクトリを閲覧します。+settings-sidebar-notes-description = プロジェクトと一緒に置く Markdown のノートです。+settings-sidebar-snippets-description = 保存したコマンドやテキストを、ペインに貼り付けられます。diff --git a/wezterm-gui/i18n/zh-CN.ftl b/wezterm-gui/i18n/zh-CN.ftlindex 136552b4..83fa877f 100644--- a/wezterm-gui/i18n/zh-CN.ftl+++ b/wezterm-gui/i18n/zh-CN.ftl@@ -45,10 +45,10 @@ settings-section-keymap = 快捷键settings-section-compatibility = 从 WezTerm 导入settings-section-developer = 开发者settings-section-about = 关于-settings-search-placeholder = 搜索设置…+settings-search-placeholder = 搜索settings-search-no-results = 未找到设置settings-keymap-description = 键盘快捷键和命令面板操作。-settings-about-description = 查看 ThinkTerm 版本和应用信息。+settings-about-description = ThinkTerm 的版本、构建信息、项目链接,以及文件所在位置。settings-general-heading = 配置settings-config-source = 配置来源settings-native-settings = ThinkTerm 设置@@ -207,7 +207,7 @@ sidebar-settings = 设置tooltip-sidebar-settings = 设置tooltip-sidebar-view-options = 视图选项tooltip-sidebar-thread-search = 查找线程-tooltip-sidebar-ssh-hosts = SSH 主机+tooltip-sidebar-ssh-hosts = 远程主机tooltip-sidebar-live-overview = 实时总览tooltip-sidebar-notifications = 通知menu-rename-project = 重命名项目…@@ -236,6 +236,7 @@ menu-space-server-group-connecting = { $name }(连接中…)menu-space-server-group-reconnecting = { $name }(重连中…)remote-tree-mutation-offline = { $name } 已断开。请重新连接后再试。menu-new-space-here = 在此服务器新建空间+menu-add-remote-host = 添加远程主机…menu-add-to-space = 添加到空间menu-add-to-space-named = 添加到“{ $name }”menu-move-to-space = 移动到空间@@ -380,7 +381,17 @@ right-confirm-download = 下载 { $count } 个项目right-confirm-delete-items = 永久删除 { $count } 个项目right-confirm-delete-name = 永久删除“{ $name }”right-confirm-upload = 上传 { $count } 个项目-ssh-hosts-title = SSH 主机+ssh-hosts-title = 远程主机+ssh-group-hosts = 主机+ssh-mode-mosh = Mosh+ssh-mode-connect = 持久会话+ssh-connect = 连接+ssh-menu-connect = 连接+ssh-menu-edit = 编辑主机…+ssh-menu-duplicate = 创建副本+ssh-menu-delete-named = 删除“{ $name }”+ssh-menu-delete-explain = 将删除此主机、它的线程,以及从它镜像来的 Space。无法撤销。+ssh-menu-delete-confirm = 永久删除live-overview-title = 实时总览live-overview-offline = 离线live-overview-empty = 暂无实时终端@@ -401,13 +412,15 @@ ssh-field-user = 用户ssh-field-password = 密码ssh-field-identity = 私钥文件ssh-field-workspace = 工作区+ssh-field-mosh-server = Mosh 服务端命令+ssh-error-duplicate = 已有主机在用 { $endpoint }。请改主机名、用户或端口,或者直接编辑那台主机。ssh-group-connection = 连接ssh-group-authentication = 身份验证ssh-group-session = 会话-ssh-detect-os = 连接时检测操作系统+ssh-detect-os = 检测操作系统ssh-use-mosh = 使用 Mosh 连接-ssh-use-mux = ThinkTerm Connect(持久 mux)-ssh-advanced = 高级(ssh_config 选项)+ssh-use-mux = ThinkTerm Connect+ssh-advanced = 高级ssh-add-option = + 添加选项ssh-save-open = 保存并打开ssh-save = 保存@@ -436,7 +449,7 @@ remote-thread-delete = 删除会话remote-thread-cancel = 取消remote-thread-retry = 重试remote-thread-stale = 此已保存的 SSH 会话已不存在。-remote-thread-host-stale = 此会话所保存的 SSH 主机已不存在。+remote-thread-host-stale = 此会话所保存的远程主机已不存在。menu-reveal-finder = 在访达中显示menu-reveal-explorer = 在文件资源管理器中显示menu-reveal-folder = 在文件夹中显示@@ -477,8 +490,6 @@ settings-developer-tabs-value = UI Kit、内存/输入settings-onboarding-launcher = 初始设置settings-onboarding-launcher-description = 打开设置向导,但不更改已保存的完成版本。settings-onboarding-launcher-value = 手动测试入口-settings-disable-developer = 关闭开发者模式-settings-enable-developer = 启用开发者模式settings-show-onboarding = 立即显示初始设置settings-config-source-file = 文件:{ $path }settings-config-source-default = 未加载配置文件;正在使用内置默认值@@ -547,11 +558,7 @@ onboarding-skip = 跳过onboarding-start = 开始使用# Agent 状态检测 + Agents 面板-settings-agents-heading = Agent-settings-agent-panel = Agent 面板settings-agent-panel-description = 检测 pane 中运行的编码 Agent(Claude Code、Codex 等)并显示在右侧栏。-settings-agent-panel-enabled = Agent 面板已开启。-settings-agent-panel-disabled = Agent 面板已关闭。right-mode-agents = Agentright-agents-rules-reloaded = 检测规则已重载。right-agents-rules-reload-errors = 规则已重载,{ $count } 份文件被拒绝 — 详见日志。@@ -577,3 +584,52 @@ settings-agent-details-states = 可识别状态:工作中、等待你输入、settings-agent-details-native = 通过 THINKTERM_AGENT 协议自行上报 工作中/等待/空闲;完整生命周期,无盲区。settings-agent-details-native-doc = 协议文档:ThinkTerm 仓库的 docs/agent-status.md。settings-agent-details-pending = 该 agent 暂无屏幕规则;生命周期 adapter 在计划中。它可以正常运行,只是暂不显示状态。+# --- 软件更新 --------------------------------------------------------------+settings-section-update = 软件更新+settings-update-current = ThinkTerm 已是最新版本。+settings-update-current-detail = ThinkTerm { $version }+settings-update-available = 有可用更新。+settings-update-available-detail = ThinkTerm { $latest } — 当前版本 { $current }+settings-update-local-build = 正在运行本地构建。+settings-update-local-build-detail = { $version } — 非发布版本+settings-update-unknown = 尚未检查过更新。+settings-update-unknown-detail = ThinkTerm { $version }+settings-update-check-now = 检查更新+settings-update-checked = 已检查+settings-update-automatic = 自动更新+settings-update-frequency = 检查频率+settings-update-frequency-off = 关闭+settings-update-frequency-daily = 每天+settings-update-frequency-weekly = 每周+settings-update-frequency-days = 每 { $count } 天+settings-update-frequency-hours = 每 { $count } 小时+settings-update-frequency-minutes = 每 { $count } 分钟+settings-update-last-checked = 上次检查+settings-update-never = 从未+settings-update-just-now = 刚刚+settings-update-minutes-ago = { $count } 分钟前+settings-update-hours-ago = { $count } 小时前+settings-update-whats-new = 更新内容+settings-update-all-releases = 查看全部版本+settings-update-manual-note = ThinkTerm 不会自行安装更新。++# --- 关于 ------------------------------------------------------------------+settings-about-version-line = 版本 { $version }+settings-about-copy = 复制信息+settings-about-copied = 已复制+settings-about-version = 版本+settings-about-build = 构建+settings-about-platform = 平台+settings-about-source = 源代码+settings-about-release-notes = 发布说明+settings-about-license = 许可证+settings-about-notices = 第三方声明+settings-about-privacy = 隐私+settings-about-config-file = 配置文件+settings-about-data-folder = 数据目录+# --- 侧栏 ------------------------------------------------------------------+settings-section-sidebar = 侧栏+settings-sidebar-description = 选择右侧栏提供哪些面板。全部关掉,侧栏就不显示了。+settings-sidebar-files-description = 浏览工作目录,以及通过 SFTP 浏览远程目录。+settings-sidebar-notes-description = 与项目放在一起的 Markdown 笔记。+settings-sidebar-snippets-description = 保存的命令和文本,可以粘贴到面板中。diff --git a/wezterm-gui/src/native_settings.rs b/wezterm-gui/src/native_settings.rsindex 0fa19dd1..87a7cb3c 100644--- a/wezterm-gui/src/native_settings.rs+++ b/wezterm-gui/src/native_settings.rs@@ -277,9 +277,17 @@ pub(crate) struct NativeChromeSettings {/// Workspace-thread statuses hidden by the sidebar view-options filter,/// as stable keys ("idle", "running", "needs-attention", "finished").pub(crate) workspace_sidebar_hidden_statuses: Vec<String>,+ /// Which panels the right sidebar offers. Absent means on. All four may+ /// be off at once -- that is how you get rid of the right sidebar -- and+ /// the sidebar plus its tab-bar toggle then stop being drawn. Settings is+ /// a separate window, so turning one back on is still reachable.+ pub(crate) right_sidebar_files_enabled: Option<bool>,+ pub(crate) right_sidebar_notes_enabled: Option<bool>,+ pub(crate) right_sidebar_snippets_enabled: Option<bool>,/// Feature toggle for agent status detection and the right-sidebar- /// Agents panel. Off by default; absent in settings.json means off.- pub(crate) agent_panel_enabled: bool,+ /// Agents panel. Absent means on -- it was off by default while the+ /// detection was new, and is a panel toggle like the three above now.+ pub(crate) agent_panel_enabled: Option<bool>,}#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]@@ -760,10 +768,35 @@ pub(crate) fn workspace_sidebar_hover_reveal_enabled() -> bool {.unwrap_or(true)}-/// Agent status detection + Agents panel feature toggle. Default off.-/// `load_shared`: asked once per work-status scan and once per sidebar frame.+/// Agent status detection + Agents panel feature toggle. Default on.+/// `load_shared`: asked once per work-status scan, and by the Agents arm of+/// `RightSidebarMode::panel_enabled`.pub(crate) fn agent_panel_enabled() -> bool {- load_shared().chrome.agent_panel_enabled+ load_shared().chrome.agent_panel_enabled.unwrap_or(true)+}++/// The three plain right-sidebar panel toggles, read under one lock. Absent+/// means on. Callers ask which panels are offered several times per frame --+/// `right_sidebar_width` alone is asked from 34 places -- and one+/// `load_shared` per panel adds up. Agents is not here: it needs the Lua+/// detector switch on top of its own toggle, so it goes through+/// `agent_status::enabled`.+pub(crate) struct RightSidebarPanelToggles {+ pub(crate) files: bool,+ pub(crate) notes: bool,+ pub(crate) snippets: bool,+}++pub(crate) fn right_sidebar_panel_toggles() -> RightSidebarPanelToggles {+ let settings = load_shared();+ RightSidebarPanelToggles {+ files: settings.chrome.right_sidebar_files_enabled.unwrap_or(true),+ notes: settings.chrome.right_sidebar_notes_enabled.unwrap_or(true),+ snippets: settings+ .chrome+ .right_sidebar_snippets_enabled+ .unwrap_or(true),+ }}pub(crate) fn right_sidebar_width() -> Option<usize> {diff --git a/wezterm-gui/src/settings_window.rs b/wezterm-gui/src/settings_window.rsindex 26712e1a..b844b147 100644--- a/wezterm-gui/src/settings_window.rs+++ b/wezterm-gui/src/settings_window.rs@@ -9,9 +9,10 @@ use crate::termwindow::render::corners::{use crate::termwindow::render::draw::draw_webgpu_layers;use crate::termwindow::webgpu::WebGpuState;use crate::ui::{- rect, scale_ui_f32, scale_ui_usize, BrandIcon, ButtonSpec, ControlState, EditModifiers,- InputCaret, InteractionState, ResizablePaneState, ScrollState, ScrollbarSpec, SettingsIcon,- SvgIcon, TextInputSpec, TextInputState, UiContext, UiPalette, UiTokens, WidgetKind,+ rect, scale_ui_f32, scale_ui_usize, BrandIcon, ButtonSpec, ButtonVariant, ControlState,+ EditModifiers, InputCaret, InteractionState, ResizablePaneState, ScrollState, ScrollbarSpec,+ SettingsIcon, SvgIcon, TextInputSpec, TextInputState, UiContext, UiPalette, UiTokens,+ WidgetKind,};use crate::utilsprites::RenderMetrics;use anyhow::{Context, Error};@@ -60,9 +61,22 @@ const SIDEBAR_BRAND_FONT_SIZE: f64 = if cfg!(target_os = "macos") {const SIDEBAR_BRAND_FONT_WEIGHT: u16 = 750;const CONTROL_HEIGHT: f32 = 56.0;const CONTROL_RADIUS: f32 = 14.0;-const NAV_ROW_RADIUS: f32 = 14.0;-const NAV_ROW_HEIGHT: f32 = 56.0;-const NAV_ROW_STEP: f32 = 68.0;+const HERO_PADDING: f32 = 36.0;+const HERO_MARK_SIZE: f32 = 108.0;+const SWITCH_WIDTH: f32 = 76.0;+const SWITCH_HEIGHT: f32 = 44.0;+const SWITCH_KNOB_INSET: f32 = 4.0;+// Matches termwindow::ui::tokens::SIDEBAR_ROW_HIGHLIGHT_RADIUS: the two+// sidebars draw the same shape.+const NAV_ROW_RADIUS: f32 = 20.0;+// Row geometry lifted from the main window's sidebar -- SESSION_ROW_MIN_HEIGHT,+// SIDEBAR_INSET and SIDEBAR_ROW_GAP in termwindow::ui. Both sidebars grow a row+// from their own font's cell height against a shared floor rather than pinning+// a constant, so a Settings row and a thread row are the same size even though+// the two use different font sizes.+const NAV_ROW_MIN_HEIGHT: f32 = 66.0;+const NAV_ROW_INSET: f32 = 10.0;+const NAV_ROW_GAP: f32 = 10.0;const HEADER_HEIGHT: f32 = 132.0;const SIDEBAR_TITLE_Y: f32 = 78.0;const SIDEBAR_TITLE_Y_WITH_CUSTOM_CHROME: f32 = 34.0;@@ -73,6 +87,7 @@ const SIDEBAR_BRAND_FONT_SIZE_WITH_CUSTOM_CHROME: f64 = if cfg!(target_os = "mac};const SIDEBAR_SEARCH_Y: f32 = 142.0;const SIDEBAR_LIST_TOP: f32 = 222.0;+const SIDEBAR_LIST_FADE_HEIGHT: f32 = 24.0;const CONTENT_TITLE_Y: f32 = 82.0;const CONTENT_SECTION_Y: f32 = 168.0;const CONTENT_RULE_Y: f32 = 202.0;@@ -88,6 +103,10 @@ thread_local! {static SETTINGS_WINDOW: RefCell<SettingsWindowSlot> =RefCell::new(SettingsWindowSlot::Closed);static SETTINGS_WINDOW_NEXT_ID: Cell<u64> = const { Cell::new(1) };+ /// A page requested before the window exists -- the app menu's Check for+ /// Updates opens Settings straight onto Software Update. Consumed by the+ /// next window to open, and only ever set when one is about to be.+ static PENDING_SECTION: Cell<Option<SettingsSection>> = const { Cell::new(None) };}enum SettingsWindowSlot {@@ -171,10 +190,115 @@ fn format_archived_when(archived_at: i64) -> String {}}+/// What sits at the left of a hero card: the app's own mark on About, or a+/// tinted status glyph on Software Update.+enum HeroBadge {+ AppIcon,+ Status { icon: SvgIcon, tint: LinearRgba },+}++/// What the Update page's status card can say. Derived from the on-disk+/// check cache rather than from a live query, which is why "up to date" is+/// only ever claimed for a build that actually carries a release tag.+#[derive(Debug, Clone)]+enum UpdateHero {+ /// No usable result on disk: either no check has run, or the cache is+ /// unreadable. Either way there is nothing to compare against.+ Unknown,+ UpToDate,+ Available {+ tag: String,+ },+ /// A commit-stamped build from a plain checkout. It has no ordering+ /// against any release tag, so releases simply do not apply to it.+ LocalBuild,+}++/// Semantic accents for the status badges. They stay local rather than+/// joining UiPalette because nothing else in the chrome carries a success or+/// neutral status color, and a token would imply a system that does not+/// exist. The action tint is not here: that one *is* the accent, so it reads+/// `palette.accent`.+fn status_tint_positive(appearance: Appearance) -> LinearRgba {+ match appearance {+ Appearance::Light | Appearance::LightHighContrast => rgba(52, 199, 89, 1.0),+ Appearance::Dark | Appearance::DarkHighContrast => rgba(48, 209, 88, 1.0),+ }+}++fn status_tint_neutral(appearance: Appearance) -> LinearRgba {+ match appearance {+ Appearance::Light | Appearance::LightHighContrast => rgba(142, 142, 147, 1.0),+ Appearance::Dark | Appearance::DarkHighContrast => rgba(120, 120, 128, 1.0),+ }+}++/// Secondary text sits a step below the label. Clamped at 350 so a user who+/// already runs a light UI weight does not end up with hairline text.+fn settings_body_font_weight(label_weight: u16) -> u16 {+ // Proportional, not a fixed subtraction. The label weight is a user+ // setting that ranges 300..800, and subtracting a constant collapses at+ // the light end: from a 400 label it lands on the floor and secondary+ // text ends up either identical to the label or Light-thin, neither of+ // which separates them.+ ((label_weight as f32 * 0.875) as u16).max(350)+}++/// Names the background check interval the way someone would say it out+/// loud, falling back to whole hours or minutes for a hand-edited value.+fn format_check_interval(seconds: u64) -> String {+ match seconds {+ 0 => crate::i18n::tr("settings-update-frequency-off"),+ 86_400 => crate::i18n::tr("settings-update-frequency-daily"),+ 604_800 => crate::i18n::tr("settings-update-frequency-weekly"),+ s if s % 86_400 == 0 => settings_tr(+ "settings-update-frequency-days",+ &[("count", (s / 86_400).to_string())],+ ),+ s if s % 3_600 == 0 => settings_tr(+ "settings-update-frequency-hours",+ &[("count", (s / 3_600).to_string())],+ ),+ s => settings_tr(+ "settings-update-frequency-minutes",+ &[("count", (s.max(60) / 60).to_string())],+ ),+ }+}++/// "just now" / "N minutes ago" / "N hours ago" / a local date. The recent+/// cases get words because recency is what the user is checking for; older+/// than a day, the date is more useful than a growing hour count.+fn format_last_checked(when: SystemTime) -> String {+ let Ok(elapsed) = when.elapsed() else {+ // A clock that moved backwards leaves the stamp in the future.+ return crate::i18n::tr("settings-update-just-now");+ };+ let secs = elapsed.as_secs();+ if secs < 90 {+ return crate::i18n::tr("settings-update-just-now");+ }+ if secs < 3_600 {+ return settings_tr(+ "settings-update-minutes-ago",+ &[("count", (secs / 60).to_string())],+ );+ }+ if secs < 86_400 {+ return settings_tr(+ "settings-update-hours-ago",+ &[("count", (secs / 3_600).to_string())],+ );+ }+ let when: chrono::DateTime<chrono::Local> = when.into();+ when.format("%Y-%m-%d %H:%M").to_string()+}+#[derive(Debug, Clone, Copy, PartialEq, Eq)]enum SettingsSection {General,Appearance,+ Sidebar,Terminal,Workspaces,Agents,@@ -185,12 +309,14 @@ enum SettingsSection {Developer,UiKit,Memory,+ Update,About,}const BASE_SECTIONS: &[SettingsSection] = &[SettingsSection::General,SettingsSection::Appearance,+ SettingsSection::Sidebar,SettingsSection::Terminal,SettingsSection::Workspaces,SettingsSection::Agents,@@ -199,6 +325,7 @@ const BASE_SECTIONS: &[SettingsSection] = &[SettingsSection::CommandPalette,SettingsSection::Compatibility,SettingsSection::Developer,+ SettingsSection::Update,SettingsSection::About,];@@ -241,6 +368,9 @@ fn initial_expanded_agent() -> Option<&'static str> {/// when the settings window opens (e.g. for unattended UI captures with/// `THINKTERM_FRAME_DUMP`). Names match the enum variants, case-insensitive.fn initial_section() -> SettingsSection {+ if let Some(section) = PENDING_SECTION.with(|pending| pending.take()) {+ return section;+ }let Some(name) = std::env::var_os("THINKTERM_SETTINGS_SECTION") else {return SettingsSection::Appearance;};@@ -248,6 +378,7 @@ fn initial_section() -> SettingsSection {let section = match name.as_str() {"general" => SettingsSection::General,"appearance" => SettingsSection::Appearance,+ "sidebar" => SettingsSection::Sidebar,"terminal" => SettingsSection::Terminal,"workspaces" => SettingsSection::Workspaces,"agents" => SettingsSection::Agents,@@ -256,6 +387,9 @@ fn initial_section() -> SettingsSection {"commandpalette" => SettingsSection::CommandPalette,"compatibility" => SettingsSection::Compatibility,"developer" => SettingsSection::Developer,+ "uikit" => SettingsSection::UiKit,+ "memory" => SettingsSection::Memory,+ "update" => SettingsSection::Update,"about" => SettingsSection::About,_ => SettingsSection::Appearance,};@@ -270,6 +404,7 @@ impl SettingsSection {match self {Self::General => crate::i18n::tr("settings-section-general"),Self::Appearance => crate::i18n::tr("settings-section-appearance"),+ Self::Sidebar => crate::i18n::tr("settings-section-sidebar"),Self::Terminal => crate::i18n::tr("settings-section-terminal"),Self::Workspaces => crate::i18n::tr("settings-section-workspaces"),Self::Agents => crate::i18n::tr("settings-section-agents"),@@ -280,6 +415,7 @@ impl SettingsSection {Self::Developer => crate::i18n::tr("settings-section-developer"),Self::UiKit => "UI Kit".to_string(),Self::Memory => "Memory".to_string(),+ Self::Update => crate::i18n::tr("settings-section-update"),Self::About => crate::i18n::tr("settings-section-about"),}}@@ -288,6 +424,7 @@ impl SettingsSection {match self {Self::General => SettingsIcon::General,Self::Appearance => SettingsIcon::Appearance,+ Self::Sidebar => SettingsIcon::Sidebar,Self::Terminal => SettingsIcon::Terminal,Self::Workspaces => SettingsIcon::Workspaces,Self::Agents => SettingsIcon::Agents,@@ -298,6 +435,7 @@ impl SettingsSection {Self::Developer => SettingsIcon::Developer,Self::UiKit => SettingsIcon::UiKit,Self::Memory => SettingsIcon::Memory,+ Self::Update => SettingsIcon::Update,Self::About => SettingsIcon::About,}}@@ -450,7 +588,36 @@ impl SettingsSection {"Key Events","P95",],- Self::About => &["About", "Version", "ThinkTerm"],+ Self::Sidebar => &[+ "Sidebar",+ "Panels",+ "Files",+ "Notes",+ "Snippets",+ "Agents",+ "Agent Panel",+ "Right Sidebar",+ ],+ Self::Update => &[+ "Update",+ "Software Update",+ "Check for Updates",+ "Automatic Updates",+ "Release",+ "Upgrade",+ "Version",+ ],+ Self::About => &[+ "About",+ "Version",+ "Build",+ "ThinkTerm",+ "License",+ "Source Code",+ "Privacy",+ "Third-Party",+ "Diagnostics",+ ],}}@@ -554,7 +721,8 @@ enum SettingsAction {ToggleImportField(ImportFieldId),ToggleMainWindowFrameRestore,ToggleNotificationSounds,- ToggleAgentPanel,+ /// Turn one right-sidebar panel on or off.+ ToggleRightSidebarPanel(crate::termwindow::RightSidebarMode),ToggleAgentDetails(&'static str),/// Index into the archived rows cached at paint time.UnarchiveArchivedRow(usize),@@ -568,6 +736,14 @@ enum SettingsAction {ToggleInputDiagnostics,ResetInputDiagnostics,CopyInputDiagnostics,+ CheckForUpdates,+ OpenLatestRelease,+ OpenReleasesIndex,+ OpenSourceRepository,+ OpenThirdPartyNotices,+ OpenPrivacyPolicy,+ OpenDataFolder,+ CopyVersionInfo,ToggleThemeModeMenu,SetThemeMode(NativeThemeMode),ToggleLanguageMenu,@@ -1063,6 +1239,14 @@ struct SettingsUiState {/// once. A second click executes; any other action clears it.confirm_delete_archived: Option<String>,input_diagnostics_copied_until: Option<Instant>,+ /// The Update page's view of the on-disk check cache. Read when the+ /// section is entered and when Check Now is clicked, never while+ /// painting: it stats and reads a file, and the paint path must not.+ update_status: Option<crate::update::CachedUpdateStatus>,+ /// Set briefly after Check Now so the button can report that it ran even+ /// when the cached answer is unchanged.+ update_checked_until: Option<Instant>,+ version_info_copied_until: Option<Instant>,sidebar_scrollbar_visible_until: Option<Instant>,content_scrollbar_visible_until: Option<Instant>,}@@ -1097,6 +1281,9 @@ impl SettingsUiState {shell_catalog: Vec::new(),confirm_delete_archived: None,input_diagnostics_copied_until: None,+ update_status: None,+ update_checked_until: None,+ version_info_copied_until: None,sidebar_scrollbar_visible_until: None,content_scrollbar_visible_until: None,}@@ -1472,11 +1659,14 @@ struct SettingsPalette {nav_hover_bg: LinearRgba,nav_pressed_bg: LinearRgba,nav_selected_bg: LinearRgba,+ nav_selected_border: LinearRgba,control_bg: LinearRgba,control_hover_bg: LinearRgba,control_pressed_bg: LinearRgba,control_border: LinearRgba,card_bg: LinearRgba,+ accent: LinearRgba,+ on_accent: LinearRgba,title: LinearRgba,text: LinearRgba,secondary_text: LinearRgba,@@ -1485,6 +1675,34 @@ struct SettingsPalette {rule: LinearRgba,}+/// Open Settings on the Software Update page. This is where the app menu's+/// Check for Updates lands: one page that already carries the status, the+/// automatic-check preference and the release links, rather than a second+/// dialog that can only say one of those things in isolation.+pub fn show_update_page() {+ let switched = SETTINGS_WINDOW.with(|slot| {+ let slot = slot.borrow();+ let SettingsWindowSlot::Open { settings, .. } = &*slot else {+ return false;+ };+ let mut settings = settings.borrow_mut();+ // An Open slot whose window is gone opens a fresh one below, which+ // reads the pending section instead.+ if settings.window.is_none() {+ return false;+ }+ settings.enter_section(SettingsSection::Update);+ if let Some(window) = settings.window.as_ref() {+ window.invalidate();+ }+ true+ });+ if !switched {+ PENDING_SECTION.with(|pending| pending.set(Some(SettingsSection::Update)));+ }+ show();+}+pub fn show() {let action = SETTINGS_WINDOW.with(|slot| {let mut slot = slot.borrow_mut();@@ -1579,11 +1797,17 @@ struct SettingsWindow {window_state: WindowState,fonts: Rc<FontConfiguration>,ui_font: Rc<LoadedFont>,+ /// The same family two weights lighter, for every secondary line. One+ /// weight for labels and explanations made the two read as equally+ /// important; macOS separates them by weight, not only by color.+ body_font: Rc<LoadedFont>,title_font: Rc<LoadedFont>,sidebar_title_font: Rc<LoadedFont>,metrics: RenderMetrics,render_state: Option<RenderState>,webgpu: Option<Rc<WebGpuState>>,+ /// Last system appearance seen. Not used for painting -- see+ /// `effective_appearance` -- only to notice that a repaint is due.appearance: Appearance,selected: SettingsSection,agents_expanded: Option<&'static str>,@@ -1646,6 +1870,10 @@ impl SettingsWindow {)?;let ui_font = fonts.command_palette_font_with_size_and_weight(settings_font_size, settings_font_weight)?;+ let body_font = fonts.command_palette_font_with_size_and_weight(+ settings_font_size,+ settings_body_font_weight(settings_font_weight),+ )?;let metrics = RenderMetrics::with_font_metrics(&ui_font.metrics());let appearance = Connection::get().map(|conn| conn.get_appearance())@@ -1694,6 +1922,9 @@ impl SettingsWindow {// jump to it without passing through the section action. A handful of// path probes, and never from the paint path.ui.shell_catalog = shell_catalog_including(native_settings.terminal.default_shell.as_ref());+ // Same reasoning for the update cache: the window can open straight+ // onto Update or About, and both read it while painting.+ ui.update_status = Some(crate::update::cached_update_status());let settings = Rc::new(RefCell::new(Self {instance_id,@@ -1703,6 +1934,7 @@ impl SettingsWindow {window_state: WindowState::default(),fonts: Rc::clone(&fonts),ui_font,+ body_font,title_font,sidebar_title_font,metrics,@@ -2219,6 +2451,22 @@ impl SettingsWindow {settings.ui.memory_snapshot_copied_until = None;window.invalidate();}+ if settings+ .ui+ .update_checked_until+ .is_some_and(|until| Instant::now() >= until)+ {+ settings.ui.update_checked_until = None;+ window.invalidate();+ }+ if settings+ .ui+ .version_info_copied_until+ .is_some_and(|until| Instant::now() >= until)+ {+ settings.ui.version_info_copied_until = None;+ window.invalidate();+ }if settings.ui.input_diagnostics_copied_until@@ -2894,6 +3142,10 @@ impl SettingsWindow {Self::sidebar_brand_font_size_for_config(&configuration()),SIDEBAR_BRAND_FONT_WEIGHT,)?;+ self.body_font = self.fonts.command_palette_font_with_size_and_weight(+ settings_font_size,+ settings_body_font_weight(settings_font_weight),+ )?;self.metrics = RenderMetrics::with_font_metrics(&self.ui_font.metrics());self.invalidate_shaped_text();Ok(())@@ -2961,59 +3213,53 @@ impl SettingsWindow {}}+ /// The theme this window paints in.+ ///+ /// The system half is read live, which is what the main window's chrome+ /// does (`native_settings::effective_appearance`). It used to come from a+ /// snapshot taken when this window was built and refreshed only by an+ /// `AppearanceChanged` event -- so any moment the snapshot was wrong (the+ /// window built before AppKit settled on the system appearance, or an+ /// event that never arrived) left Settings painting a different theme+ /// from the terminal behind it. The theme *mode* still comes from this+ /// window's own copy so an edit previews before it is saved.fn effective_appearance(&self) -> Appearance {self.native_settings.appearance.theme_mode- .effective_appearance(self.appearance)+ .effective_appearance(crate::native_settings::system_appearance())}+ /// Every field reads a `UiPalette` token, so Settings tracks the main+ /// window by construction. It stopped doing that once: two arms that+ /// differed only in a hand-written `card_bg`, which was the token's value+ /// copied out by hand and would have gone stale the first time the token+ /// moved.fn palette(&self) -> SettingsPalette {- let appearance = self.effective_appearance();- let ui = UiPalette::for_appearance(appearance);- match appearance {- Appearance::Light | Appearance::LightHighContrast => SettingsPalette {- window_bg: ui.window_bg,- sidebar_bg: ui.workspace_sidebar_bg,- separator: ui.separator,- search_bg: ui.control_bg,- search_border: ui.control_border,- nav_hover_bg: ui.sidebar_row_hover_bg,- nav_pressed_bg: ui.control_pressed_bg,- nav_selected_bg: ui.sidebar_row_active_bg,- control_bg: ui.control_bg,- control_hover_bg: ui.control_hover_bg,- control_pressed_bg: ui.control_pressed_bg,- control_border: ui.control_border,- card_bg: rgba(255, 255, 255, 0.72),- title: ui.text,- text: ui.text,- secondary_text: ui.secondary_text,- muted_text: ui.muted_text,- selected_text: ui.text,- rule: ui.separator,- },- Appearance::Dark | Appearance::DarkHighContrast => SettingsPalette {- window_bg: ui.window_bg,- sidebar_bg: ui.workspace_sidebar_bg,- separator: ui.separator,- search_bg: ui.control_bg,- search_border: ui.control_border,- nav_hover_bg: ui.sidebar_row_hover_bg,- nav_pressed_bg: ui.control_pressed_bg,- nav_selected_bg: ui.sidebar_row_active_bg,- control_bg: ui.control_bg,- control_hover_bg: ui.control_hover_bg,- control_pressed_bg: ui.control_pressed_bg,- control_border: ui.control_border,- card_bg: rgba(30, 30, 32, 0.78),- title: ui.text,- text: ui.text,- secondary_text: ui.secondary_text,- muted_text: ui.muted_text,- selected_text: ui.text,- rule: ui.separator,- },+ let ui = UiPalette::for_appearance(self.effective_appearance());+ SettingsPalette {+ window_bg: ui.window_bg,+ sidebar_bg: ui.workspace_sidebar_bg,+ separator: ui.separator,+ search_bg: ui.control_bg,+ search_border: ui.control_border,+ nav_hover_bg: ui.sidebar_row_hover_bg,+ nav_pressed_bg: ui.sidebar_row_pressed_bg,+ nav_selected_bg: ui.sidebar_row_active_bg,+ nav_selected_border: ui.sidebar_row_active_border,+ control_bg: ui.control_bg,+ control_hover_bg: ui.control_hover_bg,+ control_pressed_bg: ui.control_pressed_bg,+ control_border: ui.control_border,+ card_bg: ui.card_bg,+ accent: ui.accent,+ on_accent: ui.on_accent,+ title: ui.text,+ text: ui.text,+ secondary_text: ui.secondary_text,+ muted_text: ui.muted_text,+ selected_text: ui.text,+ rule: ui.separator,}}@@ -3071,6 +3317,37 @@ impl SettingsWindow {(card_y, first_row_y)}+ fn sidebar_icon_size(&self) -> f32 {+ (self.metrics.cell_size.height as f32 + self.ui_px(8.0))+ .clamp(self.ui_px(24.0), self.ui_px(34.0))+ .round()+ }++ fn nav_row_height(&self) -> f32 {+ ((self.metrics.cell_size.height as f32).max(self.sidebar_icon_size())+ + self.ui_px(NAV_ROW_INSET))+ .max(self.ui_px(NAV_ROW_MIN_HEIGHT))+ }++ fn sidebar_list_top(&self) -> f32 {+ self.ui_px(SIDEBAR_LIST_TOP)+ }++ fn nav_row_step(&self) -> f32 {+ self.nav_row_height() + self.ui_px(NAV_ROW_GAP)+ }++ /// Width of the control column shared by every settings row kind, so a+ /// value pill, a toggle and a link button all line up on the same right+ /// edge no matter which rows a card mixes.+ fn settings_control_width(width: f32) -> f32 {+ if width >= 680.0 {+ 280.0_f32.min(width * 0.36)+ } else {+ 220.0_f32.min(width * 0.44)+ }+ }+fn settings_content_extent(&self, bottom_y: f32) -> f32 {(bottom_y + self.ui_px(65.0)).max(self.content_bottom())}@@ -3079,13 +3356,41 @@ impl SettingsWindow {self.native_settings.developer.developer_mode}+ /// Everything a section needs done when it becomes the visible page.+ /// Shared by the sidebar click and by an external request to open a+ /// particular page, so a page reached from the app menu arrives in the+ /// same state as one clicked into.+ fn enter_section(&mut self, section: SettingsSection) {+ self.selected = section;+ self.ui.content_scroll.reset();+ self.ui.open_dropdown = None;+ if section == SettingsSection::Agents {+ // Probe PATH on entry so painting never touches the filesystem.+ crate::agent_status::refresh_path_probe();+ }+ if section == SettingsSection::Terminal {+ // Same rule: shell discovery stats candidate paths, so it happens+ // on entry and the row paints from the cache.+ self.refresh_shell_catalog();+ }+ if matches!(section, SettingsSection::Update | SettingsSection::About) {+ // Re-read the cache the background checker writes, so re-entering+ // the page picks up a check that ran while the window sat on+ // another section.+ self.ui.update_status = Some(crate::update::cached_update_status());+ }+ }+fn visible_sections(&self) -> Vec<SettingsSection> {let mut sections = Vec::with_capacity(BASE_SECTIONS.len() + DEVELOPER_SECTIONS.len());for section in BASE_SECTIONS {- if *section == SettingsSection::About && self.developer_mode_enabled() {+ sections.push(*section);+ // The developer pages belong to Developer, not to whatever+ // happens to follow it in BASE_SECTIONS; anchoring on Developer+ // keeps them adjacent to it as sections are added below.+ if *section == SettingsSection::Developer && self.developer_mode_enabled() {sections.extend_from_slice(DEVELOPER_SECTIONS);}- sections.push(*section);}sections}@@ -3130,19 +3435,7 @@ impl SettingsWindow {}SettingsAction::Select(section) => {self.commit_focused_input();- self.selected = section;- self.ui.content_scroll.reset();- self.ui.open_dropdown = None;- if section == SettingsSection::Agents {- // Probe PATH on entry so painting never touches the- // filesystem.- crate::agent_status::refresh_path_probe();- }- if section == SettingsSection::Terminal {- // Same rule: shell discovery stats candidate paths, so- // it happens on entry and the row paints from the cache.- self.refresh_shell_catalog();- }+ self.enter_section(section);}SettingsAction::OpenThinkTermConfigFile => {self.ui.open_dropdown = None;@@ -3571,27 +3864,33 @@ impl SettingsWindow {}window.invalidate();}- SettingsAction::ToggleAgentPanel => {+ SettingsAction::ToggleRightSidebarPanel(panel) => {self.ui.open_dropdown = None;- self.native_settings.chrome.agent_panel_enabled =- !self.native_settings.chrome.agent_panel_enabled;+ let slot = self.right_sidebar_panel_slot(panel);+ *slot = Some(!slot.unwrap_or(true));match crate::native_settings::save(&self.native_settings) {Ok(()) => {- // After the save so the detector's preference- // closure reads the new shared value; without this- // the gate waits for the next safety tick.+ // After the save so the agent detector's preference+ // closure reads the new shared value; without this the+ // gate waits for the next safety tick.mux::agent_status::refresh_enabled();- self.status = if self.native_settings.chrome.agent_panel_enabled {- crate::i18n::tr("settings-agent-panel-enabled")- } else {- crate::i18n::tr("settings-agent-panel-disabled")- };+ // Not invalidate_all_windows: the sidebar's width can+ // have gone to or from zero, and only a real relayout+ // resizes the panes around that.if let Some(front_end) = crate::frontend::try_front_end() {- front_end.invalidate_all_windows();+ for gui_window in front_end.gui_windows() {+ gui_window.window.notify(+ crate::termwindow::TermWindowNotif::Apply(Box::new(+ |term_window| {+ term_window.right_sidebar_panels_changed();+ },+ )),+ );+ }}}Err(err) => {- self.status = format!("Unable to save agent panel setting: {err:#}");+ self.status = format!("Unable to save sidebar panel setting: {err:#}");}}}@@ -3678,6 +3977,61 @@ impl SettingsWindow {self.schedule_copied_state_clear(window);}}+ SettingsAction::CheckForUpdates => {+ self.ui.open_dropdown = None;+ // The live query is not wired up yet. Re-reading the cache the+ // background checker maintains is the same answer a check that+ // found nothing new would produce, and it costs one stat plus+ // one small read rather than a blocking HTTP request on the UI+ // thread. The live check replaces this call, not the button.+ self.ui.update_status = Some(crate::update::cached_update_status());+ self.ui.update_checked_until = Some(Instant::now() + Duration::from_millis(1400));+ self.schedule_copied_state_clear(window);+ }+ SettingsAction::OpenLatestRelease => {+ self.ui.open_dropdown = None;+ let url = self+ .ui+ .update_status+ .as_ref()+ .and_then(|status| status.latest.as_ref())+ .map(|latest| crate::update::release_tag_url(&latest.tag_name))+ .unwrap_or_else(crate::update::releases_url);+ wezterm_open_url::open_url(&url);+ }+ SettingsAction::OpenReleasesIndex => {+ self.ui.open_dropdown = None;+ wezterm_open_url::open_url(&crate::update::releases_url());+ }+ SettingsAction::OpenSourceRepository => {+ self.ui.open_dropdown = None;+ wezterm_open_url::open_url(crate::update::REPO_URL);+ }+ SettingsAction::OpenThirdPartyNotices => {+ self.ui.open_dropdown = None;+ wezterm_open_url::open_url(&format!(+ "{}/blob/main/NOTICE",+ crate::update::REPO_URL+ ));+ }+ SettingsAction::OpenPrivacyPolicy => {+ self.ui.open_dropdown = None;+ wezterm_open_url::open_url(&format!(+ "{}/blob/main/PRIVACY.md",+ crate::update::REPO_URL+ ));+ }+ SettingsAction::OpenDataFolder => {+ self.ui.open_dropdown = None;+ Self::open_path(config::DATA_DIR.clone());+ }+ SettingsAction::CopyVersionInfo => {+ self.ui.open_dropdown = None;+ window.set_clipboard(Clipboard::Clipboard, self.version_info_for_clipboard());+ self.ui.version_info_copied_until =+ Some(Instant::now() + Duration::from_millis(1400));+ self.schedule_copied_state_clear(window);+ }SettingsAction::ToggleInputDiagnostics => {self.ui.open_dropdown = None;let enabled = !crate::input_diagnostics::enabled();@@ -4283,14 +4637,12 @@ impl SettingsWindow {fn paint_sidebar(&mut self, layers: &mut TripleLayerQuadAllocator<'_>) -> anyhow::Result<()> {let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let sidebar_title_font = Rc::clone(&self.sidebar_title_font);let nav_font = Rc::clone(&self.ui_font);let tokens = self.ui.tokens;let sidebar_width = self.ui.sidebar.width;- let sidebar_icon_size = ((self.metrics.cell_size.height as f32 + self.ui_px(8.0))- .clamp(self.ui_px(24.0), self.ui_px(34.0))- .round()) as usize;+ let sidebar_icon_size = self.sidebar_icon_size();self.draw_text(layers,@@ -4308,61 +4660,9 @@ impl SettingsWindow {sidebar_width - tokens.sidebar_padding * 2.0,tokens.control_height,);- let search_text = self.ui.search.text().to_string();- self.paint_text_input(- layers,- TextInputSpec {- placeholder: &crate::i18n::tr("settings-search-placeholder"),- text: &search_text,- rect: search_rect,- focused: self.ui.interaction.focused == Some(SettingsAction::SearchInput),- selected_all: self.ui.search.selected_all,- action: SettingsAction::SearchInput,- },- )?;- self.draw_svg_icon(- layers,- SettingsIcon::Search.svg(),- search_rect.origin.x + self.ui_px(15.0),- search_rect.origin.y + (search_rect.size.height - sidebar_icon_size as f32) / 2.0,- sidebar_icon_size as f32,- palette.muted_text,- )?;- if !self.ui.search.is_empty() {- let clear_size = self.ui_px(34.0);- let clear_icon_size = self.ui_px(24.0);- let clear_rect = rect(- search_rect.origin.x + search_rect.size.width - clear_size - self.ui_px(10.0),- search_rect.origin.y + (search_rect.size.height - clear_size) / 2.0,- clear_size,- clear_size,- );- self.ui_context- .push(clear_rect, WidgetKind::Button, SettingsAction::ClearSearch);- if self.ui.interaction.hovered == Some(SettingsAction::ClearSearch)- || self.ui.interaction.pressed == Some(SettingsAction::ClearSearch)- {- self.draw_rounded_rect(- layers,- 0,- clear_rect.origin.x,- clear_rect.origin.y,- clear_rect.size.width,- clear_rect.size.height,- palette.control_hover_bg,- self.ui_px(14.0),- )?;- }- self.draw_svg_icon(- layers,- SettingsIcon::Clear.svg(),- clear_rect.origin.x + (clear_rect.size.width - clear_icon_size) / 2.0,- clear_rect.origin.y + (clear_rect.size.height - clear_icon_size) / 2.0,- clear_icon_size,- palette.secondary_text,- )?;- }-+ // Painted below, after the nav list and on the top layer: the mask+ // that hides the list's overhang reaches up into this field, so the+ // field has to go down after it and above it.let handle_rect = rect(sidebar_width - tokens.resize_handle_width / 2.0,0.0,@@ -4392,10 +4692,10 @@ impl SettingsWindow {)?;let sections = self.filtered_sections();- let list_top = self.ui_px(SIDEBAR_LIST_TOP);+ let list_top = self.sidebar_list_top();let list_bottom = (self.dimensions.pixel_height as f32 - self.ui_px(16.0)).max(list_top);let list_height = list_bottom - list_top;- let content_extent = sections.len() as f32 * self.ui_px(NAV_ROW_STEP) + 8.0;+ let content_extent = sections.len() as f32 * self.nav_row_step() + 8.0;self.ui.sidebar_scroll.set_extents(list_height, content_extent.max(list_height));@@ -4410,7 +4710,7 @@ impl SettingsWindow {if sections.is_empty() {self.draw_text(layers,- &ui_font,+ &body_font,tokens.sidebar_padding + 12.0,list_top + self.ui_px(18.0),&crate::i18n::tr("settings-search-no-results"),@@ -4420,15 +4720,15 @@ impl SettingsWindow {}for section in sections {- if y + self.ui_px(NAV_ROW_HEIGHT) < list_top || y > list_bottom {- y += self.ui_px(NAV_ROW_STEP);+ if y + self.nav_row_height() < list_top || y > list_bottom {+ y += self.nav_row_step();continue;}let action = SettingsAction::Select(section);let selected = section == self.selected;let hovered = self.ui.interaction.hovered == Some(action);let pressed = self.ui.interaction.pressed == Some(action);- let row_y = y - self.ui_px(6.0);+ let row_y = y;let row_x = tokens.sidebar_padding;let row_width = sidebar_width - tokens.sidebar_padding * 2.0;let row_bg = if selected {@@ -4440,24 +4740,43 @@ impl SettingsWindow {} else {None};- if let Some(row_bg) = row_bg {- self.draw_rounded_rect(+ let row_height = self.nav_row_height();+ let row_radius = self.ui_px(NAV_ROW_RADIUS);+ if selected {+ // Shadow, fill, then hairline border -- the same three passes+ // the main window's sidebar gives its active row.+ self.paint_active_row_shadow(+ layers, row_x, row_y, row_width, row_height, row_radius,+ )?;+ self.draw_rounded_frame(layers,0,row_x,row_y,row_width,- self.ui_px(NAV_ROW_HEIGHT),- row_bg,- self.ui_px(NAV_ROW_RADIUS),+ row_height,+ palette.nav_selected_bg,+ palette.nav_selected_border,+ row_radius,+ )?;+ } else if let Some(row_bg) = row_bg {+ self.draw_rounded_rect(+ layers, 0, row_x, row_y, row_width, row_height, row_bg, row_radius,)?;}- self.ui_context.push(- rect(row_x, row_y, row_width, self.ui_px(NAV_ROW_HEIGHT)),- WidgetKind::SidebarRow,- action,- );+ // Clamped to the list, matching the main window's sidebar: the+ // part of a half-scrolled row that sits above the list is hidden,+ // and a hidden row must not be clickable.+ let hit_top = row_y.max(list_top);+ let hit_bottom = (row_y + self.nav_row_height()).min(list_bottom);+ if hit_bottom > hit_top {+ self.ui_context.push(+ rect(row_x, hit_top, row_width, hit_bottom - hit_top),+ WidgetKind::SidebarRow,+ action,+ );+ }let text_color = if selected {palette.selected_text} else {@@ -4467,8 +4786,8 @@ impl SettingsWindow {layers,section.icon().svg(),row_x + self.ui_px(14.0),- row_y + (self.ui_px(NAV_ROW_HEIGHT) - sidebar_icon_size as f32) / 2.0,- sidebar_icon_size as f32,+ row_y + (self.nav_row_height() - sidebar_icon_size) / 2.0,+ sidebar_icon_size,text_color,)?;let section_label = section.label();@@ -4476,12 +4795,72 @@ impl SettingsWindow {layers,&nav_font,row_x + self.ui_px(56.0),- self.control_text_y(row_y, self.ui_px(NAV_ROW_HEIGHT)),+ self.control_text_y(row_y, self.nav_row_height()),§ion_label,text_color,row_width - self.ui_px(76.0),)?;- y += self.ui_px(NAV_ROW_STEP);+ y += self.nav_row_step();+ }++ self.paint_sidebar_top_mask(layers, list_area)?;+ let search_text = self.ui.search.text().to_string();+ self.paint_text_input(+ layers,+ 2,+ TextInputSpec {+ placeholder: &crate::i18n::tr("settings-search-placeholder"),+ text: &search_text,+ rect: search_rect,+ focused: self.ui.interaction.focused == Some(SettingsAction::SearchInput),+ selected_all: self.ui.search.selected_all,+ action: SettingsAction::SearchInput,+ },+ )?;+ self.draw_svg_icon(+ layers,+ SettingsIcon::Search.svg(),+ search_rect.origin.x + self.ui_px(15.0),+ search_rect.origin.y + (search_rect.size.height - sidebar_icon_size) / 2.0,+ sidebar_icon_size,+ palette.muted_text,+ )?;+ if !self.ui.search.is_empty() {+ let clear_size = self.ui_px(34.0);+ let clear_icon_size = self.ui_px(24.0);+ let clear_rect = rect(+ search_rect.origin.x + search_rect.size.width - clear_size - self.ui_px(10.0),+ search_rect.origin.y + (search_rect.size.height - clear_size) / 2.0,+ clear_size,+ clear_size,+ );+ self.ui_context+ .push(clear_rect, WidgetKind::Button, SettingsAction::ClearSearch);+ if self.ui.interaction.hovered == Some(SettingsAction::ClearSearch)+ || self.ui.interaction.pressed == Some(SettingsAction::ClearSearch)+ {+ // Layer 2, with the field: layers composite bottom-up+ // regardless of call order, so a highlight on layer 0 sits+ // under the field's own fill and is never seen.+ self.draw_rounded_rect(+ layers,+ 2,+ clear_rect.origin.x,+ clear_rect.origin.y,+ clear_rect.size.width,+ clear_rect.size.height,+ palette.control_hover_bg,+ self.ui_px(14.0),+ )?;+ }+ self.draw_svg_icon(+ layers,+ SettingsIcon::Clear.svg(),+ clear_rect.origin.x + (clear_rect.size.width - clear_icon_size) / 2.0,+ clear_rect.origin.y + (clear_rect.size.height - clear_icon_size) / 2.0,+ clear_icon_size,+ palette.secondary_text,+ )?;}self.paint_scrollbar(@@ -4494,12 +4873,77 @@ impl SettingsWindow {Ok(())}- fn paint_content(&mut self, layers: &mut TripleLayerQuadAllocator<'_>) -> anyhow::Result<()> {+ /// Hide what the nav list hangs above its own area.+ ///+ /// Rows are culled against the list but not clipped to it, so a row+ /// scrolled halfway out still paints its full height -- upwards, into the+ /// search field. The opaque band swallows that overhang and the ramp under+ /// it dissolves the row, the way `ssh_hosts_view::paint_list_fades` does+ /// for its list. Only the top: at the bottom the row runs off the window,+ /// which is what a list is supposed to look like.+ fn paint_sidebar_top_mask(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ list_area: window::RectF,+ ) -> anyhow::Result<()> {+ if list_area.size.width <= 0.0 || list_area.size.height <= 0.0 {+ return Ok(());+ }let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);- let title_font = Rc::clone(&self.title_font);- let sidebar_width = self.ui.sidebar.width;- let window_width = self.dimensions.pixel_width as f32;+ let scroll = self.ui.sidebar_scroll;++ // Opaque, a full row tall, ending at the list. A row is culled only+ // once it is entirely above the list, so it hangs up to one row height+ // over this band -- which means the band reaches into the search field+ // and the field is repainted over it on a higher layer. Sizing the+ // band to the tallest element is the rule from+ // `right_sidebar::sidebar_row_element_visible`; a shorter band silently+ // goes back to withholding rows near the edge instead of sliding them.+ let gap_top = list_area.origin.y - self.nav_row_height();+ let gap_height = list_area.origin.y - gap_top;+ if gap_height > 0.0 {+ self.draw_rect(+ layers,+ 2,+ list_area.origin.x,+ gap_top,+ list_area.size.width,+ gap_height,+ palette.sidebar_bg,+ )?;+ }++ let fade = self+ .ui_px(SIDEBAR_LIST_FADE_HEIGHT)+ .min(list_area.size.height)+ .ceil() as usize;+ if fade == 0 {+ return Ok(());+ }+ if scroll.offset > 0.5 {+ for step in 0..fade {+ let progress = step as f32 / fade as f32;+ let alpha = 1.0 - progress * progress * (3.0 - 2.0 * progress);+ self.draw_rect(+ layers,+ 2,+ list_area.origin.x,+ list_area.origin.y + step as f32,+ list_area.size.width,+ 1.0,+ palette.sidebar_bg.mul_alpha(alpha),+ )?;+ }+ }+ Ok(())+ }++ fn paint_content(&mut self, layers: &mut TripleLayerQuadAllocator<'_>) -> anyhow::Result<()> {+ let palette = self.palette();+ let ui_font = Rc::clone(&self.ui_font);+ let title_font = Rc::clone(&self.title_font);+ let sidebar_width = self.ui.sidebar.width;+ let window_width = self.dimensions.pixel_width as f32;let content_gap = if window_width < 980.0 { 30.0 } else { 46.0 };let right_margin = if window_width < 980.0 { 34.0 } else { 50.0 };let x = sidebar_width + content_gap;@@ -4550,13 +4994,9 @@ impl SettingsWindow {SettingsSection::Developer => self.paint_developer(layers, x, max_width)?,SettingsSection::UiKit => self.paint_ui_kit(layers, x, max_width)?,SettingsSection::Memory => self.paint_memory_diagnostics(layers, x, max_width)?,- SettingsSection::About => self.paint_placeholder(- layers,- &ui_font,- x,- &crate::i18n::tr("settings-about-description"),- max_width,- )?,+ SettingsSection::Sidebar => self.paint_sidebar_settings(layers, x, max_width)?,+ SettingsSection::Update => self.paint_update(layers, x, max_width)?,+ SettingsSection::About => self.paint_about(layers, x, max_width)?,}self.paint_scrollbar(layers,@@ -4576,7 +5016,7 @@ impl SettingsWindow {max_width: f32,) -> anyhow::Result<()> {let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let scroll = self.ui.content_scroll.offset;let row_step = self.settings_row_step();let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;@@ -4606,7 +5046,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,section_y,&crate::i18n::tr("settings-general-heading"),@@ -4682,7 +5122,7 @@ impl SettingsWindow {max_width: f32,) -> anyhow::Result<()> {let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let config = configuration();let scroll = self.ui.content_scroll.offset;let row_step = self.settings_row_step();@@ -4710,7 +5150,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,section_y,&crate::i18n::tr("settings-appearance-theme-heading"),@@ -4765,7 +5205,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,typography_title_y,&crate::i18n::tr("settings-typography-heading"),@@ -4826,6 +5266,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let scroll = self.ui.content_scroll.offset;let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;@@ -4844,7 +5285,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,section_y,&crate::i18n::tr("settings-archived-heading"),@@ -4892,7 +5333,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,row_x + tile + icon_gap,first_row_y,&crate::i18n::tr("settings-archived-empty"),@@ -4980,7 +5421,7 @@ impl SettingsWindow {meta_args.set("when", format_archived_when(row.archived_at));self.draw_text(layers,- &ui_font,+ &body_font,text_x,self.settings_row_description_y(y),&crate::i18n::tr_args("settings-archived-meta", &meta_args),@@ -5019,7 +5460,7 @@ impl SettingsWindow {max_width: f32,) -> anyhow::Result<()> {let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let scroll = self.ui.content_scroll.offset;let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;// Idle timeout, download folder, its reset, and the drop destination.@@ -5040,7 +5481,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,section_y,&crate::i18n::tr("settings-workspaces-heading"),@@ -5110,7 +5551,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,sounds_title_y,&crate::i18n::tr("settings-notifications-heading"),@@ -5138,7 +5579,7 @@ impl SettingsWindow {max_width: f32,) -> anyhow::Result<()> {let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let scroll = self.ui.content_scroll.offset;let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;// Hotkey, rows, font size, group search.@@ -5152,7 +5593,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,section_y,&crate::i18n::tr("settings-command-palette-heading"),@@ -5273,16 +5714,14 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let scroll = self.ui.content_scroll.offset;let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;- // Card 1: the panel/detection feature toggle.- let toggle_row_count = 1;- let (card_y, first_row_y) = self.settings_card_geometry(section_y, toggle_row_count);- let card_height = self.settings_card_height(toggle_row_count);- // Card 2: one row per supported agent. Clicking a row expands an- // inset card explaining how that agent is covered; the outer card- // grows by the detail block's height.+ // One row per supported agent. Clicking a row expands an inset card+ // explaining how that agent is covered; the outer card grows by the+ // detail block's height. Whether the panel is shown at all is a+ // sidebar question and lives in Settings > Sidebar.let integrations_row_count = crate::agent_status::SUPPORTED_AGENTS.len();let padding = 36.0;let row_x = x + padding;@@ -5324,8 +5763,8 @@ impl SettingsWindow {(detail_block_rel_y + detail_block_height + self.ui_px(18.0) - row_step).max(0.0)}).unwrap_or(0.0);- let integrations_title_y = card_y + card_height + self.settings_section_card_gap();- let integrations_card_y = integrations_title_y + self.settings_section_card_gap().min(54.0);+ let integrations_title_y = section_y;+ let integrations_card_y = integrations_title_y + self.settings_section_card_gap();let integrations_first_row_y = integrations_card_y + self.settings_card_top_padding();let mut integrations_card_height =self.settings_card_height(integrations_row_count) + expanded_extra;@@ -5352,31 +5791,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,- x,- section_y,- &crate::i18n::tr("settings-agents-heading"),- palette.muted_text,- max_width,- )?;- self.paint_group_card(layers, x, card_y, max_width, card_height)?;- self.paint_toggle_setting_row(- layers,- row_x,- first_row_y,- row_width,- &crate::i18n::tr("settings-agent-panel"),- &crate::i18n::tr("settings-agent-panel-description"),- self.native_settings.chrome.agent_panel_enabled,- SettingsAction::ToggleAgentPanel,- // Sole row in its card: a top rule would just underline the- // group heading for no reason.- false,- )?;-- self.draw_text(- layers,- &ui_font,+ &body_font,x,integrations_title_y,&crate::i18n::tr("settings-agents-integrations-heading"),@@ -5473,7 +5888,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,text_x,self.settings_row_description_y(row_y),&description,@@ -5505,7 +5920,7 @@ impl SettingsWindow {for line in lines {self.draw_text(layers,- &ui_font,+ &body_font,row_x + detail_text_inset,detail_y,line,@@ -5530,7 +5945,7 @@ impl SettingsWindow {max_width: f32,) -> anyhow::Result<()> {let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let config = configuration();let scroll = self.ui.content_scroll.offset;let row_step = self.settings_row_step();@@ -5568,7 +5983,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,section_y,&crate::i18n::tr("settings-terminal-heading"),@@ -5709,7 +6124,7 @@ impl SettingsWindow {max_width: f32,) -> anyhow::Result<()> {let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let scroll = self.ui.content_scroll.offset;let row_step = self.settings_row_step();let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;@@ -5723,7 +6138,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,section_y,&crate::i18n::tr("settings-developer-description"),@@ -5734,25 +6149,21 @@ impl SettingsWindow {let card_padding = 36.0;let row_x = x + card_padding;let row_width = max_width - card_padding * 2.0;- let developer_mode_value = if self.developer_mode_enabled() {- crate::i18n::tr("common-on")- } else {- crate::i18n::tr("common-off")- };let developer_tabs_value = if self.developer_mode_enabled() {crate::i18n::tr("settings-developer-tabs-value")} else {crate::i18n::tr("common-hidden")};self.paint_group_card(layers, x, card_y, max_width, card_height)?;- self.paint_setting_row(+ self.paint_toggle_setting_row(layers,row_x,first_row_y,row_width,&crate::i18n::tr("settings-developer-mode"),&crate::i18n::tr("settings-developer-mode-description"),- &developer_mode_value,+ self.developer_mode_enabled(),+ SettingsAction::ToggleDeveloperMode,false,)?;self.paint_toggle_setting_row(@@ -5786,25 +6197,11 @@ impl SettingsWindow {&crate::i18n::tr("settings-onboarding-launcher-value"),true,)?;- let developer_label = if self.developer_mode_enabled() {- crate::i18n::tr("settings-disable-developer")- } else {- crate::i18n::tr("settings-enable-developer")- };- let developer_width = self.button_width_for_label(&developer_label, 300.0);let show_onboarding_label = crate::i18n::tr("settings-show-onboarding");self.draw_button(layers,x,button_y,- developer_width,- &developer_label,- SettingsAction::ToggleDeveloperMode,- )?;- self.draw_button(- layers,- x + developer_width + self.ui_px(14.0),- button_y,self.button_width_for_label(&show_onboarding_label, 300.0),&show_onboarding_label,SettingsAction::ShowOnboardingNow,@@ -5821,6 +6218,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let two_column = max_width >= 940.0;let content_extent = if two_column { 1020.0 } else { 1660.0 };self.ui@@ -5830,7 +6228,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,self.ui_px(CONTENT_SECTION_Y) - scroll,"Live settings UI components. The left side is rendered with the same primitives as the real window.",@@ -6063,6 +6461,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let scroll = self.ui.content_scroll.offset;let row_step = self.settings_row_step();let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;@@ -6073,7 +6472,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,section_y,"Memory and input diagnostics are manual. Developer mode only reveals this page; sampling starts when you enable it here.",@@ -6129,13 +6528,7 @@ impl SettingsWindow {} else {"Refresh for vmmap"};- let monitor_state = if self.ui.memory_monitoring {- "Running"- } else {- "Off"- };let input = crate::input_diagnostics::snapshot();- let input_state = if input.enabled { "Running" } else { "Off" };let input_events = format!("{} events", input.key_events);let input_p95 = crate::input_diagnostics::format_duration(input.recent_p95);let input_avg = crate::input_diagnostics::format_duration(input.average_duration());@@ -6165,14 +6558,15 @@ impl SettingsWindow {let row_x = x + card_padding;let row_width = max_width - card_padding * 2.0;self.paint_group_card(layers, x, card_y, max_width, card_height)?;- self.paint_setting_row(+ self.paint_toggle_setting_row(layers,row_x,first_row_y,row_width,"Manual Sampling","Keeps refreshing this page until you turn it off.",- monitor_state,+ self.ui.memory_monitoring,+ SettingsAction::ToggleMemoryMonitoring,false,)?;self.paint_setting_row(@@ -6275,14 +6669,15 @@ impl SettingsWindow {&text,true,)?;- self.paint_setting_row(+ self.paint_toggle_setting_row(layers,row_x,first_row_y + row_step * 11.0,row_width,"Input Diagnostics","Manual tracing for long-running typing latency. No key text is stored.",- input_state,+ input.enabled,+ SettingsAction::ToggleInputDiagnostics,true,)?;self.paint_setting_row(@@ -6318,7 +6713,7 @@ impl SettingsWindow {if let Some(error) = &snapshot.vmmap_error {self.draw_text(layers,- &ui_font,+ &body_font,row_x,first_row_y + row_step * 15.0,error,@@ -6326,20 +6721,7 @@ impl SettingsWindow {row_width,)?;}- let primary_label = if self.ui.memory_monitoring {- "Stop Memory Sampling"- } else {- "Start Memory Sampling"- };- self.draw_button(- layers,- x,- button_y,- self.button_width_for_label(primary_label, 300.0),- primary_label,- SettingsAction::ToggleMemoryMonitoring,- )?;- let refresh_x = x + self.button_width_for_label(primary_label, 300.0) + self.ui_px(16.0);+ let refresh_x = x;self.draw_button(layers,refresh_x,@@ -6363,21 +6745,7 @@ impl SettingsWindow {copy_label,SettingsAction::CopyMemorySnapshot,)?;- let input_primary_label = if input.enabled {- "Stop Input Trace"- } else {- "Start Input Trace"- };- self.draw_button(- layers,- x,- input_button_y,- self.button_width_for_label(input_primary_label, 250.0),- input_primary_label,- SettingsAction::ToggleInputDiagnostics,- )?;- let reset_input_x =- x + self.button_width_for_label(input_primary_label, 250.0) + self.ui_px(16.0);+ let reset_input_x = x;self.draw_button(layers,reset_input_x,@@ -6415,7 +6783,7 @@ impl SettingsWindow {for (idx, line) in resource_lines.iter().enumerate() {self.draw_text(layers,- &ui_font,+ &body_font,row_x,resource_card_y + self.ui_px(66.0) + resource_line_height * idx as f32,line,@@ -6436,6 +6804,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);self.draw_text(layers, &ui_font, x, y, "Search Field", palette.title, width)?;self.draw_rounded_frame(layers,@@ -6450,7 +6819,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,x + self.ui_px(18.0),self.control_text_y(y + 28.0, self.ui_px(CONTROL_HEIGHT)),"Search settings...",@@ -6470,7 +6839,7 @@ impl SettingsWindow {selected: bool,) -> anyhow::Result<()> {let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let row_width = width.min(self.ui_px(420.0));if selected {self.draw_rounded_rect(@@ -6479,7 +6848,7 @@ impl SettingsWindow {x,y,row_width,- self.ui_px(NAV_ROW_HEIGHT),+ self.nav_row_height(),palette.nav_selected_bg,self.ui_px(NAV_ROW_RADIUS),)?;@@ -6490,16 +6859,16 @@ impl SettingsWindow {x,y,row_width,- self.ui_px(NAV_ROW_HEIGHT),+ self.nav_row_height(),palette.nav_hover_bg,self.ui_px(NAV_ROW_RADIUS),)?;}self.draw_text(layers,- &ui_font,+ &body_font,x + self.ui_px(16.0),- self.control_text_y(y, self.ui_px(NAV_ROW_HEIGHT)),+ self.control_text_y(y, self.nav_row_height()),label,if selected {palette.selected_text@@ -6680,7 +7049,7 @@ impl SettingsWindow {max_width: f32,) -> anyhow::Result<()> {let palette = self.palette();- let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let scroll = self.ui.content_scroll.offset;let row_step = self.settings_row_step();let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;@@ -6742,7 +7111,7 @@ impl SettingsWindow {self.draw_text(layers,- &ui_font,+ &body_font,x,section_y,&crate::i18n::tr("settings-compatibility-description"),@@ -6844,20 +7213,662 @@ impl SettingsWindow {&open_wezterm_label,SettingsAction::OpenWezTermConfigFile,)?;- let fifth_x =- x + self.button_width_for_label(&open_wezterm_label, 300.0) + self.ui_px(16.0);- self.draw_button(+ let fifth_x =+ x + self.button_width_for_label(&open_wezterm_label, 300.0) + self.ui_px(16.0);+ self.draw_button(+ layers,+ fifth_x,+ open_buttons_y,+ self.button_width_for_label(&open_thinkterm_label, 300.0),+ &open_thinkterm_label,+ SettingsAction::OpenThinkTermConfigFile,+ )?;++ Ok(())+ }++ /// A filled, rounded tile with a white glyph centered in it -- the badge+ /// that carries the Update page's status and the About page's app mark.+ fn paint_status_badge(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ icon: SvgIcon,+ x: f32,+ y: f32,+ size: f32,+ tint: LinearRgba,+ ) -> anyhow::Result<()> {+ // A disc rather than a rounded square: the badge states a status, and+ // the app's own mark on About is the rounded square. The shadow is the+ // same one a selected sidebar row gets, so the two lift by the same+ // amount.+ let radius = size / 2.0;+ self.paint_active_row_shadow(layers, x, y, size, size, radius)?;+ self.draw_rounded_frame(layers, 0, x, y, size, size, tint, tint, radius)?;+ let glyph = (size * 0.5).round();+ self.draw_svg_icon(+ layers,+ icon,+ x + (size - glyph) / 2.0,+ y + (size - glyph) / 2.0,+ glyph,+ LinearRgba::with_components(1.0, 1.0, 1.0, 1.0),+ )+ }++ /// Row geometry for the two app-level pages. Unlike `settings_row_step`+ /// these rows carry no explanation line, so they are a single line tall+ /// -- the shape macOS System Settings uses for a list of plain facts.+ fn compact_row_step(&self) -> f32 {+ let cell_height = self.metrics.cell_size.height as f32;+ (cell_height + self.ui_px(48.0))+ .max(self.ui_px(84.0))+ .ceil()+ }++ fn compact_card_height(&self, rows: usize) -> f32 {+ if rows == 0 {+ return 0.0;+ }+ self.compact_row_step() * rows as f32 + self.ui_px(24.0)+ }++ /// `label ............ value`, both on one line, the value flush right in+ /// the secondary weight. `y` is the top of the row band, not the text.+ fn paint_compact_row(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ x: f32,+ y: f32,+ width: f32,+ label: &str,+ value: &str,+ draw_top_rule: bool,+ ) -> anyhow::Result<()> {+ let palette = self.palette();+ let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);+ let step = self.compact_row_step();+ if draw_top_rule {+ self.paint_separator(layers, x, y, width)?;+ }+ let text_y = self.control_text_y(y, step);++ // The value takes what it needs from the right; the label gets the+ // rest, so a long value shortens the label rather than overlapping.+ let value_width = self+ .measure_text_width(&body_font, value)+ .min(width * 0.62)+ .ceil();+ self.draw_text(+ layers,+ &ui_font,+ x,+ text_y,+ label,+ palette.text,+ (width - value_width - self.ui_px(20.0)).max(0.0),+ )?;+ self.draw_text(+ layers,+ &body_font,+ x + width - value_width,+ text_y,+ value,+ palette.secondary_text,+ value_width,+ )+ }++ /// The application icon at `size`, from the packaged PNG rather than the+ /// SVG set: it is the app's real mark, and About is where that matters.+ fn draw_app_icon(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ x: f32,+ y: f32,+ size: f32,+ ) -> anyhow::Result<()> {+ if size <= 0.0 {+ return Ok(());+ }+ let render_state = self.render_state.as_ref().unwrap();+ let sprite = render_state+ .glyph_cache+ .borrow_mut()+ .cached_app_icon(size.round() as usize)?+ .texture_coords();+ let mut quad = layers.allocate(2)?;+ let left_offset = self.dimensions.pixel_width as f32 / 2.0;+ let top_offset = self.dimensions.pixel_height as f32 / 2.0;+ quad.set_position(+ x - left_offset,+ y - top_offset,+ x + size - left_offset,+ y + size - top_offset,+ );+ quad.set_texture(sprite);+ let white = LinearRgba::with_components(1.0, 1.0, 1.0, 1.0);+ quad.set_fg_color(white);+ quad.set_alt_color_and_mix_value(white, 0.0);+ quad.set_hsv(None);+ quad.set_has_color(true);+ Ok(())+ }++ /// A wrapping row of pill buttons, the way LaunchNext and macOS put a+ /// page's outbound links along the bottom instead of one per row.+ /// Returns the height it consumed.+ fn paint_button_row(+ &mut self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ x: f32,+ y: f32,+ max_width: f32,+ buttons: &[(String, SettingsAction)],+ ) -> anyhow::Result<f32> {+ let gap = self.ui_px(14.0);+ let height = self.ui_px(CONTROL_HEIGHT);+ let mut cursor_x = x;+ let mut cursor_y = y;+ for (label, action) in buttons {+ let width = self.button_width_for_label(label, 0.0);+ if cursor_x > x && cursor_x + width > x + max_width {+ cursor_x = x;+ cursor_y += height + gap;+ }+ self.draw_button(layers, cursor_x, cursor_y, width, label, *action)?;+ cursor_x += width + gap;+ }+ Ok(cursor_y + height - y)+ }++ /// What the Update hero is currently able to say. Derived entirely from+ /// the cache the background checker writes; a live check will produce+ /// these same states once one is wired up.+ fn update_hero(&self) -> UpdateHero {+ let Some(status) = self.ui.update_status.as_ref() else {+ return UpdateHero::Unknown;+ };+ if !status.running_a_release_build() {+ return UpdateHero::LocalBuild;+ }+ match (&status.latest, status.update_available) {+ (Some(latest), true) => UpdateHero::Available {+ tag: latest.tag_name.clone(),+ },+ (Some(_), false) => UpdateHero::UpToDate,+ (None, _) => UpdateHero::Unknown,+ }+ }++ fn running_version_label(&self) -> String {+ self.ui+ .update_status+ .as_ref()+ .map(|status| status.current_version.clone())+ .unwrap_or_else(|| config::wezterm_version().to_string())+ }++ /// The hero every app-level page opens with: a badge, a headline, a+ /// second line, and one button on the right. Returns the card's height.+ fn paint_hero(+ &mut self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ x: f32,+ y: f32,+ max_width: f32,+ badge: HeroBadge,+ headline: &str,+ subline: &str,+ button: Option<(String, SettingsAction)>,+ ) -> anyhow::Result<f32> {+ let palette = self.palette();+ let body_font = Rc::clone(&self.body_font);+ let title_font = Rc::clone(&self.title_font);+ let cell = self.metrics.cell_size.height as f32;+ let padding = self.ui_px(HERO_PADDING);+ let mark = self.ui_px(HERO_MARK_SIZE);+ let height = (cell * 2.0 + self.ui_px(74.0)).max(mark + padding * 2.0);++ self.paint_group_card(layers, x, y, max_width, height)?;++ let mut text_right = x + max_width - padding;+ if let Some((label, action)) = button {+ let width = self.button_width_for_label(&label, self.ui_px(230.0));+ let button_x = x + max_width - padding - width;+ self.draw_button(+ layers,+ button_x,+ y + (height - self.ui_px(CONTROL_HEIGHT)) / 2.0,+ width,+ &label,+ action,+ )?;+ text_right = button_x - self.ui_px(24.0);+ }++ let mark_x = x + padding;+ let mark_y = y + (height - mark) / 2.0;+ match badge {+ HeroBadge::AppIcon => self.draw_app_icon(layers, mark_x, mark_y, mark)?,+ HeroBadge::Status { icon, tint } => {+ self.paint_status_badge(layers, icon, mark_x, mark_y, mark, tint)?+ }+ }++ let text_x = mark_x + mark + self.ui_px(24.0);+ let text_width = (text_right - text_x).max(self.ui_px(120.0));+ let line_gap = self.ui_px(12.0);+ let text_y = y + (height - (cell * 2.0 + line_gap)) / 2.0;+ self.draw_text(+ layers,+ &title_font,+ text_x,+ text_y,+ headline,+ palette.title,+ text_width,+ )?;+ self.draw_text(+ layers,+ &body_font,+ text_x,+ text_y + cell + line_gap,+ subline,+ palette.secondary_text,+ text_width,+ )?;+ Ok(height)+ }++ /// The four right-sidebar panels, in the order their selector shows them.+ const RIGHT_SIDEBAR_PANELS: [crate::termwindow::RightSidebarMode; 4] = [+ crate::termwindow::RightSidebarMode::Chat,+ crate::termwindow::RightSidebarMode::Tasks,+ crate::termwindow::RightSidebarMode::Snippets,+ crate::termwindow::RightSidebarMode::Agents,+ ];++ /// The stored flag for a panel. `None` means the user never chose, which+ /// every panel reads as on.+ fn right_sidebar_panel_slot(+ &mut self,+ panel: crate::termwindow::RightSidebarMode,+ ) -> &mut Option<bool> {+ use crate::termwindow::RightSidebarMode as Panel;+ let chrome = &mut self.native_settings.chrome;+ match panel {+ Panel::Chat => &mut chrome.right_sidebar_files_enabled,+ Panel::Tasks => &mut chrome.right_sidebar_notes_enabled,+ Panel::Snippets => &mut chrome.right_sidebar_snippets_enabled,+ Panel::Agents => &mut chrome.agent_panel_enabled,+ }+ }++ /// Whether the switch shows as on. Deliberately the same predicate the+ /// sidebar itself uses rather than the stored flag: Agents is also gated+ /// by the Lua `agent_status_detection` option, and a switch reading on+ /// while the panel can never appear is how someone turns off the other+ /// three believing one is left.+ fn right_sidebar_panel_enabled(&self, panel: crate::termwindow::RightSidebarMode) -> bool {+ panel.panel_enabled()+ }++ fn right_sidebar_panel_label(panel: crate::termwindow::RightSidebarMode) -> String {+ use crate::termwindow::RightSidebarMode as Panel;+ crate::i18n::tr(match panel {+ Panel::Chat => "right-mode-files",+ Panel::Tasks => "right-mode-notes",+ Panel::Snippets => "right-mode-snippets",+ Panel::Agents => "right-mode-agents",+ })+ }++ fn right_sidebar_panel_description(panel: crate::termwindow::RightSidebarMode) -> String {+ use crate::termwindow::RightSidebarMode as Panel;+ crate::i18n::tr(match panel {+ Panel::Chat => "settings-sidebar-files-description",+ Panel::Tasks => "settings-sidebar-notes-description",+ Panel::Snippets => "settings-sidebar-snippets-description",+ Panel::Agents => "settings-agent-panel-description",+ })+ }++ fn paint_sidebar_settings(+ &mut self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ x: f32,+ max_width: f32,+ ) -> anyhow::Result<()> {+ let palette = self.palette();+ let body_font = Rc::clone(&self.body_font);+ let scroll = self.ui.content_scroll.offset;+ let row_step = self.settings_row_step();+ let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;+ let card_padding = 36.0;+ let row_x = x + card_padding;+ let row_width = max_width - card_padding * 2.0;++ let panels = Self::RIGHT_SIDEBAR_PANELS;+ let (card_y, first_row_y) = self.settings_card_geometry(section_y, panels.len());+ let card_height = self.settings_card_height(panels.len());+ self.ui.content_scroll.set_extents(+ self.content_viewport_extent(),+ self.settings_content_extent(card_y + scroll + card_height),+ );++ self.draw_text(+ layers,+ &body_font,+ x,+ section_y,+ &crate::i18n::tr("settings-sidebar-description"),+ palette.secondary_text,+ max_width,+ )?;++ self.paint_group_card(layers, x, card_y, max_width, card_height)?;+ for (index, panel) in panels.iter().enumerate() {+ let panel = *panel;+ self.paint_toggle_setting_row(+ layers,+ row_x,+ first_row_y + row_step * index as f32,+ row_width,+ &Self::right_sidebar_panel_label(panel),+ &Self::right_sidebar_panel_description(panel),+ self.right_sidebar_panel_enabled(panel),+ SettingsAction::ToggleRightSidebarPanel(panel),+ index > 0,+ )?;+ }+ Ok(())+ }++ fn paint_update(+ &mut self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ x: f32,+ max_width: f32,+ ) -> anyhow::Result<()> {+ let palette = self.palette();+ let body_font = Rc::clone(&self.body_font);+ let appearance = self.effective_appearance();+ let scroll = self.ui.content_scroll.offset;+ let card_padding = self.ui_px(HERO_PADDING);+ let row_x = x + card_padding;+ let row_width = max_width - card_padding * 2.0;+ let gap = self.settings_section_card_gap();++ let hero = self.update_hero();+ let version = self.running_version_label();+ let (icon, tint, headline, subline) = match &hero {+ UpdateHero::UpToDate => (+ SvgIcon::Check,+ status_tint_positive(appearance),+ crate::i18n::tr("settings-update-current"),+ settings_tr("settings-update-current-detail", &[("version", version)]),+ ),+ UpdateHero::Available { tag } => (+ SvgIcon::Download,+ palette.accent,+ crate::i18n::tr("settings-update-available"),+ settings_tr(+ "settings-update-available-detail",+ &[("latest", tag.clone()), ("current", version)],+ ),+ ),+ UpdateHero::LocalBuild => (+ SvgIcon::Package,+ status_tint_neutral(appearance),+ crate::i18n::tr("settings-update-local-build"),+ settings_tr(+ "settings-update-local-build-detail",+ &[("version", version)],+ ),+ ),+ UpdateHero::Unknown => (+ SvgIcon::RefreshCw,+ status_tint_neutral(appearance),+ crate::i18n::tr("settings-update-unknown"),+ settings_tr("settings-update-unknown-detail", &[("version", version)]),+ ),+ };++ let checked_recently = self+ .ui+ .update_checked_until+ .is_some_and(|until| Instant::now() < until);+ let check_label = if checked_recently {+ crate::i18n::tr("settings-update-checked")+ } else {+ crate::i18n::tr("settings-update-check-now")+ };++ let hero_y = self.ui_px(CONTENT_SECTION_Y) - scroll;+ let hero_height = self.paint_hero(+ layers,+ x,+ hero_y,+ max_width,+ HeroBadge::Status { icon, tint },+ &headline,+ &subline,+ Some((check_label, SettingsAction::CheckForUpdates)),+ )?;++ // Three plain facts, one line each: the labels say what they are, and+ // an explanation under every one of them was noise.+ let config = configuration();+ let rows = [+ (+ crate::i18n::tr("settings-update-automatic"),+ if config.check_for_updates {+ crate::i18n::tr("common-on")+ } else {+ crate::i18n::tr("common-off")+ },+ ),+ (+ crate::i18n::tr("settings-update-frequency"),+ format_check_interval(config.check_for_updates_interval_seconds),+ ),+ (+ crate::i18n::tr("settings-update-last-checked"),+ self.ui+ .update_status+ .as_ref()+ .and_then(|status| status.last_checked)+ .map(format_last_checked)+ .unwrap_or_else(|| crate::i18n::tr("settings-update-never")),+ ),+ ];+ let card_y = hero_y + hero_height + gap;+ let card_height = self.compact_card_height(rows.len());+ let row_step = self.compact_row_step();+ let first_row_y = card_y + self.ui_px(12.0);+ self.paint_group_card(layers, x, card_y, max_width, card_height)?;+ for (index, (label, value)) in rows.iter().enumerate() {+ self.paint_compact_row(+ layers,+ row_x,+ first_row_y + row_step * index as f32,+ row_width,+ label,+ value,+ index > 0,+ )?;+ }++ let note_y = card_y + card_height + gap;+ self.draw_text(+ layers,+ &body_font,+ x,+ note_y,+ &crate::i18n::tr("settings-update-manual-note"),+ palette.secondary_text,+ max_width,+ )?;++ let (link_label, link_action) = match &hero {+ UpdateHero::Available { .. } => (+ crate::i18n::tr("settings-update-whats-new"),+ SettingsAction::OpenLatestRelease,+ ),+ _ => (+ crate::i18n::tr("settings-update-all-releases"),+ SettingsAction::OpenReleasesIndex,+ ),+ };+ let button_y = note_y + self.metrics.cell_size.height as f32 + self.ui_px(24.0);+ let button_height =+ self.paint_button_row(layers, x, button_y, max_width, &[(link_label, link_action)])?;++ self.ui.content_scroll.set_extents(+ self.content_viewport_extent(),+ self.settings_content_extent(button_y + scroll + button_height),+ );+ Ok(())+ }++ fn paint_about(+ &mut self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ x: f32,+ max_width: f32,+ ) -> anyhow::Result<()> {+ let scroll = self.ui.content_scroll.offset;+ let card_padding = self.ui_px(HERO_PADDING);+ let row_x = x + card_padding;+ let row_width = max_width - card_padding * 2.0;+ let gap = self.settings_section_card_gap();+ let version = self.running_version_label();++ let copied = self+ .ui+ .version_info_copied_until+ .is_some_and(|until| Instant::now() < until);+ let copy_label = if copied {+ crate::i18n::tr("settings-about-copied")+ } else {+ crate::i18n::tr("settings-about-copy")+ };++ let hero_y = self.ui_px(CONTENT_SECTION_Y) - scroll;+ let hero_height = self.paint_hero(layers,- fifth_x,- open_buttons_y,- self.button_width_for_label(&open_thinkterm_label, 300.0),- &open_thinkterm_label,- SettingsAction::OpenThinkTermConfigFile,+ x,+ hero_y,+ max_width,+ HeroBadge::AppIcon,+ "ThinkTerm",+ &settings_tr(+ "settings-about-version-line",+ &[("version", version.clone())],+ ),+ Some((copy_label, SettingsAction::CopyVersionInfo)),)?;+ // Build only earns a line when it says something Version does not: a+ // release binary stamps both from the same tag.+ let build = config::wezterm_version();+ let mut rows = vec![(crate::i18n::tr("settings-about-version"), version.clone())];+ if build != version {+ rows.push((crate::i18n::tr("settings-about-build"), build.to_string()));+ }+ rows.push((+ crate::i18n::tr("settings-about-platform"),+ config::wezterm_target_triple().to_string(),+ ));+ rows.push((+ crate::i18n::tr("settings-about-license"),+ // Must match what the packages declare -- ci/deploy.sh and+ // ci/make-winget-pr.sh both say GPL-3.0-only. "or-later" is a+ // different promise (recipients may use a future GPL), not a+ // wording variant, so the two must not drift.+ "GPL-3.0-only".to_string(),+ ));++ let card_y = hero_y + hero_height + gap;+ let card_height = self.compact_card_height(rows.len());+ let row_step = self.compact_row_step();+ let first_row_y = card_y + self.ui_px(12.0);+ self.paint_group_card(layers, x, card_y, max_width, card_height)?;+ for (index, (label, value)) in rows.iter().enumerate() {+ self.paint_compact_row(+ layers,+ row_x,+ first_row_y + row_step * index as f32,+ row_width,+ label,+ value,+ index > 0,+ )?;+ }++ // Everything outbound sits in one wrapping row along the bottom+ // rather than as a button per row, which is five cards' worth of+ // chrome for five links.+ let buttons = [+ (+ crate::i18n::tr("settings-about-source"),+ SettingsAction::OpenSourceRepository,+ ),+ (+ crate::i18n::tr("settings-about-release-notes"),+ SettingsAction::OpenReleasesIndex,+ ),+ (+ crate::i18n::tr("settings-about-config-file"),+ SettingsAction::OpenThinkTermConfigFile,+ ),+ (+ crate::i18n::tr("settings-about-data-folder"),+ SettingsAction::OpenDataFolder,+ ),+ (+ crate::i18n::tr("settings-about-notices"),+ SettingsAction::OpenThirdPartyNotices,+ ),+ (+ crate::i18n::tr("settings-about-privacy"),+ SettingsAction::OpenPrivacyPolicy,+ ),+ ];+ let button_y = card_y + card_height + gap;+ let button_height = self.paint_button_row(layers, x, button_y, max_width, &buttons)?;++ self.ui.content_scroll.set_extents(+ self.content_viewport_extent(),+ self.settings_content_extent(button_y + scroll + button_height),+ );Ok(())}+ /// The block the About page's Copy button puts on the clipboard: what a+ /// bug report needs on its first line so nobody has to ask.+ fn version_info_for_clipboard(&self) -> String {+ let mut lines = vec![+ format!("ThinkTerm {}", self.running_version_label()),+ format!("Build: {}", config::wezterm_version()),+ format!("Target: {}", config::wezterm_target_triple()),+ format!("OS: {}", std::env::consts::OS),+ format!(+ "Config: {}",+ Self::thinkterm_compatible_config_path().display()+ ),+ format!("Data: {}", config::DATA_DIR.display()),+ ];+ if let Some(status) = self.ui.update_status.as_ref() {+ if let Some(latest) = status.latest.as_ref() {+ lines.push(format!("Latest release seen: {}", latest.tag_name));+ }+ }+ lines.join("\n")+ }+fn paint_placeholder(&mut self,layers: &mut TripleLayerQuadAllocator<'_>,@@ -6905,21 +7916,18 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}- let control_width = if width >= 680.0 {- 280.0_f32.min(width * 0.36)- } else {- 220.0_f32.min(width * 0.44)- };+ let control_width = Self::settings_control_width(width);let control_x = x + width - control_width;let control_y = y + self.ui_px(4.0);let text_width = (control_x - x - 24.0).max(width * 0.45);self.draw_text(layers, &ui_font, x, y, label, palette.text, text_width)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),description,@@ -6949,6 +7957,54 @@ impl SettingsWindow {Ok(())}+ /// An iOS-style switch: a pill track with a circular knob. Replaces the+ /// On/Off word pill, which read as a value to be inspected rather than a+ /// control to be flipped.+ fn paint_switch(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ x: f32,+ y: f32,+ enabled: bool,+ hovered: bool,+ pressed: bool,+ ) -> anyhow::Result<()> {+ let palette = self.palette();+ let width = self.ui_px(SWITCH_WIDTH);+ let height = self.ui_px(SWITCH_HEIGHT);+ let inset = self.ui_px(SWITCH_KNOB_INSET);+ let knob = height - inset * 2.0;++ // Shared with the in-window switch, which this cannot call: that one+ // draws through a DrawContext and this window has its own primitives.+ let track = crate::ui::widgets::toggle_track_color(+ UiPalette::for_appearance(self.effective_appearance()),+ enabled,+ hovered,+ pressed,+ );+ // Passing the fill as the border makes draw_rounded_frame skip the+ // ring: a stroke the same colour only hardens the pill's edge.+ let border = track;+ self.draw_rounded_frame(layers, 0, x, y, width, height, track, border, height / 2.0)?;++ let knob_x = if enabled {+ x + width - inset - knob+ } else {+ x + inset+ };+ self.draw_rounded_rect(+ layers,+ 0,+ knob_x,+ y + inset,+ knob,+ knob,+ palette.on_accent,+ knob / 2.0,+ )+ }+fn paint_toggle_setting_row(&mut self,layers: &mut TripleLayerQuadAllocator<'_>,@@ -6963,14 +8019,11 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}- let control_width = if width >= 680.0 {- 280.0_f32.min(width * 0.36)- } else {- 220.0_f32.min(width * 0.44)- };+ let control_width = Self::settings_control_width(width);let control_x = x + width - control_width;let control_y = y + self.ui_px(4.0);let text_width = (control_x - x - 24.0).max(width * 0.45);@@ -6985,48 +8038,25 @@ impl SettingsWindow {let hovered = self.ui.interaction.hovered == Some(action);let pressed = self.ui.interaction.pressed == Some(action);- let bg = if pressed {- palette.control_pressed_bg- } else if hovered {- palette.control_hover_bg- } else {- palette.control_bg- };- let border = if hovered || pressed {- palette.separator- } else {- palette.control_border- };-self.draw_text(layers, &ui_font, x, y, label, palette.text, text_width)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),description,palette.secondary_text,text_width,)?;- self.draw_rounded_frame(- layers,- 0,- control_x,- control_y,- control_width,- self.ui_px(CONTROL_HEIGHT),- bg,- border,- self.ui_px(CONTROL_RADIUS),- )?;- self.draw_text(+ // The switch sits at the right edge of the control column; the+ // whole column stays the hit target so the row is still easy to hit.+ self.paint_switch(layers,- &ui_font,- control_x + self.ui_px(14.0),- self.control_text_y(control_y, self.ui_px(CONTROL_HEIGHT)),- if enabled { "On" } else { "Off" },- palette.text,- control_width - self.ui_px(26.0),+ control_x + control_width - self.ui_px(SWITCH_WIDTH),+ control_y + (self.ui_px(CONTROL_HEIGHT) - self.ui_px(SWITCH_HEIGHT)) / 2.0,+ enabled,+ hovered,+ pressed,)?;Ok(())}@@ -7045,14 +8075,11 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}- let control_width = if width >= 680.0 {- 280.0_f32.min(width * 0.36)- } else {- 220.0_f32.min(width * 0.44)- };+ let control_width = Self::settings_control_width(width);let control_x = x + width - control_width;let control_y = y + self.ui_px(4.0);let text_width = (control_x - x - 24.0).max(width * 0.45);@@ -7083,7 +8110,7 @@ impl SettingsWindow {self.draw_text(layers, &ui_font, x, y, label, palette.text, text_width)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),description,@@ -7124,6 +8151,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);let action = SettingsAction::ToggleImportField(field.id);let enabled = field.lua_value.is_some();let selected = enabled && self.import_field_selected(field.id);@@ -7213,7 +8241,7 @@ impl SettingsWindow {let title = format!("{} / {}", field.category, field.label);self.draw_text(layers,- &ui_font,+ &body_font,label_x,y,&title,@@ -7226,7 +8254,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,label_x,self.settings_row_description_y(y),&field.description,@@ -7282,6 +8310,42 @@ impl SettingsWindow {)}+ /// The soft drop shadow the main window puts under a selected sidebar+ /// row. Same two-pass ramp and the same alphas, so the two sidebars read+ /// as one surface treatment -- see+ /// `termwindow::ui::paint_active_surface_shadow` for why light and dark+ /// need different numbers rather than one shared ramp.+ fn paint_active_row_shadow(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ x: f32,+ y: f32,+ width: f32,+ height: f32,+ radius: f32,+ ) -> anyhow::Result<()> {+ let (outer, inner) = match self.effective_appearance() {+ Appearance::Light | Appearance::LightHighContrast => (0.04, 0.05),+ Appearance::Dark | Appearance::DarkHighContrast => (0.12, 0.18),+ };+ for (spread, offset_y, alpha) in [+ (self.ui_px(2.0), self.ui_px(1.0), outer),+ (self.ui_px(1.0), self.ui_px(1.0), inner),+ ] {+ self.draw_rounded_rect(+ layers,+ 0,+ x - spread,+ y - spread + offset_y,+ width + spread * 2.0,+ height + spread * 2.0,+ LinearRgba::with_components(0.0, 0.0, 0.0, alpha),+ radius + spread,+ )?;+ }+ Ok(())+ }+fn paint_separator(&self,layers: &mut TripleLayerQuadAllocator<'_>,@@ -7310,15 +8374,12 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}- let control_width = if width >= 680.0 {- 280.0_f32.min(width * 0.36)- } else {- 220.0_f32.min(width * 0.44)- };+ let control_width = Self::settings_control_width(width);let control_x = x + width - control_width;let control_y = y + self.ui_px(4.0);let dynamic_icon_size =@@ -7331,7 +8392,7 @@ impl SettingsWindow {self.draw_text(layers, &ui_font, x, y, label, palette.text, text_width)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),description,@@ -7443,15 +8504,12 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}- let control_width = if width >= 680.0 {- 280.0_f32.min(width * 0.36)- } else {- 220.0_f32.min(width * 0.44)- };+ let control_width = Self::settings_control_width(width);let control_x = x + width - control_width;let control_y = y + self.ui_px(4.0);let text_width = (control_x - x - 24.0).max(width * 0.45);@@ -7484,7 +8542,7 @@ impl SettingsWindow {self.draw_text(layers, &ui_font, x, y, label, palette.text, text_width)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),description,@@ -7582,6 +8640,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}@@ -7624,7 +8683,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),&crate::i18n::tr("settings-command-palette-hotkey-description"),@@ -7702,6 +8761,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}@@ -7744,7 +8804,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),description,@@ -7793,6 +8853,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}@@ -7835,7 +8896,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),&crate::i18n::tr("settings-language-description"),@@ -7885,6 +8946,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}@@ -7927,7 +8989,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),description,@@ -7936,7 +8998,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y)+ self.metrics.cell_size.height as f32@@ -8025,6 +9087,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}@@ -8076,7 +9139,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),&description,@@ -8149,6 +9212,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}@@ -8191,7 +9255,7 @@ impl SettingsWindow {)?;self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),&crate::i18n::tr("settings-main-renderer-description"),@@ -8240,6 +9304,7 @@ impl SettingsWindow {) -> anyhow::Result<()> {let palette = self.palette();let ui_font = Rc::clone(&self.ui_font);+ let body_font = Rc::clone(&self.body_font);if draw_top_rule {self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;}@@ -8268,7 +9333,7 @@ impl SettingsWindow {status_args.set("status", value);self.draw_text(layers,- &ui_font,+ &body_font,x,self.settings_row_description_y(y),&crate::i18n::tr_args("settings-restart-status", &status_args),@@ -8292,11 +9357,7 @@ impl SettingsWindow {}fn dropdown_control_geometry(&self, x: f32, y: f32, width: f32) -> (f32, f32, f32) {- let control_width = if width >= 680.0 {- 280.0_f32.min(width * 0.36)- } else {- 220.0_f32.min(width * 0.44)- };+ let control_width = Self::settings_control_width(width);(x + width - control_width,y + self.ui_px(4.0),@@ -8655,45 +9716,49 @@ impl SettingsWindow {.collect()}+ /// `layer_num` is the layer the whole field paints on -- frame, selection,+ /// text and caret together. The sidebar's search field passes the top+ /// layer so it sits above the mask that hides the nav list's overhang;+ /// layers composite in order, so painting after the mask is not enough.fn paint_text_input(&mut self,layers: &mut TripleLayerQuadAllocator<'_>,+ layer_num: usize,spec: TextInputSpec<'_, SettingsAction>,) -> anyhow::Result<()> {let palette = self.palette();self.ui_context.push(spec.rect, WidgetKind::TextInput, spec.action);+ // A neutral bright ring. nav_selected_bg used to sit here, but it+ // composites darker than the unfocused border, so focus read as no+ // change at all -- it was the 2px bar above the field, since removed,+ // that was actually doing the work.let border = if spec.focused {- palette.nav_selected_bg+ palette.muted_text} else if self.ui.interaction.hovered == Some(spec.action) {palette.separator} else {palette.search_border};+ // The search field is a pill; the value inputs keep the control radius,+ // so the one you type a query into is shaped unlike the ones you type+ // a setting into.+ let radius = if spec.action == SettingsAction::SearchInput {+ spec.rect.size.height / 2.0+ } else {+ self.ui.tokens.control_radius+ };self.draw_rounded_frame(layers,- 0,+ layer_num,spec.rect.origin.x,spec.rect.origin.y,spec.rect.size.width,spec.rect.size.height,palette.search_bg,border,- self.ui.tokens.control_radius,+ radius,)?;- if spec.focused {- self.draw_rounded_rect(- layers,- 0,- spec.rect.origin.x,- spec.rect.origin.y,- spec.rect.size.width,- 2.0,- palette.nav_selected_bg,- 1.0,- )?;- }-let text = if spec.text.is_empty() && !spec.focused {spec.placeholder} else {@@ -8724,7 +9789,7 @@ impl SettingsWindow {.min(text_area);self.draw_rounded_rect(layers,- 1,+ layer_num,text_left + start_x - self.ui_px(4.0),spec.rect.origin.y + self.ui_px(6.0),(end_x - start_x) + self.ui_px(8.0),@@ -8734,8 +9799,9 @@ impl SettingsWindow {)?;}}- self.draw_text(+ self.draw_text_on_layer(layers,+ layer_num,&font,text_left,self.control_text_y(spec.rect.origin.y, spec.rect.size.height),@@ -8751,7 +9817,7 @@ impl SettingsWindow {let caret_width = self.ui_px(3.0).max(1.0);self.draw_rect(layers,- 1,+ layer_num,text_left + caret_dx.min(text_area) - caret_width / 3.0,spec.rect.origin.y + self.ui_px(8.0),caret_width,@@ -8811,6 +9877,9 @@ impl SettingsWindow {ControlState::Normal},kind: WidgetKind::Button,+ // This window paints its own frame below and only reads the+ // state's colours, so the variant is inert here.+ variant: ButtonVariant::Secondary,};self.ui_context.push(button.rect, button.kind, button.action);@@ -8818,6 +9887,9 @@ impl SettingsWindow {let palette = self.palette();let ui_palette = UiPalette::for_appearance(self.effective_appearance());let (background, border) = button.state.colors(ui_palette);+ // Fully rounded rather than CONTROL_RADIUS: a pill reads as a+ // button, which is what distinguishes it from the value pills and+ // text fields that share this height and use the smaller radius.self.draw_rounded_frame(layers,0,@@ -8827,7 +9899,7 @@ impl SettingsWindow {self.ui_px(CONTROL_HEIGHT),background,border,- self.ui_px(CONTROL_RADIUS),+ self.ui_px(CONTROL_HEIGHT) / 2.0,)?;// Center the label in the frame. A fixed left inset left every// button's text biased toward the left edge -- button_width_for_label@@ -8911,18 +9983,9 @@ impl SettingsWindow {border: LinearRgba,radius: f32,) -> anyhow::Result<()> {- self.draw_rounded_rect(layers, layer_num, x, y, width, height, border, radius)?;- self.draw_rounded_rect(- layers,- layer_num,- x + 1.0,- y + 1.0,- width - 2.0,- height - 2.0,- fill,- (radius - 1.0).max(0.0),- )?;- Ok(())+ crate::ui::draw::draw_rounded_frame(+ self, layers, layer_num, x, y, width, height, fill, border, radius,+ )}fn draw_rounded_rect(@@ -9172,6 +10235,25 @@ impl SettingsWindow {text: &str,color: LinearRgba,max_width: f32,+ ) -> anyhow::Result<()> {+ self.draw_text_on_layer(layers, 1, font, x, y, text, color, max_width)+ }++ /// Text on a caller-chosen layer. Everything uses the glyph layer except+ /// the sidebar's search field, which has to paint above the mask that+ /// hides the nav list's overhang -- and layers composite in order, so+ /// "after" is not enough there.+ #[allow(clippy::too_many_arguments)]+ fn draw_text_on_layer(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ layer_num: usize,+ font: &Rc<LoadedFont>,+ x: f32,+ y: f32,+ text: &str,+ color: LinearRgba,+ max_width: f32,) -> anyhow::Result<()> {if text.is_empty() || max_width <= 0.0 {return Ok(());@@ -9203,7 +10285,7 @@ impl SettingsWindow {break;}- let mut quad = layers.allocate(1)?;+ let mut quad = layers.allocate(layer_num)?;quad.set_position(glyph_x - left_offset,glyph_y - top_offset,@@ -9819,3 +10901,45 @@ fn wgpu_color(color: LinearRgba) -> wgpu::Color {a: color.3 as f64,}}++impl crate::ui::draw::RoundedFramePainter for SettingsWindow {+ fn frame_rounded_rect(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ layer_num: usize,+ x: f32,+ y: f32,+ width: f32,+ height: f32,+ color: LinearRgba,+ radius: f32,+ ) -> anyhow::Result<()> {+ self.draw_rounded_rect(layers, layer_num, x, y, width, height, color, radius)+ }++ fn frame_rect(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ layer_num: usize,+ x: f32,+ y: f32,+ width: f32,+ height: f32,+ color: LinearRgba,+ ) -> anyhow::Result<()> {+ self.draw_rect(layers, layer_num, x, y, width, height, color)+ }++ fn frame_corner(+ &self,+ layers: &mut TripleLayerQuadAllocator<'_>,+ layer_num: usize,+ x: f32,+ y: f32,+ polys: &'static [Poly],+ size: euclid::Size2D<f32, window::PixelUnit>,+ color: LinearRgba,+ ) -> anyhow::Result<()> {+ self.draw_corner(layers, layer_num, x, y, polys, size, color)+ }+}diff --git a/wezterm-gui/src/termwindow/render/fancy_tab_bar.rs b/wezterm-gui/src/termwindow/render/fancy_tab_bar.rsindex c9d4df4e..d91da219 100644--- a/wezterm-gui/src/termwindow/render/fancy_tab_bar.rs+++ b/wezterm-gui/src/termwindow/render/fancy_tab_bar.rs@@ -213,7 +213,7 @@ impl crate::TermWindow {}}- // Synthetic content-view tabs (e.g. SSH Hosts), placed after the mux tabs.+ // Synthetic content-view tabs (e.g. Remote Hosts), placed after the mux tabs.for content_tab in &self.content_views {if !self.content_view_shown_in_tab_bar(content_tab) {continue;@@ -356,8 +356,17 @@ impl crate::TermWindow {}} else {let right_sidebar_toggle_x = action_right.saturating_sub(button_size);- let new_button_x = right_sidebar_toggle_x- .saturating_sub(self.ui_px(WINDOW_TAB_LEADING_ACTION_GAP) + button_size);+ // With every sidebar panel off the toggle paints nothing, and+ // window_tab_trailing_action_reserved_width reserves a single+ // slot to match. The new button has to take that slot, or it+ // lands one button to the left -- inside the width the tab strip+ // was just given -- and overlaps the last tab.+ let new_button_x = if self.right_sidebar_has_panels() {+ right_sidebar_toggle_x+ .saturating_sub(self.ui_px(WINDOW_TAB_LEADING_ACTION_GAP) + button_size)+ } else {+ right_sidebar_toggle_x+ };self.paint_window_tab_new_button(layers,&mut ui_items,@@ -1181,6 +1190,10 @@ impl crate::TermWindow {foreground: LinearRgba,muted_fg: LinearRgba,) -> anyhow::Result<()> {+ // Every sidebar panel turned off: the button would open nothing.+ if !self.right_sidebar_has_panels() {+ return Ok(());+ }let button_y = row_y + (row_height.saturating_sub(button_size) / 2);let hovered = self.is_pointer_over_ui_rect(button_x, button_y, button_size, button_size);let pressed = hovereddiff --git a/wezterm-gui/src/termwindow/ui/right_sidebar.rs b/wezterm-gui/src/termwindow/ui/right_sidebar.rsindex c167eb32..c1f09ca4 100644--- a/wezterm-gui/src/termwindow/ui/right_sidebar.rs+++ b/wezterm-gui/src/termwindow/ui/right_sidebar.rs@@ -1267,6 +1267,49 @@ pub(crate) struct RightSidebarFileRowMetrics {}impl RightSidebarMode {+ /// Selector order, and the order `fall_back_to_an_enabled_panel` walks --+ /// so the first entry is where a disabled panel falls back to.+ const ALL: [Self; 4] = [Self::Chat, Self::Tasks, Self::Snippets, Self::Agents];++ /// The panels the selector offers, in order. Reading the toggles here+ /// rather than hard-coding the list is what lets Settings hide a panel --+ /// and is the seam a future plugin would extend.+ pub(crate) fn enabled_panels() -> Vec<Self> {+ let toggles = crate::native_settings::right_sidebar_panel_toggles();+ Self::ALL+ .iter()+ .copied()+ .filter(|panel| panel.enabled_with(&toggles))+ .collect()+ }++ /// Whether the sidebar offers anything at all. Hot: `right_sidebar_width`+ /// asks it, and that runs several times per frame and again on every+ /// pointer move over the tab bar -- so one settings read, no Vec, and it+ /// stops at the first panel that is on.+ pub(crate) fn any_panel_enabled() -> bool {+ let toggles = crate::native_settings::right_sidebar_panel_toggles();+ Self::ALL.iter().any(|panel| panel.enabled_with(&toggles))+ }++ pub(crate) fn panel_enabled(self) -> bool {+ self.enabled_with(&crate::native_settings::right_sidebar_panel_toggles())+ }++ fn enabled_with(self, toggles: &crate::native_settings::RightSidebarPanelToggles) -> bool {+ match self {+ Self::Chat => toggles.files,+ Self::Tasks => toggles.notes,+ Self::Snippets => toggles.snippets,+ // Not the panel toggle alone: this one also gates the detector,+ // and that master switch is a Lua config value rather than a+ // native setting, so this arm takes a second read. `ALL` puts it+ // last, where the short-circuit in `any_panel_enabled` reaches it+ // only when the other three are off.+ Self::Agents => crate::agent_status::enabled(),+ }+ }+fn icon(self) -> SvgIcon {match self {Self::Chat => SvgIcon::FolderTree,@@ -1426,8 +1469,16 @@ impl crate::TermWindow {Some(configured_width.clamp(self.ui_px(NOTE_PANE_MIN_WIDTH), max_pane_width))}+ /// Whether the sidebar has anything to show. Turning off every panel in+ /// Settings hides it outright rather than leaving an empty selector: the+ /// terminal reclaims the space through the same zero-width path collapse+ /// already uses, so nothing downstream needs its own special case.+ pub(crate) fn right_sidebar_has_panels(&self) -> bool {+ RightSidebarMode::any_panel_enabled()+ }+pub fn right_sidebar_width(&self) -> usize {- if self.right_sidebar_collapsed {+ if self.right_sidebar_collapsed || !self.right_sidebar_has_panels() {0} else {// The file preview pane and the Note pane are mutually exclusive@@ -1848,6 +1899,56 @@ impl crate::TermWindow {}}+ /// Bring this window in line with a change to which panels exist.+ ///+ /// Repainting is not enough. Turning a panel off can take the sidebar's+ /// width to zero, and the terminal has to be laid out again for that or+ /// the panes stay sized around a sidebar that is no longer there. Leaving+ /// a panel also has to release what that panel was holding, the same way+ /// switching away from it by hand does -- otherwise the note focus and the+ /// file index survive a panel the user just turned off.+ pub(crate) fn right_sidebar_panels_changed(&mut self) {+ if !self.right_sidebar_mode.panel_enabled() {+ if self.right_sidebar_mode == RightSidebarMode::Tasks {+ self.clear_right_sidebar_text_focus();+ self.schedule_right_sidebar_note_memory_release();+ }+ self.fall_back_to_an_enabled_panel();+ if self.right_sidebar_file_view_active() {+ self.kick_right_sidebar_file_rescan_cycle();+ self.request_right_sidebar_remote_files_connect(false);+ } else {+ self.schedule_right_sidebar_file_memory_release();+ self.release_right_sidebar_remote_files_if_hidden();+ }+ }+ // Unconditional: the toggle that got us here has already been saved,+ // so the old width is gone and there is nothing left to compare+ // against. A settings change is rare enough to just re-lay-out.+ if let Some(window) = self.window.as_ref().cloned() {+ let dimensions = self.dimensions;+ self.apply_dimensions(&dimensions, None, &window);+ window.invalidate();+ }+ }++ /// Move off a panel that is no longer offered, onto the first one that+ /// is. All four can be off at once -- that is how you get rid of the+ /// right sidebar -- and then there is nothing to move to, so we stay put.+ pub(crate) fn fall_back_to_an_enabled_panel(&mut self) {+ if let Some(first) = RightSidebarMode::enabled_panels().first().copied() {+ self.right_sidebar_mode = first;+ }+ // No panels at all: the sidebar is hidden, so the stale mode is+ // unreachable and harmless. It becomes correct again the moment a+ // panel is turned back on.+ // This frame's selector already painted for the old mode, so ask for+ // another or the body stays blank.+ if let Some(win) = self.window.as_ref() {+ win.invalidate();+ }+ }+pub(crate) fn open_new_snippet_editor(&mut self) {if self.right_sidebar_mode == RightSidebarMode::Tasks {self.clear_right_sidebar_text_focus();@@ -6359,14 +6460,7 @@ impl crate::TermWindow {).context("right sidebar mode selector")?;- let mut modes = vec![- RightSidebarMode::Chat,- RightSidebarMode::Tasks,- RightSidebarMode::Snippets,- ];- if crate::agent_status::enabled() {- modes.push(RightSidebarMode::Agents);- }+ let modes = RightSidebarMode::enabled_panels();const MODE_LABEL_CLIP_SLOP: usize = 4;let mode_icon_size = (ui_cell_height + self.ui_px(12)).clamp(self.ui_px(24), self.ui_px(30))@@ -6515,6 +6609,12 @@ impl crate::TermWindow {}let content_top = mode_y + mode_height + self.ui_px(RIGHT_SIDEBAR_SECTION_GAP);+ // A panel turned off while it was open would paint a stranded mode:+ // the selector no longer offers it, so nothing could switch away.+ if !self.right_sidebar_mode.panel_enabled() {+ self.fall_back_to_an_enabled_panel();+ return Ok(());+ }match self.right_sidebar_mode {RightSidebarMode::Chat => {let file_font_size = self.right_sidebar_file_preview_font_size();@@ -6576,15 +6676,8 @@ impl crate::TermWindow {return Ok(());}RightSidebarMode::Agents => {- if !crate::agent_status::enabled() {- // The toggle went off while the panel was open; fall- // back rather than painting a stranded mode. This- // frame's selector already painted for the old mode,- // so request another paint or the body stays blank.- self.right_sidebar_mode = RightSidebarMode::Chat;- if let Some(win) = self.window.as_ref() {- win.invalidate();- }+ if !RightSidebarMode::Agents.panel_enabled() {+ self.fall_back_to_an_enabled_panel();return Ok(());}self.paint_agents_sidebar(diff --git a/wezterm-gui/src/update.rs b/wezterm-gui/src/update.rsindex b08814dd..376c99b7 100644--- a/wezterm-gui/src/update.rs+++ b/wezterm-gui/src/update.rs@@ -8,7 +8,7 @@ use serde::*;use std::convert::TryFrom;use std::sync::atomic::{AtomicBool, Ordering};use std::sync::Mutex;-use std::time::Duration;+use std::time::{Duration, SystemTime};use termwiz::cell::{Hyperlink, Underline};use termwiz::color::AnsiColor;use termwiz::escape::csi::{Cursor, Sgr};@@ -33,6 +33,19 @@ pub struct Asset {pub browser_download_url: String,}+/// The repository every update link points at. The update check, the toast,+/// and the Settings Update/About pages all build their URLs from this, so a+/// fork or a rename is one edit rather than a grep.+pub const REPO_URL: &str = "https://github.com/RoversX/thinkterm";++pub fn releases_url() -> String {+ format!("{REPO_URL}/releases")+}++pub fn release_tag_url(tag: &str) -> String {+ format!("{REPO_URL}/releases/tag/{tag}")+}+fn get_github_release_info(uri: &str) -> anyhow::Result<Release> {let uri = Uri::try_from(uri)?;@@ -89,10 +102,7 @@ pub fn load_last_release_info_and_set_banner() {fn set_banner_from_release_info(latest: &Release) {let mux = crate::Mux::get();- let url = format!(- "https://github.com/RoversX/thinkterm/releases/tag/{}",- latest.tag_name- );+ let url = release_tag_url(&latest.tag_name);let icon = ITermFileData {name: None,@@ -155,7 +165,7 @@ fn schedule_set_banner_from_release_info(latest: &Release) {/// bundle's Info.plist does carry the release version, is read at runtime/// rather than compile time, and is already what Finder and the About panel/// show, so prefer it when we are running from inside an app bundle.-fn running_release_version() -> String {+pub fn running_release_version() -> String {#[cfg(target_os = "macos")]{if let Some(version) = macos_bundle_version() {@@ -212,6 +222,57 @@ fn is_newer_release(latest: &str, current: &str) -> bool {}}+/// Everything the Settings > Update page can say without touching the network.+///+/// `update_checker` already persists the last release it saw to+/// `DATA_DIR/check_update`, and the filesystem stamps that write with the time+/// of the check. Reading it back is pure local state, which is what lets the+/// page render on the UI thread: it can name the running build, the newest+/// release this install has ever heard of, and when it last looked, without+/// opening a socket. A live check is a separate concern and does not belong on+/// the paint path.+#[derive(Debug, Clone)]+pub struct CachedUpdateStatus {+ /// The running build, in the same form `is_newer_release` compares.+ pub current_version: String,+ /// The newest release recorded by the last successful check, if any.+ pub latest: Option<Release>,+ /// Whether `latest` is something this build should upgrade to. False+ /// whenever the two versions use different schemes -- see+ /// `is_newer_release` for why a local build is never nagged.+ pub update_available: bool,+ /// When the last check completed. None until one has ever run.+ pub last_checked: Option<SystemTime>,+}++impl CachedUpdateStatus {+ /// Whether the running build carries a release tag rather than a commit+ /// stamp. A commit-stamped build has no ordering against any release, so+ /// the UI must say so instead of claiming to be up to date.+ pub fn running_a_release_build(&self) -> bool {+ semver::Version::parse(self.current_version.trim_start_matches('v')).is_ok()+ }+}++pub fn cached_update_status() -> CachedUpdateStatus {+ let current_version = running_release_version();+ let path = config::DATA_DIR.join("check_update");+ let last_checked = path.metadata().and_then(|meta| meta.modified()).ok();+ let latest = std::fs::read(&path)+ .ok()+ .and_then(|data| serde_json::from_slice::<Release>(&data).ok());+ let update_available = latest+ .as_ref()+ .is_some_and(|latest| is_newer_release(&latest.tag_name, ¤t_version));++ CachedUpdateStatus {+ current_version,+ latest,+ update_available,+ last_checked,+ }+}+#[cfg(test)]mod update_version_tests {use super::is_newer_release;@@ -303,10 +364,7 @@ fn update_checker() {current);- let url = format!(- "https://github.com/RoversX/thinkterm/releases/tag/{}",- latest.tag_name- );+ let url = release_tag_url(&latest.tag_name);if force_ui || socks.is_empty() || socks[0] == my_sock {persistent_toast_notification_with_click_to_open_url(