Repository navigation
fix: hand the keyboard to the document when ⌘E brings Files back - #1541
Merged
Merged
Conversation
yansfil
added a commit
that referenced
this pull request
Oct 22, 2026
…cord states (#1565) Related: #1548 ## Summary After #1548 the session record still showed what the agent last said, even when Hide already knew better: a flow whose pull request had merged still read "CI 기다림", a flow the operator moved on from still read as a question, and a past flow's questions stayed in `나를 기다리는 것`. Now Hide's own facts win where they are newer: - a flow whose pull requests all merged or closed after its last line reads `머지됨 #n` / `닫힘` with the time, and the top state does the same for its own flow (a question, block or limit stays); - a flow the operator moved on from shows the one line the label gave as it closed (`context_label.v21`, `closed_result`), else `넘어감` with its last line; - moving to the next flow answers the questions before it; - the record is named after the flow the operator asked most in, while the pane keeps the current flow's name. Before (left) and after (right), gallery `SessionWork` facts case: the first flow reads `머지됨 #1541` instead of a wait, the second `넘어감`, the third shows its closing line, and the top state reads merged.   ## Review - **판단해 주세요**: the closing line is an AI line; it replaces the flow's last turn line even when that turn ended `끝` (eval: 3 of the 18 wrong items in this PR's view are closing lines). Keep it, or show it only for flows that ended on a question or wait? - **판단해 주세요**: the record title is now the largest flow's name everywhere `record.title` is read (record header, backlog origin, search), while the sidebar keeps the current flow's. - **조심해서 볼 파일**: `herdr-core/src/links/ledger_store.rs` (`settle`, `place_flows`, the ask repeat check) - the record read runs on the link worker, not under the runtime mutex; the outputs query adds one indexed `prs` lookup per output row. - **조심해서 볼 파일**: `herdr-core/src/links/store.rs` - link store schema 7 -> 8 (`ledger_chapters.closed_result`); an older build refuses the newer file, as with 7. - **조심해서 볼 파일**: `herdr-core/src/labels/context_label.rs` - label contract v21: `closed_result` required in both schemas, kept only on `replace`, a control character drops the line alone. ## Evidence - **확인한 것**: same 21 real sessions as #1548, each scored by fresh independent scorers with the three views (old record, #1548, this PR) unlabeled in one pass, 7 scorers, rubric unchanged: | | 누락 | 틀림 | 읽기 편함 | 경계 맞음/틀림 | |---|---|---|---|---| | 옛 기록 | 78 | 40 | 2.19 | - | | #1548 | 42 | 25 | 3.62 | 32/16 | | 이 PR | 39 | 18 | 3.86 | 34/14 | - Targets: 틀림 <= 20 met; 운영자 요청 누락 0 met; 경계와 읽기 편함 not worse met. - 누락 <= 35 missed (39). 옛 기록보다 틀린 세션 0 missed (3): flow boundaries, one translated product name, and backlog lines outside the record; none comes from the result, status or ask rules here. - A first turn of a new flow re-listed a past flow's question word for word in 4 of 56 cases; none was scored wrong. - **확인한 것**: `cargo test -p herdr-core` links and labels suites (new tests for settled flows, the top state's own-flow scope including a child's PR and a turn spanning two flows, closing lines, moved-on, asks closed by the next flow and kept dismissed, the title); `SessionRecord.test.tsx` 25 tests; `tsc`; `node scripts/check-design-contract.mjs`; CI `rust workspace` green on the final head. - **확인하지 못한 것**: - The record e2e (`session-work-ledger.spec.ts`) was not run locally (its fixture setup stalled on this machine); it passes in CI on Linux, macOS and Windows. Its fixture now merges the pull requests 3 s after creation and waits for the stored merge times, so the merged result no longer races the flow's line. - Local `sasu implement verify` did not pass for machine reasons, so CI stands in: the test suite hit the 600 s cap at load average ~29, then one run failed `hide-session` `usage_opencode_refuses_oversized_identifiers_before_materializing_them` (a crate this PR does not touch; it passed 5 of 5 alone and passes in CI). Lint passed every time. - No native app check; nothing installed. - A continuation turn with no new request keeps the ledger's first judgment, so a status can stay stale until the next request; this is outside the contract and is a follow-up. <details><summary>추가 증거</summary> Dark theme, same case:   Review rounds: Fidelity (B2 scope, B6 guard) and Code review (e2e expectation, v20 references, dismissed-ask test, child rows, indexed lookup, closing-line refusal, Japanese wording) fixed in 1acbad8; follow-up review found no fix-now defects, and its follow-ups (turn placement, count-free example) are fixed in 4cae0a8 and aab9e6e. </details> ## Breaking change - Link store schema 8: a Hide build from before this PR refuses the link store this one writes, so going back needs the matching state folder. - Label contract `context_label.v21`: answers from v20 are not read as v21. <details><summary>Verification record</summary> </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
⌘E로 오른쪽 Lane을 다시 열면 파일이 보이는데 키보드는 터미널에 남아 있어서, 바로 타이핑하거나 ⌘S·⌘W를 누르면 파일이 아니라 터미널에 갔습니다.
이제 ⌘E가 Files를 view와 함께 다시 열면 키보드가 그 활성 View area의 문서(또는 페이지)로 갑니다. 파일을 열 때 키보드가 따라가는 것과 같은 경로(
followFocus)를 씁니다.다른 도구(Memory, PRs, Changes)나 view 없는 Files로 돌아올 때는 키보드를 그대로 둡니다.
스크린샷 없음: 포커스만 옮기는 변경이라 화면 모양은 같고, e2e가 편집기 포커스를 직접 확인합니다.
Review
web/src/actions.ts-toggleLane이 Files일 때 활성 area로 포커스 요청을 남깁니다. 요청은ViewAreas.tsx가 소비하고, 그 사이 키보드가 다른 곳으로 옮겨졌으면 무시됩니다.Evidence
⌘E bringing Files back with a view hands the keyboard to that view's document: 파일 열기, ⌘E로 닫기, 터미널 포커스, ⌘E, 편집기.cm-content포커스. 수정 전 코드에서는 실패, 수정 후 통과.bash scripts/verify-web.sh(web+desktop typecheck, lint, unit) 통과,web e2e lane-last-tool close-policy통과.