feat(polish): allow mood emoji on custom styles and ship Flow/ASR fixes

Custom polish styles can opt in to emotion-matched emoji (default off), with
prompt-level opt-in detection so paste-only styles keep model-added emoji.
Also include Volcengine API-Key ASR auth, voice-processing capture, PiP flash
fix, and related keyboard Shift/haptics reliability work.
This commit is contained in:
Rocky
2026-08-06 15:11:12 +08:00
parent 2ed16e1fbf
commit a8d58d8f0c
47 changed files with 1467 additions and 258 deletions
@@ -61,6 +61,15 @@ final class EnglishTypingTests: XCTestCase {
XCTAssertTrue(
TypingAutocapitalization.shouldCapitalize(precedingText: "Hello!\n", mode: .sentences)
)
// System keyboard (.sentences): Return starts a new line capitalize.
// Notes-style document context after Return is typically "\n".
XCTAssertTrue(
TypingAutocapitalization.shouldCapitalize(precedingText: "Hello\n", mode: .sentences),
"Return/newline must arm Shift (Notes multi-line)"
)
XCTAssertTrue(
TypingAutocapitalization.shouldCapitalize(precedingText: "Hello\n\n", mode: .sentences)
)
XCTAssertFalse(
TypingAutocapitalization.shouldCapitalize(precedingText: "Hello ", mode: .sentences)
)
@@ -72,6 +81,55 @@ final class EnglishTypingTests: XCTestCase {
)
}
@MainActor
func testEnglishShiftArmsAfterReturnLikeNotes() {
// Simulates Notes: proxy preceding text gains a trailing newline after Return.
var preceding = "Hello"
let typing = TypingSessionController()
typing.precedingTextProvider = { preceding }
typing.autocapitalizationModeProvider = { .sentences }
_ = typing.setLanguage(.english)
XCTAssertFalse(typing.shiftActive, "mid-word should not arm Shift")
_ = typing.handleReturn()
preceding = "Hello\n" // host document after inserting newline
typing.syncAutocapitalization(accountingForInsert: "\n")
XCTAssertTrue(
typing.shiftActive,
"after Return, Shift must light for next line (system sentences behavior)"
)
XCTAssertEqual(typing.keyRows.first?.first, "Q")
}
@MainActor
func testEnglishShiftArmsWhenProxyLagsAfterReturn() {
// Notes often still reports pre-Return context right after insertText("\n").
var preceding = "Hello"
let typing = TypingSessionController()
typing.precedingTextProvider = { preceding }
typing.autocapitalizationModeProvider = { .sentences }
_ = typing.setLanguage(.english)
_ = typing.handleReturn()
// Proxy intentionally stale still "Hello" without "\n".
typing.syncAutocapitalization(accountingForInsert: "\n")
XCTAssertTrue(typing.shiftActive)
XCTAssertEqual(typing.keyRows.first?.first, "Q")
}
@MainActor
func testEnglishShiftArmsWhenProxyLagsAfterPeriod() {
var preceding = "Hello"
let typing = TypingSessionController()
typing.precedingTextProvider = { preceding }
typing.autocapitalizationModeProvider = { .sentences }
_ = typing.setLanguage(.english)
_ = typing.handleKey(".")
typing.syncAutocapitalization(accountingForInsert: ".")
XCTAssertTrue(typing.shiftActive)
}
@MainActor
func testEnglishIdleShowsNoCandidatesUntilLetterTyped() {
let typing = TypingSessionController()