Commit Graph
10 Commits
Author SHA1 Message Date
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
kuddev b795ebbc85 feat: live carets, one-chip keycaps, aligned path column, enforced UI contract
The visual work and the reason the visual work kept regressing, in one pass.

Picker and palette
- Rows drop their card borders: a row is transparent until hover/selection.
  Five ringed white rectangles in a column read as a form, not a list, and
  the panel-to-row lightness difference already separates them.
- Option paths start at one shared column instead of being right-aligned.
  Right alignment floated every row's path START with its own length
  (cmd.exe began ~300px right of Nushell's), so scanning meant hunting
  left and right per line.
- Footer hints drop their chips. A chip background means "clickable" here;
  the arrow/Enter/Esc legends aren't buttons, so key and description
  separate by ink weight instead.

Keycaps go back to one chip per combination
Per-key chips are a macOS form, where the modifiers are single-character
glyphs that tile evenly. Ctrl/Shift/Alt are words, so splitting produced a
row of ragged blocks; and Windows users already read Ctrl+Shift+P as one
string in VS Code and Office.

Carets that look alive
The blink phase hung off the wall clock, so a field taking focus had a 50%
chance of showing its caret up to half a second late — which reads as "not
focused". Phase now starts at the last edit: lit immediately, steady while
typing, breathing only after the hand stops, at the system's
GetCaretBlinkTime (including the accessibility setting that disables
blinking). The palette was also missing from the fast-redraw list, so its
caret froze once the open animation ended. The palette caret is now a
1.5px beam rather than a full-cell glyph, which lets placeholder and real
input share one x — the first keystroke no longer shifts the line.

Overlays share one recipe
Confirm dialogs and the SSH editor gain a real drop shadow and the common
radius; both previously drew hairline + fill only, so a dialog demanding an
answer floated lower than the palette you dismiss with Esc. The SSH
editor's dim was a hard-coded 67% black ignoring the theme. Dropdowns cast
a shadow instead of a glow (a glow spreads brightness without establishing
height) and are opaque, since a menu sits directly on the content it hides.

Why this kept regressing
ui/mod.rs has said "layer contract: no magic numbers" for a while, and
widgets.rs violated it — a constraint expressed only in a comment is not a
constraint. ui/guardrails.rs turns three of them into failing tests, each
carrying a budget equal to today's real count: new violations fail the
build, and clearing old ones fails it too until the budget is lowered, so
the number only goes down. This pass: radius 121 -> 94, strokes 69 -> 56,
glow-as-shadow 12 -> 9.

Probe script now runs a COPY of the debug binary. Running the build output
directly makes the next cargo build die with an opaque mingw link error,
and it invites cleaning up by image name — which would kill the user's own
window, possibly the one hosting this session.
2026-07-29 20:39:37 +08:00
kuddev 0c4f0515ae feat: card-based shell picker with Ctrl+K, unified keycaps and overlay skin
- Ctrl+K opens/closes the shell picker (new ToggleShellPicker action, listed
  and rebindable in Settings -> Key bindings). It takes over the shell's
  kill-line by default.
- The picker is now a card list: a "Recommended" hero card (name, full program
  path, Enter chip) plus uniform "All options" cards. PaletteLayout exposes
  per-row rects and `row_at`, so hover and click stop lighting up section
  captions and the gaps between cards -- both passes and hit-testing read one
  geometry instead of dividing by row_h.
- One keycap recipe (display/keycap.rs) shared by the picker's Ctrl+K badge,
  the command list's shortcut hints, Settings key rows, confirm dialogs and
  the picker footer. Combos split per key; confirm keycaps no longer restack
  the button's own fill.
- Light-theme overlays go white-based instead of inheriting a silver fill from
  the theme family.
- The palette's right edge measures from a single GUTTER instead of four
  different insets; the footer measured from the panel rather than the card
  column, which left a ragged margin that drifted with font size.
2026-07-29 12:14:28 +08:00
kuddev 7ef5b8ccf9 feat: workspace export/import with split-tree session restore; fix oversized startup window
Session v4 doubles as the workspace file format: tabs persist their full
split tree, per-pane cwds and launch identity (shell/profile/SSH), so both
crash recovery and exported workspaces rebuild real layouts.

Startup now always sizes the window from the config base font at the
standard 116x30 grid: the persisted Ctrl+wheel zoom no longer inflates the
first frame, and the saved window size/maximized state is write-only.
2026-07-25 21:33:49 +08:00
kuddev 0b974b5441 fix: cursor style application, math overlay backing and sizing, combobox overlap; add update check 2026-07-24 16:27:58 +08:00
kuddev 6ca0f8b8aa chore: prepare v0.6.0 release 2026-07-19 18:55:42 +08:00
kuddev 67de759252 feat: integrate transactional Lua configuration 2026-07-15 23:29:11 +08:00
kuddev 9a86561a06 feat: add font reminder and slim release builds 2026-07-15 14:18:33 +08:00
kuddev a50b49dd89 feat: add SSH key auth, SFTP, Git pull and packaging 2026-07-15 13:46:06 +08:00
kuddev 6f104206b7 Nebula Terminal 0.2.1 2026-07-11 13:04:59 +08:00