Skip to content

Show proposals in the code: ghost cursor, rationale tooltip, accept/reject CodeLens - #74

Merged
Seungpyo1007 merged 1 commit into
developfrom
feature/proposal-marks
Aug 7, 2026
Merged

Show proposals in the code: ghost cursor, rationale tooltip, accept/reject CodeLens#74
Seungpyo1007 merged 1 commit into
developfrom
feature/proposal-marks

Conversation

@Seungpyo1007

Copy link
Copy Markdown
Member

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

editAnimator now 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.ts as pure functions; src/editor/proposalDeco.ts puts it on screen.

The part that matters: the resolution order matches applyProposal exactly. 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, locate returns null and 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_edit was 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 typecheck and npm run build clean.

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.

조사에서 확정한 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개 통과).
@Seungpyo1007 Seungpyo1007 added this to the v0.3 (2026-09-30) milestone Aug 7, 2026
@Seungpyo1007 Seungpyo1007 added the enhancement New feature or request label Aug 7, 2026
@Seungpyo1007 Seungpyo1007 self-assigned this Aug 7, 2026
@Seungpyo1007
Seungpyo1007 merged commit 281613a into develop Aug 7, 2026
1 check passed
@Seungpyo1007
Seungpyo1007 deleted the feature/proposal-marks branch August 7, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant