Files
pebrel/scripts/probe_ssh_connect.ps1
T
kuddev 2c35799643 feat: 输入框光标模型下沉到组件层,SSH 编辑器对齐原型
在此之前每个输入框只有一个"是否全选"的 bool,光标恒画在文本末尾——
模型里根本没有"光标在哪"这个概念,所以点不了、拖不了、方向键无处可去。
这类能力是输入框的地板不是天花板,因此落在 `ui/text_field.rs`:命中
换算与渲染共用同一个起点和格宽,两边各算一次必然在全角字符和居中字段
上漂移,而漂移几像素恰恰最难被报告、也最伤手感。

配色这轮追出两个根因,都不是参数写错:

- `push_stroke` 画的是**实心**圆角矩形,靠调用方随后的填充盖住中心才
  形成"环"。`panel`/`input` 不透明盖得住,而 `card`/`surface` 只有
  4~8% 不透明度盖不住——描边色渗满整块,把卡片和按钮压深一整档。实测
  Nebula 深色的分组卡片因此成了 (62,65,74),原型是 (56,61,73)。新增
  `surface::over` 把叠加色与底色预合成,`push_group` 一个 quad 画完。
- 深色浮层底改从 `shell_bg` 提亮,不再从 `term_bg`。旧注释的理由是
  "浮层要比内容层亮",方向对、起点错:Nebula 外壳比终端亮 20,从终端
  起跳的浮层落在 (29,31,40),比它实际漂浮的那张外壳还暗 5 级。

分段选中片改回两个主题共用 `panel`。前两轮按"选中片必须比轨道亮"去分
主题,那条规则本身是错的——原型深色下选中片比轨道暗 18 级(按进去),
浅色下比轨道亮(浮起来),方向相反但对比都成立。同一个语义就该同一个
token。

顺带修掉一个多实例竞态:`ai_hook` 的原子写用固定临时文件名,两个
Nebula 同时自愈 `settings.json` 时后者 rename 扑空,报出一句"系统找不到
指定的文件"——指的却是那个临时文件,读起来像 settings.json 不见了。

`display/mod.rs` 8562 → 7974 行,SSH 交互层按 Warp 的 model/view/input
三分拆出 `ssh_editor_input.rs`。

506 passed。
2026-07-31 19:21:55 +08:00

51 lines
2.0 KiB
PowerShell

# Isolated probe instance for the SSH connect card.
#
# One APPDATA isolates every mutable file, mux.port included -- without that
# the launch just pings the existing instance and exits, so no new window.
# USERPROFILE / CLAUDE_CONFIG_DIR / CODEX_HOME / XDG_CONFIG_HOME are isolated
# too, so the AI hook self-heal cannot rewrite the real user config.
#
# NOTE: comments must stay pure ASCII. Windows PowerShell 5.1 reads a BOM-less
# UTF-8 script as ANSI (GBK here), which corrupts non-ASCII bytes and breaks
# the parser -- same trap as .cmd files.
param([switch]$Kill)
$root = 'D:\temp_build\.probe-ssh'
if ($Kill) {
Get-Process nebula -ErrorAction SilentlyContinue |
Where-Object { $_.Path -like '*\target\debug\nebula.exe' } |
Stop-Process -Force
return
}
Remove-Item -Recurse -Force $root -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path "$root\appdata\Nebula", "$root\home" | Out-Null
# saved_hosts is what actually populates the sidebar list; pinned_hosts only
# reorders it (see merge_ssh_hosts). Writing as ASCII on purpose: PS 5.1's
# -Encoding UTF8 emits a BOM, and the BOM would end up glued to the first key
# so the settings parser would never match it.
#
# 192.0.2.1 is RFC 5737 TEST-NET-1 and unroutable: the connection sits in the
# Connect stage for a long time, which is exactly what we need to watch the
# particles. 127.0.0.1 has no sshd here, so it fails fast -- that covers the
# failure state.
$settings = @(
'saved_hosts=root@192.0.2.1,root@127.0.0.1',
'pinned_hosts=root@192.0.2.1',
'keep_session=false'
) -join [Environment]::NewLine
Set-Content -Path "$root\appdata\Nebula\nebula_settings.txt" -Value $settings -Encoding ascii
$env:APPDATA = "$root\appdata"
$env:USERPROFILE = "$root\home"
$env:CLAUDE_CONFIG_DIR = "$root\home\.claude"
$env:CODEX_HOME = "$root\home\.codex"
$env:XDG_CONFIG_HOME = "$root\home\.config"
$env:NEBULA_DEBUG_LOG = '1'
$exe = 'D:\temp_build\nebula\target\debug\nebula.exe'
$proc = Start-Process -FilePath $exe -PassThru
Write-Output ("pid=" + $proc.Id)