feat: harden Flow cold-start/force-quit and polish macOS dictation UX

Fix cold-start overlay recursion that overflowed the main-thread stack when
recording began while the ready overlay was still up; also remove temporary
on-screen Flow DEBUG panels after the orange-mic investigation, and land the
macOS overlay/catalog/layout polish plus related Flow recovery hardening.
This commit is contained in:
Rocky
2026-07-10 12:39:41 +08:00
parent dcb66a9849
commit cdf833935a
104 changed files with 5794 additions and 853 deletions
+15 -1
View File
@@ -340,7 +340,7 @@ final class IntelligentPolishTests: XCTestCase {
@MainActor
func testFlowFallbackDeliveryCleansTextAndCarriesWeakNetworkWarning() {
let delivery = FlowSessionManager.makeFallbackDelivery(
let delivery = TranscriptionPolishFallback.makeDelivery(
rawText: " 你 是不是 已经 解决了 这个 问题 ? ",
error: LLMError.transport("offline"),
engineMode: "cloud",
@@ -352,6 +352,20 @@ final class IntelligentPolishTests: XCTestCase {
XCTAssertEqual(delivery.polishWarning, SharedL10n.string("flow.warning.polishDegraded"))
}
func testTranscriptionPolishFallbackLocalMissingKeyWarning() {
let delivery = TranscriptionPolishFallback.makeDelivery(
rawText: "测试文本",
error: PolishingService.PolishError.missingAPIKey,
engineMode: "local",
chunkWarning: nil
)
XCTAssertEqual(delivery.text, "测试文本")
XCTAssertEqual(
delivery.polishWarning,
SharedL10n.string("flow.warning.localPolishUnavailable")
)
}
func testHasStructureSignalDetectsChineseEnumeration() {
XCTAssertTrue(TranscriptPostProcessor.hasStructureSignal(in: "首先测试其次上线"))
XCTAssertTrue(TranscriptPostProcessor.hasStructureSignal(in: "第一点修复"))