Audited every `Priority: P0` row in `docs/requirements/{sysrs,srs}.md`
against the live code. Three items needed work; this commit closes
all three.
Gap A — SysRS-262 + SysRS-282 (screen-reader semantics + accessible
labels for the PTT control)
-------------------------------------------------------------------
The Flutter PTT control is a custom `Listener` over a `Container`
— not a built-in `Button`, so the platform accessibility tree had
no idea it was an interactive control. Screen readers
(VoiceOver, TalkBack, NVDA, Orca) would have read the visible text
without announcing the control role or its toggled state.
Wrap the Listener in a `Semantics(button: true, toggled: _pressed,
label: …, hint: …, excludeSemantics: true)` so the platform
accessibility tree carries the right role, the current state
("Hold to talk" / "Transmitting"), and a usage hint. The
`excludeSemantics: true` argument suppresses the duplicate child
nodes the Container + Row + Icon + Text would otherwise generate
on top of our explicit label.
SysRS-263 (no colour-only state) is preserved: the visible label
and the mic icon already differentiate the two states without
relying on the colour transition.
New ARB key `pttHoldToTalkSemanticsHint` in `app_en.arb` and
`app_zh.arb`.
Gap B — SRS-198 (macOS async permission re-check)
-------------------------------------------------
The macOS backend queried `query_permission()` once at
construction and never re-checked. That violates SRS-198's
"upgrade to the appropriate Global level only after the user
grants the required permission" — once Chanora is running, a
runtime grant must lift the descriptor from `L0Focused` to a
Global level without an app restart.
Substantive rewrite of `crates/chanora_audio/src/ptt_backends/macos.rs`:
* `permission: PermissionState` becomes `permission: Arc<AtomicU8>`,
enabling cross-thread updates without a Mutex.
`PermissionState::{to_u8, from_u8}` carry the encoding.
* The backend owns a `tokio::sync::watch::Sender<PttBackendDescriptor>`
and overrides `DesktopPttBackend::descriptor_watch()` to hand
out subscribers; `chanora_core::ChanoraSession::start_audio`
already forwards transitions to `SessionEvent::PttCapability`.
* `start()` spawns a `chanora-perm-watch` OS thread that polls
`query_permission()` every 1.5 s and republishes the
descriptor on every transition. Polling rather than KVO /
notifications because Input-Monitoring has no public
change-notification API on macOS; 1.5 s is sufficient for a
user grant + return-to-Chanora cycle.
* `rebind()` also republishes the descriptor so a
`keyboard → mouse-side-button` change updates the badge.
* Six new unit tests on the platform-independent
`build_descriptor` and the atomic encoding contract. They
only compile under `target_os = "macos"` (consistent with
the rest of the module), so the Linux dev-host workspace
test count is unchanged.
`query_permission()` itself still returns `Undetermined` until
the IOKit live link lands in the macOS platform-verification
commit; the re-query loop will engage the upgrade path
automatically the moment that function returns real values.
Gap C — SRS-200 (Linux mouse-side-button portal-dependence)
-----------------------------------------------------------
`desktop-ptt-architecture.md` §5.3 already described the
heuristic classifier. Added one explicit sentence stating that
Linux mouse-side-button support is *portal-dependent*: Chanora
never claims a fixed Mouse4/Mouse5 binding on Linux; the portal
decides what inputs it accepts in the current session, and the
classifier degrades to `keyboard` whenever the portal's
description does not contain "mouse". This matches the SRS-200
text verbatim and removes the ambiguity over what "Linux
support follows the portal" means in practice.
Verification
------------
* `cargo test --workspace` (with `CHANORA_DISABLE_KEYRING=1`):
all 67 Linux-side tests green (unchanged). The new macOS
unit tests count under `target_os = "macos"` only — they
will report once the macOS reference host runs `cargo test`.
* `cargo deny check`: advisories ok, bans ok, licenses ok,
sources ok.
* `flutter analyze`: clean (no new accessibility warnings).
* Linux release bundle builds clean.
P0 audit summary
----------------
After this commit every Priority: P0 row in `sysrs.md` and
`srs.md` has a concrete implementation. The remaining open items
are all live verification, not code:
* Per-platform live PTT traces on Windows / macOS reference
hosts (RR-PTT-001..003, RR-PTT-008) — hosts unavailable
locally; queued for platform owners.
* Linux GNOME-Wayland live trace (RR-PTT-004) — implemented
in rc.5; awaiting live host trace.
* Linux non-tested compositor fallback trace (RR-PTT-005) —
Open.
* Diagnostic-export key-leak inspection (RR-PTT-006) — Open
but trivially testable on any host with PTT bound.
* DEC-012 legal review — engineering hand-off complete since
rc.2.
67 lines
3.2 KiB
Plaintext
67 lines
3.2 KiB
Plaintext
{
|
||
"@@locale": "zh",
|
||
"@@x-source-of-truth": "DEC-015 (register v0.9.5). Simplified Chinese for the Beta key set.",
|
||
|
||
"appTitle": "Chanora",
|
||
"homeNotProductionReadyBanner": "Beta 版本——已接通语音收发;尚未达到生产环境质量。",
|
||
|
||
"fieldServerHost": "服务器地址",
|
||
"fieldNickname": "昵称",
|
||
"fieldServerPassword": "服务器密码",
|
||
"fieldServerPasswordHelp": "如果服务器无需密码,留空即可。",
|
||
"fieldPassword": "密码",
|
||
"fieldDisplayName": "显示名称",
|
||
|
||
"connectAction": "连接",
|
||
"disconnectAction": "断开连接",
|
||
"refreshAction": "刷新",
|
||
"diagnosticsAction": "诊断信息",
|
||
"aboutAction": "关于",
|
||
"aboutVersion": "版本 {version}",
|
||
"aboutNonAffiliation": "Chanora 是独立项目,与 TeamSpeak 之间不存在任何附属、认可、赞助或官方关联关系。",
|
||
"aboutLicenseHeading": "许可协议",
|
||
"aboutLicenseBody": "Chanora 采用 Apache License 2.0 或 MIT License 双协议授权,使用者可任选其一。完整协议文本以 LICENSE-APACHE 与 LICENSE-MIT 形式随仓库一同分发。",
|
||
"aboutThirdPartyHeading": "第三方组件",
|
||
"aboutThirdPartyBody": "Chanora 基于 tsclientlib、flutter_rust_bridge、cpal、rusqlite、Flutter 框架等开源组件构建。完整归属信息请参阅仓库根目录的 NOTICE 文件。",
|
||
"copyAction": "复制",
|
||
"closeAction": "关闭",
|
||
"startAudioAction": "启动语音",
|
||
"pttHoldToTalk": "按住说话",
|
||
"pttTransmitting": "正在发送…",
|
||
"pttHoldToTalkSemanticsHint": "按住进行语音发送,松开停止。",
|
||
"pttCapabilityBadge": "对讲能力:{level}({backend})",
|
||
"pttConfigureAction": "配置",
|
||
"pttConfigureTitle": "配置对讲按键",
|
||
"pttConfigurePrompt": "按下您希望用于对讲的按键或鼠标侧键。",
|
||
"pttConfigureWaiting": "(等待输入…)",
|
||
"pttConfigureCaptured": "已捕获",
|
||
"pttConfigurePrivacyNote": "Chanora 不会记录具体的按键值。本对话框只会向应用提交输入类别(键盘 / 鼠标侧键)以及一个跨平台标签。",
|
||
"pttConfigureSaveAction": "保存",
|
||
"pttConfigurePortalRedirect": "您的桌面环境将打开自带的快捷键对话框,请在其中选择用于对讲的按键。",
|
||
"inputMuteAction": "静音麦克风",
|
||
"inputUnmuteAction": "取消麦克风静音",
|
||
"outputMuteAction": "静音扬声器",
|
||
"outputUnmuteAction": "取消扬声器静音",
|
||
"joinChannelAction": "加入频道",
|
||
"channelPasswordTitle": "频道密码",
|
||
"bookmarksHeading": "书签",
|
||
"bookmarksEmpty": "尚无书签。先在上方填写服务器,然后点击“保存书签”。",
|
||
"bookmarkAddAction": "保存书签",
|
||
"bookmarkAddTitle": "保存书签",
|
||
"bookmarkDeleteAction": "删除书签",
|
||
|
||
"statusIdle": "未连接",
|
||
"statusConnecting": "正在连接…",
|
||
"statusConnected": "已连接到 {server}",
|
||
"statusError": "错误:{message}",
|
||
|
||
"statusReconnecting": "正在重新连接……第 {attempt} 次尝试,{delay} 秒后",
|
||
"statusConnectionLost": "连接已断开:{reason}",
|
||
|
||
"audioStatsLine": "发送 {sent} 帧 • 接收 {received} 帧 • PTT {ptt}",
|
||
|
||
"channelsHeading": "频道",
|
||
"clientsHeading": "在线用户",
|
||
"countChannelsAndClients": "{channels} 个频道 • {clients} 在线"
|
||
}
|