Skip to content

Open source CapCut alternative.

TypeScript

Adjust UI

David Lec37716f13753
diff --git a/apps/Donkey/Sources/Donkey/PointerPromptOverlayController.swift b/apps/Donkey/Sources/Donkey/PointerPromptOverlayController.swift
index 63bdbefc..21a3a75f 100644
--- a/apps/Donkey/Sources/Donkey/PointerPromptOverlayController.swift
+++ b/apps/Donkey/Sources/Donkey/PointerPromptOverlayController.swift
@@ -453,7 +453,10 @@ final class PointerPromptOverlayController {
x: composerFrame.minX,
y: composerFrame.minY,
width: PointerPromptLayout.composerInputSurfaceWidth,
- height: PointerPromptLayout.composerInputHeight(inputTextHeight: model.inputTextHeight)
+ height: PointerPromptLayout.composerInputHeight(
+ inputTextHeight: model.inputTextHeight,
+ isExpanded: model.isInputExpanded
+ )
)
}
@@ -467,25 +470,20 @@ final class PointerPromptOverlayController {
}
private func composerTextInputFrame(in inputSurfaceFrame: CGRect) -> CGRect {
- if PointerPromptLayout.isComposerInputExpanded(inputTextHeight: model.inputTextHeight) {
+ if model.isInputExpanded {
return CGRect(
x: inputSurfaceFrame.minX +
PointerPromptLayout.composerExpandedTextHorizontalPadding,
y: inputSurfaceFrame.maxY -
PointerPromptLayout.composerExpandedTextTopPadding -
model.inputTextHeight,
- width: inputSurfaceFrame.width -
- PointerPromptLayout.composerExpandedTextHorizontalPadding * 2,
+ width: PointerPromptLayout.composerExpandedTextWidth,
height: model.inputTextHeight
)
}
- let waveformAndSpacingWidth: CGFloat = 54 + 12
let x = inputSurfaceFrame.minX + PointerPromptLayout.composerInputLeadingContentPadding
- let width = inputSurfaceFrame.width -
- PointerPromptLayout.composerInputLeadingContentPadding -
- PointerPromptLayout.composerInputTrailingContentPadding -
- waveformAndSpacingWidth
+ let width = PointerPromptLayout.composerWrappingTextWidth
let height = model.inputTextHeight
return CGRect(
@@ -528,11 +526,17 @@ final class PointerPromptOverlayController {
}
private var currentContentSize: CGSize {
- PointerPromptLayout.contentSize(inputTextHeight: model.inputTextHeight)
+ PointerPromptLayout.contentSize(
+ inputTextHeight: model.inputTextHeight,
+ isExpanded: model.isInputExpanded
+ )
}
private var currentComposerHeight: CGFloat {
- PointerPromptLayout.composerHeight(inputTextHeight: model.inputTextHeight)
+ PointerPromptLayout.composerHeight(
+ inputTextHeight: model.inputTextHeight,
+ isExpanded: model.isInputExpanded
+ )
}
private func resizeActivePanelIfNeeded(_ panel: NSPanel) {
diff --git a/apps/Donkey/Sources/Donkey/PointerPromptOverlayModel.swift b/apps/Donkey/Sources/Donkey/PointerPromptOverlayModel.swift
index 0088ee6f..f2834511 100644
--- a/apps/Donkey/Sources/Donkey/PointerPromptOverlayModel.swift
+++ b/apps/Donkey/Sources/Donkey/PointerPromptOverlayModel.swift
@@ -10,6 +10,7 @@ final class PointerPromptOverlayModel: ObservableObject, PointerPromptIntentSink
@Published var messageText = ""
@Published var placement: PointerPromptPlacement = .bottomRight
@Published var inputTextHeight = PointerPromptLayout.composerInputTextMinimumHeight
+ @Published var isInputExpanded = false
private let runtimeProvider: any RuntimeStatusProviding
private let aiProvider: any AIHarnessSnapshotProviding
@@ -58,11 +59,17 @@ final class PointerPromptOverlayModel: ObservableObject, PointerPromptIntentSink
guard !trimmedText.isEmpty else { return }
messageText = ""
+ inputTextHeight = PointerPromptLayout.composerInputTextMinimumHeight
+ isInputExpanded = false
promptState.leadingSignalLevel = .thinking
case .inputTextHeightChanged(let height):
- let clampedHeight = max(PointerPromptLayout.composerInputTextMinimumHeight, height)
+ let clampedHeight = PointerPromptLayout.clampedComposerInputTextHeight(height)
guard abs(inputTextHeight - clampedHeight) > 0.5 else { return }
inputTextHeight = clampedHeight
+ case .inputExpansionChanged(let isExpanded):
+ let shouldExpand = !messageText.isEmpty && (isExpanded || messageText.contains("\n"))
+ guard isInputExpanded != shouldExpand else { return }
+ isInputExpanded = shouldExpand
case .dismissed:
promptState.isPrimaryActionEnabled = false
promptState.isActive = false
diff --git a/apps/Donkey/Sources/Donkey/PointerPromptOverlayRootView.swift b/apps/Donkey/Sources/Donkey/PointerPromptOverlayRootView.swift
index e7b747b0..4f40bc5a 100644
--- a/apps/Donkey/Sources/Donkey/PointerPromptOverlayRootView.swift
+++ b/apps/Donkey/Sources/Donkey/PointerPromptOverlayRootView.swift
@@ -10,12 +10,19 @@ struct PointerPromptOverlayRootView: View {
state: model.promptState,
messageText: $model.messageText,
inputTextHeight: model.inputTextHeight,
+ isInputExpanded: model.isInputExpanded,
placement: model.placement,
intentSink: model
)
.frame(
- width: PointerPromptLayout.contentSize(inputTextHeight: model.inputTextHeight).width,
- height: PointerPromptLayout.contentSize(inputTextHeight: model.inputTextHeight).height
+ width: PointerPromptLayout.contentSize(
+ inputTextHeight: model.inputTextHeight,
+ isExpanded: model.isInputExpanded
+ ).width,
+ height: PointerPromptLayout.contentSize(
+ inputTextHeight: model.inputTextHeight,
+ isExpanded: model.isInputExpanded
+ ).height
)
}
}
diff --git a/apps/Donkey/Sources/DonkeyContracts/PointerPromptContracts.swift b/apps/Donkey/Sources/DonkeyContracts/PointerPromptContracts.swift
index 6b9e485f..f7344e45 100644
--- a/apps/Donkey/Sources/DonkeyContracts/PointerPromptContracts.swift
+++ b/apps/Donkey/Sources/DonkeyContracts/PointerPromptContracts.swift
@@ -203,6 +203,7 @@ public enum PointerPromptIntent: Equatable, Sendable {
case primaryActionRequested(promptText: String)
case messageSubmitted(text: String)
case inputTextHeightChanged(CGFloat)
+ case inputExpansionChanged(Bool)
case dismissed
}
diff --git a/apps/Donkey/Sources/DonkeyContracts/PointerPromptLayout.swift b/apps/Donkey/Sources/DonkeyContracts/PointerPromptLayout.swift
index cb88517a..4c14cfcd 100644
--- a/apps/Donkey/Sources/DonkeyContracts/PointerPromptLayout.swift
+++ b/apps/Donkey/Sources/DonkeyContracts/PointerPromptLayout.swift
@@ -21,8 +21,11 @@ public enum PointerPromptLayout {
public static let composerInputHorizontalPadding: CGFloat = 16
public static let composerInputLeadingContentPadding: CGFloat = 20
public static let composerInputTrailingContentPadding: CGFloat = 8
+ public static let composerTextWaveformSpacing: CGFloat = 12
+ public static let composerWaveformSize = CGSize(width: 54, height: 28)
public static let composerInputMinimumHeight: CGFloat = 66
public static let composerInputTextMinimumHeight: CGFloat = 19.2
+ public static let composerInputTextMaximumHeight: CGFloat = 134.4
public static let composerInputTextVerticalPadding: CGFloat = 23.4
public static let composerInputVoiceButtonSize: CGFloat = 33.6
public static let composerExpandedTextTopPadding: CGFloat = 18
@@ -32,7 +35,7 @@ public enum PointerPromptLayout {
public static let closeButtonSize: CGFloat = 12
public static let closeButtonInset: CGFloat = 16
public static let closeControlWidth = closeButtonSize
- public static let externalCloseButtonSize: CGFloat = 24
+ public static let externalCloseButtonSize: CGFloat = 19.2
public static let externalCloseButtonGap: CGFloat = 2
public static let externalCloseButtonOutsideMargin: CGFloat = externalCloseButtonSize + externalCloseButtonGap
@@ -43,7 +46,19 @@ public enum PointerPromptLayout {
)
public static func composerInputHeight(inputTextHeight: CGFloat) -> CGFloat {
- guard isComposerInputExpanded(inputTextHeight: inputTextHeight) else {
+ composerInputHeight(
+ inputTextHeight: inputTextHeight,
+ isExpanded: isComposerInputExpanded(inputTextHeight: inputTextHeight)
+ )
+ }
+
+ public static func composerInputHeight(
+ inputTextHeight: CGFloat,
+ isExpanded: Bool
+ ) -> CGFloat {
+ let inputTextHeight = clampedComposerInputTextHeight(inputTextHeight)
+
+ guard isExpanded else {
return composerInputMinimumHeight
}
@@ -58,6 +73,25 @@ public enum PointerPromptLayout {
inputTextHeight > composerInputTextMinimumHeight + 1
}
+ public static func clampedComposerInputTextHeight(_ inputTextHeight: CGFloat) -> CGFloat {
+ min(
+ max(composerInputTextMinimumHeight, inputTextHeight),
+ composerInputTextMaximumHeight
+ )
+ }
+
+ public static var composerWrappingTextWidth: CGFloat {
+ composerInputSurfaceWidth -
+ composerInputLeadingContentPadding -
+ composerInputTrailingContentPadding -
+ composerTextWaveformSpacing -
+ composerWaveformSize.width
+ }
+
+ public static var composerExpandedTextWidth: CGFloat {
+ composerInputSurfaceWidth - composerExpandedTextHorizontalPadding * 2
+ }
+
public static func singleLineComposerInputHeight(inputTextHeight: CGFloat) -> CGFloat {
max(
composerInputMinimumHeight,
@@ -69,11 +103,22 @@ public enum PointerPromptLayout {
composerInputHeight(inputTextHeight: inputTextHeight)
}
+ public static func composerHeight(inputTextHeight: CGFloat, isExpanded: Bool) -> CGFloat {
+ composerInputHeight(inputTextHeight: inputTextHeight, isExpanded: isExpanded)
+ }
+
public static func contentSize(inputTextHeight: CGFloat) -> CGSize {
+ contentSize(
+ inputTextHeight: inputTextHeight,
+ isExpanded: isComposerInputExpanded(inputTextHeight: inputTextHeight)
+ )
+ }
+
+ public static func contentSize(inputTextHeight: CGFloat, isExpanded: Bool) -> CGSize {
CGSize(
width: contentWidth,
height: stageVerticalPadding * 2 +
- composerHeight(inputTextHeight: inputTextHeight) +
+ composerHeight(inputTextHeight: inputTextHeight, isExpanded: isExpanded) +
contentExtraHeight
)
}
diff --git a/apps/Donkey/Sources/DonkeyUI/PointerPromptStageView.swift b/apps/Donkey/Sources/DonkeyUI/PointerPromptStageView.swift
index 162c8a43..8530edfe 100644
--- a/apps/Donkey/Sources/DonkeyUI/PointerPromptStageView.swift
+++ b/apps/Donkey/Sources/DonkeyUI/PointerPromptStageView.swift
@@ -8,6 +8,7 @@ public struct PointerPromptStageView: View {
private let state: PointerPromptState
@Binding private var messageText: String
private let inputTextHeight: CGFloat
+ private let isInputExpanded: Bool
private let placement: PointerPromptPlacement
private weak var intentSink: (any PointerPromptIntentSink)?
@@ -15,12 +16,14 @@ public struct PointerPromptStageView: View {
state: PointerPromptState,
messageText: Binding<String>,
inputTextHeight: CGFloat = PointerPromptLayout.composerInputTextMinimumHeight,
+ isInputExpanded: Bool = false,
placement: PointerPromptPlacement = .bottomRight,
intentSink: any PointerPromptIntentSink
) {
self.state = state
self._messageText = messageText
self.inputTextHeight = inputTextHeight
+ self.isInputExpanded = isInputExpanded
self.placement = placement
self.intentSink = intentSink
}
@@ -83,6 +86,7 @@ public struct PointerPromptStageView: View {
state: state,
messageText: $messageText,
inputTextHeight: inputTextHeight,
+ isInputExpanded: isInputExpanded,
dismiss: {
intentSink?.handle(.dismissed)
},
@@ -91,11 +95,17 @@ public struct PointerPromptStageView: View {
},
inputTextHeightChanged: { height in
intentSink?.handle(.inputTextHeightChanged(height))
+ },
+ inputExpansionChanged: { isExpanded in
+ intentSink?.handle(.inputExpansionChanged(isExpanded))
}
)
.frame(
width: PointerPromptLayout.composerWidth,
- height: PointerPromptLayout.composerHeight(inputTextHeight: inputTextHeight)
+ height: PointerPromptLayout.composerHeight(
+ inputTextHeight: inputTextHeight,
+ isExpanded: isInputExpanded
+ )
)
}
@@ -113,9 +123,11 @@ private struct PointerPromptComposer: View {
let state: PointerPromptState
@Binding var messageText: String
let inputTextHeight: CGFloat
+ let isInputExpanded: Bool
let dismiss: @MainActor () -> Void
let submit: @MainActor () -> Void
let inputTextHeightChanged: @MainActor (CGFloat) -> Void
+ let inputExpansionChanged: @MainActor (Bool) -> Void
var body: some View {
ZStack(alignment: .topTrailing) {
@@ -130,7 +142,10 @@ private struct PointerPromptComposer: View {
}
.frame(
width: PointerPromptLayout.composerInputSurfaceWidth,
- height: PointerPromptLayout.composerInputHeight(inputTextHeight: inputTextHeight),
+ height: PointerPromptLayout.composerInputHeight(
+ inputTextHeight: inputTextHeight,
+ isExpanded: isExpanded
+ ),
alignment: .topLeading
)
.padding(.top, PointerPromptLayout.externalCloseButtonSize + PointerPromptLayout.externalCloseButtonGap)
@@ -147,17 +162,24 @@ private struct PointerPromptComposer: View {
}
private var promptCapsule: some View {
- HStack(spacing: 12) {
+ HStack(spacing: PointerPromptLayout.composerTextWaveformSpacing) {
textInput
+ .frame(width: PointerPromptLayout.composerWrappingTextWidth)
VoiceWaveformView(levels: state.voiceWaveformLevels)
- .frame(width: 54, height: 28)
+ .frame(
+ width: PointerPromptLayout.composerWaveformSize.width,
+ height: PointerPromptLayout.composerWaveformSize.height
+ )
}
.padding(.leading, PointerPromptLayout.composerInputLeadingContentPadding)
.padding(.trailing, PointerPromptLayout.composerInputTrailingContentPadding)
.frame(
width: PointerPromptLayout.composerInputSurfaceWidth,
- height: PointerPromptLayout.composerInputHeight(inputTextHeight: inputTextHeight)
+ height: PointerPromptLayout.composerInputHeight(
+ inputTextHeight: inputTextHeight,
+ isExpanded: isExpanded
+ )
)
.background {
Capsule(style: .continuous)
@@ -179,6 +201,7 @@ private struct PointerPromptComposer: View {
private var expandedPromptSurface: some View {
VStack(spacing: 0) {
textInput
+ .frame(width: PointerPromptLayout.composerExpandedTextWidth)
.padding(.top, PointerPromptLayout.composerExpandedTextTopPadding)
.padding(.horizontal, PointerPromptLayout.composerExpandedTextHorizontalPadding)
.frame(
@@ -191,7 +214,10 @@ private struct PointerPromptComposer: View {
}
.frame(
width: PointerPromptLayout.composerInputSurfaceWidth,
- height: PointerPromptLayout.composerInputHeight(inputTextHeight: inputTextHeight)
+ height: PointerPromptLayout.composerInputHeight(
+ inputTextHeight: inputTextHeight,
+ isExpanded: isExpanded
+ )
)
.background {
RoundedRectangle(
@@ -225,7 +251,10 @@ private struct PointerPromptComposer: View {
Spacer(minLength: 0)
VoiceWaveformView(levels: state.voiceWaveformLevels)
- .frame(width: 54, height: 28)
+ .frame(
+ width: PointerPromptLayout.composerWaveformSize.width,
+ height: PointerPromptLayout.composerWaveformSize.height
+ )
}
.padding(.horizontal, PointerPromptLayout.composerExpandedTextHorizontalPadding)
.frame(
@@ -265,6 +294,7 @@ private struct PointerPromptComposer: View {
placeholder: state.promptText,
isActive: state.isActive,
textHeightChanged: inputTextHeightChanged,
+ expansionChanged: inputExpansionChanged,
submit: submit
)
.frame(maxWidth: .infinity)
@@ -272,7 +302,7 @@ private struct PointerPromptComposer: View {
}
private var expandedSurfaceHeight: CGFloat {
- PointerPromptLayout.composerInputHeight(inputTextHeight: inputTextHeight)
+ PointerPromptLayout.composerInputHeight(inputTextHeight: inputTextHeight, isExpanded: true)
}
private var expandedTextAreaHeight: CGFloat {
@@ -283,8 +313,7 @@ private struct PointerPromptComposer: View {
}
private var isExpanded: Bool {
- messageText.contains("\n") ||
- PointerPromptLayout.isComposerInputExpanded(inputTextHeight: inputTextHeight)
+ isInputExpanded || messageText.contains("\n")
}
}
@@ -295,15 +324,19 @@ private struct ComposerExternalCloseButton: View {
var body: some View {
Button(action: action) {
Image(systemName: "xmark")
- .font(.system(size: 11, weight: .bold))
- .foregroundStyle(Color.white.opacity(0.82))
+ .font(.system(size: 8.8, weight: .bold))
+ .foregroundStyle(Color.white.opacity(0.92))
.frame(
width: PointerPromptLayout.externalCloseButtonSize,
height: PointerPromptLayout.externalCloseButtonSize
)
.background {
Circle()
- .fill(Color.white.opacity(isHovered ? 0.28 : 0.2))
+ .fill(Color.black.opacity(isHovered ? 0.82 : 0.68))
+ .overlay {
+ Circle()
+ .stroke(Color.white.opacity(0.42), lineWidth: 1)
+ }
}
}
.buttonStyle(.plain)
@@ -354,6 +387,7 @@ private struct ComposerMultilineTextInput: NSViewRepresentable {
let placeholder: String
let isActive: Bool
let textHeightChanged: @MainActor (CGFloat) -> Void
+ let expansionChanged: @MainActor (Bool) -> Void
let submit: @MainActor () -> Void
func makeNSView(context: Context) -> NSScrollView {
@@ -429,6 +463,7 @@ private struct ComposerMultilineTextInput: NSViewRepresentable {
DispatchQueue.main.async {
context.coordinator.updateTextContainerWidth(for: textView, in: scrollView)
context.coordinator.reportTextHeight(for: textView)
+ context.coordinator.reportExpansionState(for: textView)
if isActive, textView.window?.firstResponder !== textView {
textView.focusIfNeeded()
@@ -454,6 +489,8 @@ private struct ComposerMultilineTextInput: NSViewRepresentable {
parent.text = textView.string
textView.needsDisplay = true
reportTextHeight(for: textView)
+ reportExpansionState(for: textView)
+ textView.scrollRangeToVisible(textView.selectedRange())
}
func updateTextContainerWidth(
@@ -461,7 +498,7 @@ private struct ComposerMultilineTextInput: NSViewRepresentable {
in scrollView: NSScrollView
) {
let width = max(1, scrollView.contentView.bounds.width)
- let height = max(
+ let visibleHeight = max(
PointerPromptLayout.composerInputTextMinimumHeight,
scrollView.contentView.bounds.height
)
@@ -469,27 +506,76 @@ private struct ComposerMultilineTextInput: NSViewRepresentable {
width: width,
height: .greatestFiniteMagnitude
)
+
+ let documentHeight = max(visibleHeight, measuredTextHeight(for: textView))
textView.frame = CGRect(
x: 0,
y: 0,
width: width,
- height: height
+ height: documentHeight
)
}
func reportTextHeight(for textView: NSTextView) {
+ let measuredHeight = measuredTextHeight(for: textView)
+ let documentHeight = max(textView.frame.height, measuredHeight)
+ if abs(textView.frame.height - documentHeight) > 0.5 {
+ textView.setFrameSize(CGSize(width: textView.frame.width, height: documentHeight))
+ }
+
+ parent.textHeightChanged(measuredHeight)
+ }
+
+ func reportExpansionState(for textView: NSTextView) {
+ let wrappedHeight = measuredTextHeight(
+ for: textView.string,
+ width: PointerPromptLayout.composerWrappingTextWidth
+ )
+ let shouldExpand = PointerPromptLayout.isComposerInputExpanded(
+ inputTextHeight: wrappedHeight
+ )
+ parent.expansionChanged(shouldExpand)
+ }
+
+ private func measuredTextHeight(for textView: NSTextView) -> CGFloat {
guard let layoutManager = textView.layoutManager,
let textContainer = textView.textContainer else {
- return
+ return PointerPromptLayout.composerInputTextMinimumHeight
}
layoutManager.ensureLayout(for: textContainer)
let usedRect = layoutManager.usedRect(for: textContainer)
- let measuredHeight = ceil(max(
+ return ceil(max(
+ PointerPromptLayout.composerInputTextMinimumHeight,
+ usedRect.height
+ ))
+ }
+
+ private func measuredTextHeight(for string: String, width: CGFloat) -> CGFloat {
+ guard !string.isEmpty else {
+ return PointerPromptLayout.composerInputTextMinimumHeight
+ }
+
+ let textStorage = NSTextStorage(
+ string: string,
+ attributes: ComposerTextStyle.attributes(color: .white, font: ComposerTextStyle.font)
+ )
+ let layoutManager = NSLayoutManager()
+ let textContainer = NSTextContainer(
+ containerSize: CGSize(width: width, height: .greatestFiniteMagnitude)
+ )
+ textContainer.lineFragmentPadding = 0
+ textContainer.widthTracksTextView = false
+ textContainer.heightTracksTextView = false
+ layoutManager.addTextContainer(textContainer)
+ textStorage.addLayoutManager(layoutManager)
+ layoutManager.ensureLayout(for: textContainer)
+ let usedRect = layoutManager.usedRect(for: textContainer)
+
+ return ceil(max(
PointerPromptLayout.composerInputTextMinimumHeight,
usedRect.height
))
- parent.textHeightChanged(measuredHeight)
}
}
}
diff --git a/docs/guides/pointer-prompt-overlay.md b/docs/guides/pointer-prompt-overlay.md
index ff92522f..df14c776 100644
--- a/docs/guides/pointer-prompt-overlay.md
+++ b/docs/guides/pointer-prompt-overlay.md
@@ -12,7 +12,7 @@ Donkey supports a floating macOS pointer prompt overlay:
- captures microphone audio while active and renders the waveform from recent live audio levels
- keeps the prompt modal pinned where activation happened until the user drags, dismisses, or closes the modal
- dismisses the active modal when the user clicks outside it
-- closes the active modal with a small gray circular x button outside the prompt surface at the top-right corner
+- closes the active modal with a small high-contrast circular x button outside the prompt surface at the top-right corner
- supports dragging the active modal from capsule areas outside the text input
- lets normal clicks pass through the inactive overlay and transparent active overlay space
- opens near the user mouse at a fixed 45-degree bottom-right diagonal
@@ -27,10 +27,11 @@ This is a visual and microphone-level UI capability. It does not capture the scr
- Donkey runs with the accessory activation policy, and prompt focus must make the app active, make the panel key, then make the composer text view first responder. A blinking insertion point alone does not mean macOS is sending keyboard events to the panel.
- SwiftUI rendering stays in `DonkeyUI`; it receives `PointerPromptState` and `PointerPromptPlacement` from `DonkeyContracts`.
- Product state stays in `PointerPromptOverlayModel`.
-- Treat the active modal as a compact black prompt surface with a text input, embedded waveform, and a small gray circular x button perched outside the surface at the top-right corner. It has no separate voice button.
+- Treat the active modal as a compact black prompt surface with a text input, embedded waveform, and a small high-contrast circular x button perched outside the surface at the top-right corner. It has no separate voice button.
- Single-line input should render as a full pill. Multiline input should render as a rounded rectangle with non-pill corners and a bottom toolbar matching the input background, containing the waveform without a divider between text and toolbar. The plus and permissions controls may remain available in code for future wiring, but should not render while non-functional.
- The text input should use 16pt light system UI text with ligatures disabled, matching thin `-apple-system` sans-serif web input rendering.
-- Text wraps at the prompt width. Return submits typed text. Shift-Return inserts a deliberate newline.
+- Text expansion is triggered from a stable pill-width measurement so reaching the single-line edge transitions cleanly without shape flicker. Expanded text uses balanced horizontal padding. Return submits typed text. Shift-Return inserts a deliberate newline.
+- Expanded text input grows to a bounded multiline height, then scrolls inside the composer so the waveform toolbar stays attached to the bottom of the prompt instead of being pushed off-screen.
- The controller owns microphone capture and publishes normalized audio levels into product state; SwiftUI only renders the levels it receives.
- The active prompt modal should use a capsule shape and keep transparent active overlay space passing clicks through to windows underneath after it dismisses.
- Agent pointer drawing and theme code may remain available for future features, but the prompt overlay should not render a visible cursor.
@@ -52,7 +53,7 @@ swift build
swift run Donkey
```
-Launch Donkey and confirm the inactive overlay does not render a visible cursor. Double-tap Command and release to show the black prompt capsule with keyboard focus, grant microphone permission if prompted, then speak or tap near the microphone and confirm the waveform responds to real audio levels. Type enough text to wrap and confirm the prompt changes from a pill into a rounded rectangle, grows downward while its top edge stays fixed, and moves the waveform into a blended bottom toolbar with no divider between the toolbar and text input. Press Shift-Return and confirm it inserts a newline; press Return and confirm it submits. Move the mouse and confirm the active modal stays pinned. Double-tap Command again but hold the second Command press, and confirm the same prompt modal appears. Click outside the active modal and confirm it dismisses. Reactivate, click the gray rounded x button outside the capsule, and confirm it closes. Drag the modal from non-input capsule areas. Activate near the bottom-right screen edge to confirm the prompt keeps the same fixed offset instead of flipping or clamping. Confirm Command plus another key, Command-click, and a single Command tap do not activate the modal.
+Launch Donkey and confirm the inactive overlay does not render a visible cursor. Double-tap Command and release to show the black prompt capsule with keyboard focus, grant microphone permission if prompted, then speak or tap near the microphone and confirm the waveform responds to real audio levels. Type enough text to wrap and confirm the prompt changes from a pill into a rounded rectangle, grows downward while its top edge stays fixed, and moves the waveform into a blended bottom toolbar with no divider between the toolbar and text input. Press Shift-Return and confirm it inserts a newline; press Return and confirm it submits. Move the mouse and confirm the active modal stays pinned. Double-tap Command again but hold the second Command press, and confirm the same prompt modal appears. Click outside the active modal and confirm it dismisses. Reactivate, click the high-contrast rounded x button outside the capsule, and confirm it closes and remains visible over light and dark app backgrounds. Drag the modal from non-input capsule areas. Activate near the bottom-right screen edge to confirm the prompt keeps the same fixed offset instead of flipping or clamping. Confirm Command plus another key, Command-click, and a single Command tap do not activate the modal.
## Source Entry Points