Commit 428c35e
fix(triage): exonerate the reducer for the stuck-Send + clear input on Start-over (PP-4846) (#1318)
PP-4846 (repro-first): after Discard → pick a different category → type, the Send
arrow intermittently stayed disabled. It did not reproduce deterministically.
Pinned the REDUCER side of that flow — the source of truth the Send button's
`disabled` predicate reads (`!isFollowUpStep && inputText.trimmed.isEmpty`).
`StuckSendReproTests` drives Discard → re-category → type and proves inputText is
set and the step is a composition step, i.e. Send is enabled at the reducer
level. So the intermittent field report is localized to the SwiftUI TextField
binding (consistent with the "UIKit gesture-timeout" log + the non-determinism),
NOT the state machine.
Writing that test surfaced a real, separate latent bug: `.userTappedStartOver`
returned to `.awaitingCategory` but did NOT clear `inputText`, so a half-typed
composer survived "start fresh" — unlike Discard, which lands empty. In practice
Start-over is reached with inputText already empty (post-submit), but the two
reset paths should have identical composer semantics. Now both clear it.
Verified: TriageBotCore reducer suites green (StuckSendReproTests +
CategoryChipDebounce + StructuredEscalation, 13/13).
**Scope:** the Start-over reset clears inputText; reducer-level tests for both
reset paths. No SwiftUI change.
**Not done:** the intermittent SwiftUI TextField(axis:.vertical) binding
re-sync itself — reducer is exonerated; recommended fix is the local-@State
mirror pattern already used by TicketPreviewCard, but it can't be verified
without a deterministic repro, so it is not shipped blind here.
**Deferred:** a simdrive repro harness for the SwiftUI race (needs a dedicated
run; the field bug is intermittent).
Co-authored-by: t <t@t.io>1 parent d465a6b commit 428c35e
2 files changed
Lines changed: 91 additions & 0 deletions
File tree
- Palace/Packages/PalaceTriageBot
- Sources/TriageBotCore/Reducer
- Tests/TriageBotCoreTests
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
638 | 643 | | |
639 | 644 | | |
640 | 645 | | |
| |||
Lines changed: 86 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
0 commit comments