weishu
|
6066f20c20
|
feat(ios): zh-CN localization + catalog dedupe (A-M5)
Part 1 — Simplified Chinese localization of the iOS app layer:
- ios/Hapi/Resources/Localizable.xcstrings: hand-authored String Catalog
(395 keys, zh-Hans; en implicit as source). Terminology mined from
web/src/lib/locales/zh-CN.ts (会话/新建会话/权限模式/允许/拒绝/工作树/
机器/语音输入/用量/草稿夹 …).
- Mechanical edits only: merged multi-part string concatenations into
single LocalizedStringKey literals, converted ternary/plain-String user
copy to String(localized:), switched helper params (detailRow,
DashboardCard, optionPicker, notice) to LocalizedStringKey.
- LocalizedNoticeMapper (app layer): display-point translation of the 27
known HapiKit-emitted strings (ChatInteractor notices, dictation errors,
window-sync warnings, files fallbacks, worktree-name validation) with
verbatim passthrough for server-originated text; package stays
language-free.
- Deliberately untranslated (web parity / non-copy): event rows
(EventPresentation — web renders presentation.ts verbatim), catalog
option labels (Default/Auto/Sonnet/permission modes — web shows them
verbatim), tool names, code-like titles (grep(pattern:), MCP:, Skill,
Task), unit suffixes (B/KB/MB, m/h/d/w), decorative separators.
- Language row wired: AppLanguage gains .system (follow system, new
default); explicit picks write the AppleLanguages override, Follow
system removes it; footer notes a relaunch applies it (no supported
in-place SwiftUI locale swap).
- project.pbxproj: zh-Hans added to knownRegions.
Part 2 — #39 catalog dedupe (HapiProtocol):
- NewSessionCatalogs.claudeModels/claudeEfforts now derive from
ClaudeModels/ClaudeEfforts (single source shared with ModelCatalog);
codexReasoningEfforts stays own data (web CODEX_REASONING_EFFORT_OPTIONS
minus max); effortLabel delegates to ModelCatalog.capitalizedFirst.
- New CatalogTests lock test for the derived option lists.
Gate: bash ios/scripts/linux-test.sh — 459 tests green.
|
2026-08-18 16:04:03 +08:00 |
|
weishu
|
fa91f06662
|
feat(ios): new session flow (A-M3c)
Port of the tested Android NEW SESSION reference (B-M3d) to iOS:
- HapiProtocol: NewSessionCatalogs (static claude models/efforts + codex
reasoning-effort fallback, exact Android data) in Catalog/; CodexModelSummary
+ CodexModelsResponse wire types (shared/src/apiTypes.ts).
- HapiClient: machineCodexModels endpoint (GET /api/machines/:id/codex-models,
rpc_target_missing surfaces as APIError); NewSession/NewSessionForm.swift —
typed Codable draft (tolerant decode) + NewSessionLogic: exact spawn body
per SpawnSessionRequestSchema (yolo incl. false for non-grok/non-codex-family,
permissionMode incl. 'default' for grok+codex-family, sessionType always,
trimmed-or-absent worktreeName, serviceTier only while fast tier visible,
collaborationMode only when plan, model only claude/codex), parent-path
derivation, suggestion filtering, recent-path LRU(8), worktree-name
validation, codex catalog helpers, draft sanitization.
- App: Features/NewSession (NewSessionModel @Observable orchestration —
machine preselect last-used, 250 ms debounced list-directory autocomplete
with per-parent cache, exists probe with worktree-blocking / simple
two-tap-create, codex catalog fetch + selection reconcile, UserDefaults
draft/prefs per hub; NewSessionView Form UI with per-flavor option matrix);
session-list "+" toolbar button on HomeView presents the sheet, success
dismisses and pushes the chat.
- Tests: spawn-body exactness (4 configs, canonical JSON), parent query,
suggestions, LRU, worktree validation, fast-tier detection, reasoning-effort
normalization, draft sanitize + tolerant decode; codex-models endpoint
request/error construction.
|
2026-08-18 10:03:05 +08:00 |
|