feat(ios): add a pending-request center to chat

Port the web's pending-request affordances to the native chat:

- A collapsible "Awaiting your reply" panel above the composer collects
  non-blocking request_user_input questions, including ones outside the
  loaded transcript. It reuses the existing question form/draft machinery,
  so collapsing and scrolling never discard an answer.
- The composer status bar shows the pending count and kind. One request
  jumps directly; several open a native menu with each request's command
  or question.
- Async questions reveal and briefly highlight in the bottom panel.
  Blocking requests scroll the transcript to their correlated tool row and
  flash that row, using a new tokenized scroll target on
  AnchoredTranscriptList.

Adds pure pending-request presentation tests and Chinese strings.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-12-01 06:32:25 +08:00
co-authored by HAPI Claude Code
parent fe66a74a16
commit a2f7b30ddd
8 changed files with 534 additions and 8 deletions
@@ -35,6 +35,7 @@ enum TranscriptRow: Identifiable, Equatable {
struct ChatTranscriptView: View {
@Environment(\.scenePhase) private var scenePhase
@Environment(\.hapiTheme) private var theme
let model: ChatModel
private var rows: [TranscriptRow] {
@@ -58,6 +59,8 @@ struct ChatTranscriptView: View {
jumpToken: model.jumpToLatestToken,
historyControlID: TranscriptRow.historyID,
isInspectionPresented: model.isInspectingContent,
scrollTargetID: model.scrollTargetRowID,
scrollTargetToken: model.scrollTargetToken,
onViewport: { viewport in
model.readingViewportChanged(
followsTail: viewport.followsTail, needsOlder: viewport.needsOlder,
@@ -71,7 +74,17 @@ struct ChatTranscriptView: View {
spacingBefore: { previous, row in row.spacing(after: previous) }
) { row in
// The list bridges the current environment into its hosting roots.
AnyView(rowView(row))
AnyView(
rowView(row)
.overlay {
if model.highlightedRowID == row.id {
RoundedRectangle(cornerRadius: 12, style: .continuous)
.stroke(theme.warning, lineWidth: 2)
.padding(2)
.allowsHitTesting(false)
}
}
)
}
.overlay(alignment: .bottomTrailing) {
if model.showsJumpToLatest {