Clicking a recent-commit row now toggles an inline 里程碑详情 detail card
under the row (TS HistoryMilestoneRow) instead of tearing the whole panel
into a full-screen commit diff. The card carries 恢复 (restore the tracked
doc to that commit) + 复制哈希 (copy the hash to the clipboard) buttons.
Cross-layer:
- op-editor-core: GitPanelState.expanded_commit + GitPanelAction::{RestoreCommit,CopyHash}
- op-editor-ui: GitPanelHit::{RestoreCommit,CopyCommitHash}; paint inserts the
card between rows and pushes later rows + panel height down by CARD_H, with
expand_offset_before/expanded_card_extra/ready_commit_card_buttons keeping
paint and hit-test in lockstep (proven by a new geometry test).
- op-host-native: row click toggles expanded_commit; card buttons emit actions
- op-host-desktop: RestoreCommit runs repo.restore via run_reloading_git_op;
CopyHash writes the OS clipboard; the card collapses when the log changes
Deferred (Phase 2): autosave kind/grouping, the semantic inline diff summary.
Pull/push always looked enabled. Plumb the ahead count (op-git status
already computes it) onto GitPanelState via the host snapshot, and gate the
buttons in paint AND hit-test: pull needs a remote + no in-flight op; push
also needs ahead > 0 (TS pullDisabled=!hasRemote||busy, push adds ahead===0).
has_remote derives from the existing remotes list.
TS create mode has no section header and shows ghost Cancel + primary Create.
Rust painted a 新建分支 header and only a Create button (Escape-only cancel).
Remove the header for Create mode, start the input near the popover top, and
add a ghost Cancel button (→ BranchPickerCancel) left of Create.
git_panel_ready: branch chip GitBranch 14→12, label 13→12, chevron 10→12;
pull/push arrows 14→12 with full foreground (enabled) / muted-foreground
(disabled) instead of 0.80/0.50 alpha; milestone button font 12→11, gap 5→4,
icon stroke 1.8→2.0. git_panel_menus: merge header now 合并到 {branch}
(git.branch.mergeHeading) not the generic action label, and merge rows use a
ChevronRight glyph (TS branch-row) instead of GitBranch.
The panel read flat / cramped vs TS because of container-level gaps, not the
widgets: width 320→420 (TS w-[420px]), add a shadow-md drop shadow (two soft
black rects) so it lifts off the canvas, and corner radius 10→6 (TS
rounded-md). Placement tests still pass (caret anchoring relative to width).
The Enter guard keyed off branch_picker_open/overflow_open alone, so a
stale flag while the panel was closed / loading / merging / showing a diff
would wrongly eat the global Enter. Add git_ready_popover_open() (panel
open + ready view + a popover flag) and guard on it instead.
The inline 新建分支 name input painted a static '|' and the host never woke
the loop for branch_create_focused, so the caret sat frozen. Blink it on the
shared commit-caret cadence (paint_menu_input), wake next_animation_deadline
for branch_create_focused, and seed/reset commit_caret_anchor_ms on focus +
keypress so it starts solid then blinks.
In list / merge mode (and the overflow menu) no input is focused, so Enter
skipped every input handler and fell through to the global chat send. Guard
it: while either ready-state popover is open, Enter is consumed (focused
inputs still submit via the handlers above).
A stale commit/remote/https focus could still route text + Enter to the
hidden input while the branch-picker dropdown was open (firing a hidden
commit / set-remote / login). Gate the three focus helpers on
!branch_picker_open so those inputs are inactive whenever the dropdown is
showing; focus resumes when it closes.
A stale focused Git input (commit / remote / https) could intercept the
merge-mode Escape, because the sub-mode handler ran after the input
defocus handlers. Move the sub-mode Escape ahead of them so create/merge
always exits to the branch list on the first Escape.