Skip to content

👾 Open Computer Use – Open-Source Alternative to Codex Computer Use

Polish standalone cursor lab panels

Leo003f344cbc55
diff --git a/docs/exec-plans/active/20260418-standalone-cursor-lab.md b/docs/exec-plans/active/20260418-standalone-cursor-lab.md
index 7d6917b..7cd0ae9 100644
--- a/docs/exec-plans/active/20260418-standalone-cursor-lab.md
+++ b/docs/exec-plans/active/20260418-standalone-cursor-lab.md
@@ -80,6 +80,9 @@
- 2026-04-20:继续收紧 `SPRING`;当前它明确表示 progress spring 的 `response / damping` 与 endpoint-lock 时间,默认 `spring=0.5` 会精确回到官方 `.official` 配置。采样下,`spring=0.25 / 0.5 / 0.75` 分别对应约 `1.0958s / 1.4292s / 1.8750s` 的 endpoint-lock,语义已经收成稳定的“左快右慢”。
- 2026-04-20:修正 `ARC FLOW` 首轮实现引入的中段“节点感”;问题不在 `SPRING`,而在那版显式中间锚点的双段曲线把路径本身做出了 join,叠加 debug overlay 又把这个中点强调出来。当前已经收回到单段 cubic,相位控制继续保留,但几何上不再存在中间 join。
- 2026-04-20:继续修正 slider 调参状态流;当前已把“当前 cursor 位置”和“当前会话的 reference path”拆开,slider 重算时用最近一次真实 move 的 origin / startRotation + `queuedTarget` 更新整条调试曲线,同时只把 cursor snap 在当前位置,因此 settled 后调参也不会把 DEBUG 线重建成 `target -> target` 的零长度路径。
+- 2026-04-20:继续收口右上角控件;当前只保留 `DEBUG` 一个 switch,`MAIL` / `CLICK` 已移除,click pulse 默认常开,同时把 switch 的 on/off 底色拉开到和左侧 slider 一致的高对比语义。
+- 2026-04-20:继续收口左右 panel 的容器样式;当前左上 slider 面板和右上 `DEBUG` 面板已经统一复用同一套 card shell,不再分别维护不同的 padding / frame 包装。
+- 2026-04-20:继续修正 panel 在浅背景上的识别度;当前 card fill 已收成更实的灰白底,并加强描边和阴影,减少背景渐变直接透到 panel 上导致的“看起来像不同底色”问题。
## 决策记录
diff --git a/docs/histories/2026-04/20260418-1430-standalone-cursor-lab.md b/docs/histories/2026-04/20260418-1430-standalone-cursor-lab.md
index 0a03f8f..bb962ca 100644
--- a/docs/histories/2026-04/20260418-1430-standalone-cursor-lab.md
+++ b/docs/histories/2026-04/20260418-1430-standalone-cursor-lab.md
@@ -283,6 +283,45 @@
- `experiments/StandaloneCursorLab/README.md`
- `docs/exec-plans/active/20260418-standalone-cursor-lab.md`
+### 🔁 Follow-up (2026-04-20, simplify top-right debug controls)
+**Scope:** `experiments/StandaloneCursorLab/`、`docs/`
+
+**Key Actions:**
+- **[移除多余 toggle]**: 右上角只保留 `DEBUG` switch,`MAIL` / `CLICK` 的本地测试开关已移除,避免和左上角参数面板一起制造额外噪音。
+- **[click pulse 改为默认常开]**: 点击 pulse 继续跟随当前 move 状态显示,不再额外受 UI toggle 控制,避免为了删控件还保留一条无意义状态分支。
+- **[拉开开关视觉差]**: `DEBUG` switch 的开启态改成左侧 slider 同款 accent 渐变,关闭态收成浅灰底和深色 knob,避免两档底色太接近看不出切换状态。
+
+### 📁 Additional Files Modified
+- `experiments/StandaloneCursorLab/Sources/StandaloneCursorLab/CursorLabRootView.swift`
+- `experiments/StandaloneCursorLab/README.md`
+- `docs/exec-plans/active/20260418-standalone-cursor-lab.md`
+
+### 🔁 Follow-up (2026-04-20, reduce background gradient bleed through panel cards)
+**Scope:** `experiments/StandaloneCursorLab/`、`docs/`
+
+**Key Actions:**
+- **[收紧 card 底色]**: `CursorPanelBackground` 不再使用偏透明的浅灰渐变,而是收成更实的灰白卡片底,减少底层 BG 渐变直接把 panel 染成不同色相。
+- **[加强边界识别]**: 卡片描边和阴影同步加强,让左上 slider 面板即使落在偏灰白的背景区里,也能和页面底色拉开层次。
+- **[同步文档口径]**: README 和 active plan 现在都明确写成“更实的灰白卡片”,避免继续把 panel 理解成半透明浮层。
+
+### 📁 Additional Files Modified
+- `experiments/StandaloneCursorLab/Sources/StandaloneCursorLab/CursorLabRootView.swift`
+- `experiments/StandaloneCursorLab/README.md`
+- `docs/exec-plans/active/20260418-standalone-cursor-lab.md`
+
+### 🔁 Follow-up (2026-04-20, align top-left and top-right panel shells)
+**Scope:** `experiments/StandaloneCursorLab/`、`docs/`
+
+**Key Actions:**
+- **[统一 panel 外壳]**: 左上 slider 面板和右上 `DEBUG` 面板现在都改成复用同一个 `CursorPanelShell`,统一内边距、圆角、描边和阴影,避免继续靠两套近似但不完全一致的容器样式拼出来。
+- **[收掉重复包装代码]**: 原来左右两边各自写的 `padding + background` 容器已合并,后续如果继续调 panel 外观,只需要改一处。
+- **[同步文档口径]**: README 和 active plan 补充这次 panel shell 对齐,明确左右控件区现在属于同一套视觉组件。
+
+### 📁 Additional Files Modified
+- `experiments/StandaloneCursorLab/Sources/StandaloneCursorLab/CursorLabRootView.swift`
+- `experiments/StandaloneCursorLab/README.md`
+- `docs/exec-plans/active/20260418-standalone-cursor-lab.md`
+
### 🔁 Follow-up (2026-04-20, apply start/end handle semantics from slider investigation)
**Scope:** `experiments/StandaloneCursorLab/`、`docs/`
diff --git a/experiments/StandaloneCursorLab/README.md b/experiments/StandaloneCursorLab/README.md
index c5efa70..03a089e 100644
--- a/experiments/StandaloneCursorLab/README.md
+++ b/experiments/StandaloneCursorLab/README.md
@@ -39,6 +39,8 @@ swift run StandaloneCursorLab
- 点击画布任意位置,先预览当前 heading-driven candidate 族,再自动选一路径并驱动 cursor 过去。
- 左上角保留 `START HANDLE`、`END HANDLE`、`ARC SIZE`、`ARC FLOW`、`SPRING` 5 个 slider,面板本身不再附带 `REPLAY` / `RESET` 按钮或额外指标文案,便于直接对照当前轨迹和画面观感。
+- 右上角现在只保留 `DEBUG` 一个 switch;`MAIL` / `CLICK` 已移除,click pulse 默认始终跟随当前 move 状态显示,不再单独暴露测试开关。
+- 左右两个角上的 panel 现在已经收成同一套更实的灰白卡片容器:相同的内边距、圆角、描边和阴影,并且降低了底层背景渐变透出来的程度,避免浅色区域里卡片边界发虚。
- slider 调参时会重算当前 session 的整条 reference path,同时保持 cursor 本体停在当前位置;因此 `DEBUG` 开着时,settled 后继续拖 slider 也还能看到完整曲线反馈,不会退化成零长度路径。
- `START HANDLE` 现在优先改变起步段的 guide / reach / normal 偏置,`END HANDLE` 则优先改变收尾段的 guide / reach / normal 偏置;两者不再只是一起放大整条曲线。
- `ARC SIZE` 现在明确表示轨迹弧度本身,不是 cursor glyph 的尺寸;它会同时改变弧高/控制点侧向偏移,以及 chooser 对更直路径和更宽弧线路径的偏好。
@@ -46,6 +48,7 @@ swift run StandaloneCursorLab
- `SPRING` 现在明确表示 progress spring 本身的快慢与阻尼,不再叠加额外 distance-based duration fudge;`0.5` 档会精确回到官方 `response=1.4`、`damping=0.9`、`343/240` endpoint-lock 时间,往左更快,往右更慢。
- debug overlay 会显示控制点、arc handle 和当前选中的 candidate id / score。
- 关闭 `DEBUG` 后不会展示任何轨迹线或目标点,只保留 cursor 本体,便于单独观察最终运动观感。
+- `DEBUG` switch 的开启态现在直接复用左侧 slider 的 accent 渐变,关闭态则收成浅灰底,避免开关两档的底色过近、肉眼不容易分辨。
- lab 主线不再直接复用 raw binary lift 的 `20` 条 candidate + score;当前改为 reverse-engineering 约束下的 heading-driven chooser,把起始朝向和最终 resting pose 一起喂给路径选择器,让默认曲线更稳定收敛到单侧 C 形或近直线。
- 主路径进度不再用 speculative `easeInOut` 或 terminal settle;现在直接复用官方风格 spring progress。
- 默认档的 wall-clock move 时长现在直接对齐 reverse-engineered 官方 endpoint-lock 时间 `343 / 240 = 1.4291667s`;不再额外按路径距离压缩时长。
diff --git a/experiments/StandaloneCursorLab/Sources/StandaloneCursorLab/CursorLabRootView.swift b/experiments/StandaloneCursorLab/Sources/StandaloneCursorLab/CursorLabRootView.swift
index 1e87733..ad6472f 100644
--- a/experiments/StandaloneCursorLab/Sources/StandaloneCursorLab/CursorLabRootView.swift
+++ b/experiments/StandaloneCursorLab/Sources/StandaloneCursorLab/CursorLabRootView.swift
@@ -17,8 +17,6 @@ struct CursorLabRootView: View {
@State private var end = CGPoint(x: 860, y: 260)
@State private var motionParameters = CursorMotionParameters.default
@State private var debugEnabled = true
- @State private var mailEnabled = false
- @State private var clickEnabled = true
@StateObject private var model = CursorLabViewModel()
var body: some View {
@@ -30,7 +28,6 @@ struct CursorLabRootView: View {
start: $start,
end: $end,
debugEnabled: debugEnabled,
- showClickPulse: clickEnabled,
model: model
)
.onAppear {
@@ -67,7 +64,7 @@ struct CursorLabRootView: View {
}
private var controlPanel: some View {
- VStack(alignment: .leading, spacing: 12) {
+ CursorPanelShell(alignment: .leading) {
CursorParameterSliderRow(
title: "START HANDLE",
value: $motionParameters.startHandle
@@ -89,16 +86,11 @@ struct CursorLabRootView: View {
value: $motionParameters.spring
)
}
- .padding(.horizontal, 16)
- .padding(.vertical, 14)
- .background(CursorPanelBackground())
}
private var togglePanel: some View {
- VStack(alignment: .trailing, spacing: 12) {
+ CursorPanelShell(alignment: .trailing) {
CursorToggleRow(title: "DEBUG", isOn: $debugEnabled)
- CursorToggleRow(title: "MAIL", isOn: $mailEnabled)
- CursorToggleRow(title: "CLICK", isOn: $clickEnabled)
}
}
@@ -372,7 +364,6 @@ private struct CursorLabCanvas: View {
@Binding var start: CGPoint
@Binding var end: CGPoint
let debugEnabled: Bool
- let showClickPulse: Bool
@ObservedObject var model: CursorLabViewModel
var body: some View {
@@ -394,7 +385,7 @@ private struct CursorLabCanvas: View {
fogOffset: model.currentState.fogOffset,
fogOpacity: model.currentState.fogOpacity,
fogScale: model.currentState.fogScale,
- clickPulse: showClickPulse ? model.clickPulse : 0
+ clickPulse: model.clickPulse
)
.position(model.currentState.point)
.allowsHitTesting(false)
@@ -696,8 +687,8 @@ private struct CursorPanelBackground: View {
.fill(
LinearGradient(
colors: [
- CursorLabPalette.mainSoft.opacity(0.82),
- CursorLabPalette.main.opacity(0.72),
+ Color(red: 0.975, green: 0.976, blue: 0.982).opacity(0.97),
+ Color(red: 0.915, green: 0.918, blue: 0.932).opacity(0.94),
],
startPoint: .topLeading,
endPoint: .bottomTrailing
@@ -705,9 +696,42 @@ private struct CursorPanelBackground: View {
)
.overlay {
RoundedRectangle(cornerRadius: 26, style: .continuous)
- .stroke(Color.white.opacity(0.30), lineWidth: 1)
+ .fill(
+ LinearGradient(
+ colors: [
+ Color.white.opacity(0.30),
+ Color.white.opacity(0.06),
+ CursorLabPalette.ink.opacity(0.03),
+ ],
+ startPoint: .topLeading,
+ endPoint: .bottomTrailing
+ )
+ )
}
- .shadow(color: CursorLabPalette.ink.opacity(0.10), radius: 20, y: 8)
+ .overlay {
+ RoundedRectangle(cornerRadius: 26, style: .continuous)
+ .stroke(Color.white.opacity(0.56), lineWidth: 1)
+ }
+ .overlay {
+ RoundedRectangle(cornerRadius: 26, style: .continuous)
+ .stroke(CursorLabPalette.ink.opacity(0.06), lineWidth: 0.8)
+ }
+ .shadow(color: CursorLabPalette.ink.opacity(0.12), radius: 22, y: 10)
+ .shadow(color: Color.white.opacity(0.16), radius: 8, y: -1)
+ }
+}
+
+private struct CursorPanelShell<Content: View>: View {
+ let alignment: HorizontalAlignment
+ @ViewBuilder let content: Content
+
+ var body: some View {
+ VStack(alignment: alignment, spacing: 12) {
+ content
+ }
+ .padding(.horizontal, 16)
+ .padding(.vertical, 14)
+ .background(CursorPanelBackground())
}
}
@@ -735,14 +759,53 @@ private struct CursorToggleStyle: ToggleStyle {
func makeBody(configuration: Configuration) -> some View {
RoundedRectangle(cornerRadius: 10)
- .fill(configuration.isOn ? accent : CursorLabPalette.ink.opacity(0.18))
+ .fill(
+ configuration.isOn
+ ? AnyShapeStyle(
+ LinearGradient(
+ colors: [CursorLabPalette.accent, CursorLabPalette.accentSoft],
+ startPoint: .leading,
+ endPoint: .trailing
+ )
+ )
+ : AnyShapeStyle(
+ LinearGradient(
+ colors: [
+ CursorLabPalette.mainSoft.opacity(0.96),
+ CursorLabPalette.mainMuted.opacity(0.88),
+ ],
+ startPoint: .leading,
+ endPoint: .trailing
+ )
+ )
+ )
.frame(width: 38, height: 20)
+ .overlay {
+ RoundedRectangle(cornerRadius: 10)
+ .stroke(
+ configuration.isOn
+ ? CursorLabPalette.accentSoft.opacity(0.38)
+ : CursorLabPalette.ink.opacity(0.10),
+ lineWidth: 1
+ )
+ }
.overlay(alignment: configuration.isOn ? .trailing : .leading) {
Circle()
- .fill(Color.white)
+ .fill(configuration.isOn ? Color.white : CursorLabPalette.ink.opacity(0.72))
.frame(width: 15, height: 15)
+ .overlay {
+ Circle()
+ .stroke(Color.white.opacity(configuration.isOn ? 0.40 : 0.12), lineWidth: 1)
+ }
.padding(2)
}
+ .shadow(
+ color: configuration.isOn
+ ? CursorLabPalette.accent.opacity(0.18)
+ : CursorLabPalette.ink.opacity(0.04),
+ radius: configuration.isOn ? 10 : 5,
+ y: 3
+ )
.contentShape(Rectangle())
.onTapGesture {
configuration.isOn.toggle()