Open source CapCut alternative.
TypeScript
refactor(app): let the conversation row own step-narration truncation
David Le050182577f94
diff --git a/apps/Donkey/Sources/Donkey/UserQueryCommandHandler.swift b/apps/Donkey/Sources/Donkey/UserQueryCommandHandler.swiftindex 73098399..bb4b5fef 100644--- a/apps/Donkey/Sources/Donkey/UserQueryCommandHandler.swift+++ b/apps/Donkey/Sources/Donkey/UserQueryCommandHandler.swift@@ -1365,24 +1365,21 @@ struct LocalAppUserQueryCommandHandler: UserQueryCommandHandling {/// driving the raw command instead of stalling silently.private static let understandingTimeoutSeconds: TimeInterval = 15- /// One short line describing the step that just ran, for the spawn cursor's- /// label: the planner's stated reason, else the tool result's own summary.+ /// One line describing the step that just ran: the planner's stated reason, else the tool result's+ /// own summary. The conversation row owns visual truncation with a five-line tail clamp; cursor+ /// labels are bounded later in the overlay model.@MainActorstatic func stepNarration(for step: HarnessStepExecutionResult,planner: HostedHarnessStepPlanner) -> String? {let candidate = planner.lastNarration ?? step.toolResult?.summary- guard var narration = candidate?+ guard let narration = candidate?.trimmingCharacters(in: .whitespacesAndNewlines).components(separatedBy: .newlines).first,!narration.isEmpty else {return nil}- let maxLength = 90- if narration.count > maxLength {- narration = String(narration.prefix(maxLength)).trimmingCharacters(in: .whitespaces) + "…"- }return narration}diff --git a/apps/Donkey/Tests/DonkeyRuntimeTests/HostedHarnessStepPlannerTests.swift b/apps/Donkey/Tests/DonkeyRuntimeTests/HostedHarnessStepPlannerTests.swiftindex a3343428..7f8b0d78 100644--- a/apps/Donkey/Tests/DonkeyRuntimeTests/HostedHarnessStepPlannerTests.swift+++ b/apps/Donkey/Tests/DonkeyRuntimeTests/HostedHarnessStepPlannerTests.swift@@ -1,3 +1,4 @@+@testable import Donkeyimport DonkeyAIimport DonkeyContractsimport DonkeyHarness