Skip to content

Open source CapCut alternative.

TypeScript

Align notch composer padding and guide policy

David Le0a5a7f437c30
diff --git a/AGENTS.md b/AGENTS.md
index b0ce4b65..e1b48996 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -24,7 +24,7 @@ Before changing `site/` UI, routes, API handlers, or data access patterns:
- Ask before creating any new plan document.
- Manage plans deliberately: move a plan to `plans/done/` when its work is complete, and create or keep plans only for work that remains.
- Over time, prefer shrinking active `plans/` by completing work and moving finished plans to `plans/done/`.
-- When a completed capability changes, update the relevant guide in `docs/guides/`.
+- Update guides in `docs/guides/` only for major features or durable supported-behavior changes. Do not update guide docs for small styling tweaks, layout adjustments, copy changes, or implementation-only refactors.
- When work completes a master-plan slice, update the master plan's supported/current-boundary language and next steps in the same change.
- Keep guides explanatory. Describe supported behavior, boundaries, and engineering intent; do not duplicate code or maintain long file inventories.
- Link to source paths only when a maintainer needs an entrypoint.
diff --git a/apps/Donkey/Sources/Donkey/PointerPromptOverlayController.swift b/apps/Donkey/Sources/Donkey/PointerPromptOverlayController.swift
index 8fce1fef..81edffef 100644
--- a/apps/Donkey/Sources/Donkey/PointerPromptOverlayController.swift
+++ b/apps/Donkey/Sources/Donkey/PointerPromptOverlayController.swift
@@ -755,7 +755,7 @@ final class PointerPromptOverlayController {
return NotchMetrics.expandedTaskContentHeight
}
- return model.notchCommandInputSurfaceHeight + NotchMetrics.compactCommandContentPadding
+ return model.notchCommandInputSurfaceHeight + NotchMetrics.compactCommandContentVerticalPadding
}
private var hasStatusTaskDisplayText: Bool {
@@ -1196,11 +1196,12 @@ private struct NotchMetrics {
private static let expandedContentDesignFrame = CGRect(
x: 0,
y: 0,
- width: PointerPromptLayout.composerInputSurfaceWidth + 48,
+ width: PointerPromptLayout.composerInputSurfaceWidth + Self.inputHorizontalMargin * 2,
height: 280
)
static let expandedTaskContentHeight: CGFloat = 280
- static let compactCommandContentPadding: CGFloat = 52
+ static let inputHorizontalMargin: CGFloat = 14
+ static let compactCommandContentVerticalPadding: CGFloat = 30
private static let collapsedSideLaneWidth: CGFloat = 34
private static let collapsedCornerRadius: CGFloat = 14
private static let expandedCornerRadius: CGFloat = 26
diff --git a/apps/Donkey/Sources/DonkeyUI/PointerPromptNotchStatusView.swift b/apps/Donkey/Sources/DonkeyUI/PointerPromptNotchStatusView.swift
index 8ef10aa6..669b253c 100644
--- a/apps/Donkey/Sources/DonkeyUI/PointerPromptNotchStatusView.swift
+++ b/apps/Donkey/Sources/DonkeyUI/PointerPromptNotchStatusView.swift
@@ -201,7 +201,6 @@ public struct PointerPromptNotchStatusView: View {
x: layout.expandedContentFrame.minX,
y: layout.expandedContentFrame.minY
)
- .clipped()
}
private var expandedTaskContent: some View {
@@ -210,17 +209,16 @@ public struct PointerPromptNotchStatusView: View {
expandedUpdateHeader
}
- ScrollView(.vertical, showsIndicators: false) {
- currentTaskRow
- .padding(.horizontal, 14)
- .padding(.top, 10)
- }
-
- Spacer(minLength: 8)
+ VStack(spacing: 0) {
+ ScrollView(.vertical, showsIndicators: false) {
+ currentTaskRow
+ .padding(.top, 10)
+ }
- commandRow
- .padding(.horizontal, 24)
- .padding(.bottom, 24)
+ commandRow
+ }
+ .padding(.horizontal, Self.contentInset)
+ .padding(.bottom, Self.contentInset)
}
}
@@ -231,10 +229,10 @@ public struct PointerPromptNotchStatusView: View {
}
commandRow
- .padding(.horizontal, 24)
.padding(.top, 16)
- .padding(.bottom, 24)
}
+ .padding(.horizontal, Self.contentInset)
+ .padding(.bottom, Self.contentInset)
}
private var expandedNotchArrow: some View {
@@ -484,6 +482,7 @@ public struct PointerPromptNotchStatusView: View {
.easeOut(duration: 0.3)
.delay(0.15)
private static let expandedContentDismissAnimation = Animation.easeOut(duration: 0.1)
+ private static let contentInset: CGFloat = 14
}
private struct TaskArrowMark: View {
diff --git a/apps/Donkey/Sources/DonkeyUI/PointerPromptStageView.swift b/apps/Donkey/Sources/DonkeyUI/PointerPromptStageView.swift
index 9d9d6e60..cca89626 100644
--- a/apps/Donkey/Sources/DonkeyUI/PointerPromptStageView.swift
+++ b/apps/Donkey/Sources/DonkeyUI/PointerPromptStageView.swift
@@ -145,7 +145,7 @@ struct PointerPromptComposer: View {
height: composerHeight,
alignment: .topLeading
)
- .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
+ .frame(maxWidth: .infinity, alignment: .topLeading)
}
@ViewBuilder
@@ -183,10 +183,10 @@ struct PointerPromptComposer: View {
.stroke(Color.white.opacity(0.34), lineWidth: 1)
}
.shadow(
- color: Color.black.opacity(state.isActive ? 0.2 : 0.08),
- radius: state.isActive ? 12 : 6,
+ color: surfaceShadowColor,
+ radius: surfaceShadowRadius,
x: 0,
- y: state.isActive ? 5 : 2
+ y: surfaceShadowY
)
.accessibilityElement(children: .contain)
}
@@ -226,10 +226,10 @@ struct PointerPromptComposer: View {
}
}
.shadow(
- color: Color.black.opacity(state.isActive ? 0.2 : 0.08),
- radius: state.isActive ? 12 : 6,
+ color: surfaceShadowColor,
+ radius: surfaceShadowRadius,
x: 0,
- y: state.isActive ? 5 : 2
+ y: surfaceShadowY
)
.accessibilityElement(children: .contain)
}
@@ -324,6 +324,18 @@ struct PointerPromptComposer: View {
toolbarStyle != .followUp
}
+ private var surfaceShadowColor: Color {
+ toolbarStyle == .followUp ? Color.black.opacity(0) : Color.black.opacity(state.isActive ? 0.2 : 0.08)
+ }
+
+ private var surfaceShadowRadius: CGFloat {
+ toolbarStyle == .followUp ? 0 : (state.isActive ? 12 : 6)
+ }
+
+ private var surfaceShadowY: CGFloat {
+ toolbarStyle == .followUp ? 0 : (state.isActive ? 5 : 2)
+ }
+
var composerHeight: CGFloat {
if usesExpandedSurface {
return max(