From c8a4b18d348af31ea4a1c6a9d55a8011b846f2b5 Mon Sep 17 00:00:00 2001 From: David Metcalfe <80915+DavidMetcalfe@users.noreply.github.com> Date: Tue, 21 Jul 2026 18:48:08 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20address=20community=20review=20=E2=80=94?= =?UTF-8?q?=20system=20default,=20clearable=20schema=20flag,=20UTC=20fallb?= =?UTF-8?q?ack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add 'System default' clear option to SearchableSelect via clearLabel prop - Add clearable flag to ConfigFieldSchema (schema-driven, not hardcoded) - Add clearable: true to timezone schema override in web_server.py - Fix CommandItem value for clear item: use clearLabel instead of '' so cmdk can match it during search - Fix backend: or ['UTC'] fallback for hosts without tzdata where available_timezones() returns an empty set (not an exception) - Add systemDefault i18n key (en, types, zh) --- apps/desktop/src/app/settings/config-field.tsx | 1 + .../src/app/settings/searchable-select.tsx | 18 +++++++++++++++++- apps/desktop/src/i18n/en.ts | 1 + apps/desktop/src/i18n/types.ts | 1 + apps/desktop/src/i18n/zh.ts | 1 + apps/desktop/src/types/hermes.ts | 3 +++ hermes_cli/web_server.py | 3 ++- 7 files changed, 26 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/app/settings/config-field.tsx b/apps/desktop/src/app/settings/config-field.tsx index 7e5418b3070..7461b4b0c08 100644 --- a/apps/desktop/src/app/settings/config-field.tsx +++ b/apps/desktop/src/app/settings/config-field.tsx @@ -101,6 +101,7 @@ export function ConfigField({ if (selectOptions && schema.searchable) { return row( onChange(next)} options={selectOptions.filter(o => o !== '')} diff --git a/apps/desktop/src/app/settings/searchable-select.tsx b/apps/desktop/src/app/settings/searchable-select.tsx index 855b2c4d568..260d905b985 100644 --- a/apps/desktop/src/app/settings/searchable-select.tsx +++ b/apps/desktop/src/app/settings/searchable-select.tsx @@ -21,13 +21,17 @@ export function SearchableSelect({ onChange, options, placeholder = 'Search…', - emptyMessage = 'No results found.' + emptyMessage = 'No results found.', + clearLabel }: { value: string onChange: (value: string) => void options: string[] placeholder?: string emptyMessage?: string + /** When set, prepends a "clear" item that sets the value to ''. + * Matches the existing EMPTY_SELECT_VALUE pattern. */ + clearable?: boolean type?: 'boolean' | 'list' | 'number' | 'select' | 'string' | 'text' } diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py index 5c1de9df75a..8925827637e 100644 --- a/hermes_cli/web_server.py +++ b/hermes_cli/web_server.py @@ -803,7 +803,7 @@ def _timezone_options() -> List[str]: """Return sorted IANA timezone identifiers, cached at import time.""" try: import zoneinfo - return sorted(zoneinfo.available_timezones()) + return sorted(zoneinfo.available_timezones()) or ["UTC"] except Exception: # pragma: no cover return ["UTC"] @@ -814,6 +814,7 @@ _SCHEMA_OVERRIDES: Dict[str, Dict[str, Any]] = { "description": "IANA timezone (e.g. America/New_York). Blank uses the system timezone.", "options": _timezone_options(), "searchable": True, + "clearable": True, }, "memory.provider": { "type": "select",