Stabilize channels UX, reload flow, and i18n consistency

This commit is contained in:
ashione
2026-03-08 00:30:26 +08:00
parent 4651f8ec56
commit 72585589af
9 changed files with 311 additions and 54 deletions

View File

@@ -66,3 +66,48 @@ This branch captures local refactors focused on frontend UX polish, IPC call con
## Notes
- Navigation order in sidebar is kept aligned with `main` ordering.
- This commit snapshots current local refactor state for follow-up cleanup/cherry-pick work.
## Incremental Updates (2026-03-08)
### 9. Channel i18n fixes
- Added missing `channels` locale keys in EN/ZH/JA to prevent raw key fallback:
- `configured`, `configuredDesc`, `configuredBadge`, `deleteConfirm`
- Fixed confirm dialog namespace usage on Channels page:
- `common:actions.confirm`, `common:actions.delete`, `common:actions.cancel`
### 10. Channel save/delete behavior aligned to reload-first strategy
- Added Gateway reload capability in `GatewayManager`:
- `reload()` (SIGUSR1 on macOS/Linux, restart fallback on failure/unsupported platforms)
- `debouncedReload()` for coalesced config-change reloads
- Wired channel config operations to reload pipeline:
- `channel:saveConfig`
- `channel:deleteConfig`
- `channel:setEnabled`
- Removed redundant renderer-side forced restart call after WhatsApp configuration.
### 11. OpenClaw config compatibility for graceful reload
- Ensured `commands.restart = true` is persisted in OpenClaw config write paths:
- `electron/utils/channel-config.ts`
- `electron/utils/openclaw-auth.ts`
- Added sanitize fallback that auto-enables `commands.restart` before Gateway start.
### 12. Channels page data consistency fixes
- Unified configured state derivation so the following sections share one source:
- stats cards
- configured channels list
- available channel configured badge
- Fixed post-delete refresh by explicitly refetching both:
- configured channel types
- channel status list
### 13. Channels UX resilience during Gateway restart/reconnect
- Added delayed gateway warning display to reduce transient false alarms.
- Added "running snapshot" rendering strategy:
- keep previous channels/configured view during `starting/reconnecting` when live response is temporarily empty
- avoids UI flashing to zero counts / empty configured state
- Added automatic refresh once Gateway transitions back to `running`.
### 14. Configure-but-disable support
- Added enable toggle in channel setup dialog (`Enable Channel`).
- Save flow now persists `enabled` with configuration payload.
- Existing config load now reads `enabled` state and pre-fills toggle accordingly.