Show proposals in the code: ghost cursor, rationale tooltip, accept/reject CodeLens - #74
Merged
Merged
Conversation
조사에서 확정한 Phase 2 의 남은 셋이다. 지금까지 제안은 오른쪽 카드에만
있었다. 무엇이 왜 바뀌는지 보려면 코드에서 눈을 떼야 했고, 바꿀지 말지도
거기서만 눌렀다. 설계(DESIGN.md 2.1~2.2)가 적어 둔 자리는 바뀌는 그 줄이다.
유령 커서 — editAnimator 가 타이핑하는 정확한 글자 자리에 길이 0 데코레이션의
가짜 요소로 캐럿을 그린다. 폭이 0 이라 글자를 밀지 않는다. 줄 하이라이트만으로는
긴 줄에서 눈이 어디를 따라가야 할지 알 수 없다. 모션을 줄이겠다고 한 사람에게는
깜빡이지 않는다.
사유 툴팁과 CodeLens — 둘은 같은 질문을 공유한다: 이 제안이 지금 이 텍스트의
어디에 붙는가. 그 답만 review/proposalMarks.ts 에 순수 함수로 두고 화면에
얹는 일은 editor/proposalDeco.ts 가 한다.
판정 순서를 applyProposal 과 같게 맞춘 것이 요점이다. 다르면 카드에 뜬 자리와
편집기에 그린 자리가 어긋나고, 그건 사용자가 다른 곳을 보며 수락을 누르게
만든다. 못 찾거나 조각이 두 군데면 null 로 두고 아예 안 그린다 — 틀린 자리에
그리느니 안 그리는 편이 낫다.
문서도 사실에 맞춘다. Phase 2 는 원래 "Code-OSS 포크로 이전" 이었는데, 그
포크는 하지 않았고 하지 않는 것이 맞다 — 확장 API 로 렌더러에 손댈 수 없다는
것이 포크의 이유였고, 이 앱은 처음부터 자기 렌더러를 갖고 있어 그 이유가 없다.
포크 항목을 해당 없음으로 닫고 네 기둥 기준으로 완료 표시한다. 프로바이더
목록도 Gemini·로컬이 빠져 있어 함께 고친다.
검증: propose_edit 하나를 내는 stub 모델을 로컬 프로바이더로 붙여 실제
에이전트 루프를 태웠다 7/7 — 제안 생성, 줄에 표시, 호버로 사유("local — b 가
1부터 세는 곳에서 쓰여 22 로 올린다"), 렌즈 표시, 수락 중 유령 커서, 편집
적용, 수락 뒤 표시 사라짐. 단위 18개 추가(1063개 통과).
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.
Closes track B of the 0.3.0 plan — the three items the survey settled on.
Until now a proposal lived only on the card to the right. Seeing what was about to change meant looking away from the code, and deciding meant clicking over there too. The design put all of it on the changed line.
Ghost cursor
editAnimatornow draws a caret at the exact character being typed, as a zero-length decoration's pseudo-element — zero width, so it does not push the text. A whole-line highlight cannot tell you where to look on a long line. It does not blink for anyone who asked for reduced motion.Rationale tooltip and accept/reject CodeLens
Both answer the same question: where does this proposal attach in the text as it stands right now. That answer lives in
src/review/proposalMarks.tsas pure functions;src/editor/proposalDeco.tsputs it on screen.The part that matters: the resolution order matches
applyProposalexactly. If it did not, the range shown on the card and the range drawn in the editor could differ — and that means someone reads one place and clicks accept on another. When the snippet cannot be found, or occurs twice,locatereturnsnulland nothing is drawn. Drawing in the wrong place is worse than not drawing.Documentation
Phase 2 was written as "fork Code-OSS". That fork never happened and should not: forking existed to reach the renderer, and this app has had its own renderer from the start. The item closes as not-applicable and Phase 2 is marked done against the four pillars instead. The provider list was also stale — Gemini and local servers were missing.
Verification
A stub model emitting a single
propose_editwas attached through the local provider, so a real proposal went through the real agent loop — the local-model work from #72 became the test rig.7/7: the proposal arrives; the changed line is marked; hovering shows
local — b 가 1부터 세는 곳에서 쓰여 22 로 올린다; the lenses render as✓ 수락 | ✕ 거절; the ghost caret is present while the edit types in; the edit lands; the mark clears afterwards.1063 unit tests passing (18 new on
locate, including a stale range, a snippet that occurs twice, and a range pointing outside the file).npm run typecheckandnpm run buildclean.One probe mistake worth noting: the hover popup covers the CodeLens, so the accept click was landing on the popup and the run reported that accepting did nothing. Moving the pointer away first fixed the probe; the app was fine.