Skip to content

Task #779: rhwp-studio 스크롤바 드래그 후 마우스 release 시 이전 페이지 자동 복귀 정정 (closes #779)#781

Closed
jangster77 wants to merge 6 commits into
edwardkim:develfrom
jangster77:local/task779
Closed

Task #779: rhwp-studio 스크롤바 드래그 후 마우스 release 시 이전 페이지 자동 복귀 정정 (closes #779)#781
jangster77 wants to merge 6 commits into
edwardkim:develfrom
jangster77:local/task779

Conversation

@jangster77

Copy link
Copy Markdown
Collaborator

요약

rhwp-studio 영역 스크롤바 드래그 후 마우스 release 시 이전 페이지 (caret 원본 위치) 로 자동 복귀 결함 정정.

본질

`updateCaret()` (`input-handler.ts:1553`) 영역 의 `scrollCaretIntoView()` 호출 영역 이 cursor 변경 trigger 없는 mouseup (drag-during-scroll 패턴) 영역 의 caret 원본 위치 자동 복귀 결함 발동.

재현 시나리오

  1. 다중 페이지 문서 (예: hwp3-sample10.hwp 763 페이지) 로드
  2. 텍스트 클릭 (caret p.1)
  3. 마우스 보유 상태 로 scrollbar 까지 drag → page 2+ scroll
  4. mouse release → caret 원본 위치 (p.1) 로 자동 scroll back ⚠️

정정 영역

파일 변경
`rhwp-studio/src/engine/input-handler.ts` `updateCaret(skipScroll: boolean = false)` 시그니처 확장 + 조건부 `scrollCaretIntoView` 호출
`rhwp-studio/src/engine/input-handler-mouse.ts` `onMouseUp` 끝 `updateCaret()` → `updateCaret(true)` 변경

```typescript
// input-handler.ts
private updateCaret(skipScroll: boolean = false): void {
const rect = this.cursor.getRect();
if (rect) {
...
if (!skipScroll) {
this.scrollCaretIntoView(rect);
}
}
...
}

// input-handler-mouse.ts onMouseUp 끝
this.updateCaret(true); // [Task #779] mouseup 영역 의 scroll back 차단
```

영역 좁힘 (회귀 부재 가드)

호출 영역 skipScroll 동작
`onMouseUp` (드래그 selection 종료) true scroll skip → 본 결함 차단
키보드 영역 (input-handler-keyboard.ts 20+ 곳) false (기본) 기존 동작
programmatic cursor move false (기본) 기존 동작
`onMouseDown` 영역 cursor placement (8+ 곳) false (기본) 기존 동작
드래그 selection autoscroll (PR #718, `updateTextSelectionDragAutoScroll`) (별도 path) 보존

→ 30+ 기존 호출 영역 무영향. opt-in skip 영역 좁힘.

검증

결정적 검증

  • `tsc --noEmit`: clean
  • `npm run build`: 성공 (WASM 4.6 MB, index.js 707 KB)
  • `cargo test --lib --release`: 1217 passed (rust lib 무영향)
  • `cargo clippy --release --lib`: 신규 경고 0

작업지시자 시각 판정 ★ 통과

5 시나리오 정합:

  1. 본 결함 해소 ✅ (scrollbar drag → release → 위치 보존)
  2. cursor click 정상 ✅ (회귀 부재)
  3. 키보드 navigation 정상 ✅ (회귀 부재)
  4. 드래그 selection autoscroll (PR Task #661: 드래그 선택 중 커서/스크롤 튐 정정 (closes #661) #718) 정상 ✅ (회귀 부재)
  5. Wheel scroll 정상 ✅ (회귀 부재)

단계별 보고서

Test plan

  • `tsc --noEmit` clean
  • `npm run build` 성공
  • `cargo test --lib --release`: 1217 passed
  • `cargo clippy --release --lib`: 신규 경고 0
  • 작업지시자 시각 판정 ★ 통과 (시나리오 1~5)
  • 메인테이너 머지

후속 (별도 task 영역)

🤖 Generated with Claude Code

… 본질 진단

본질 진단 (소스 정밀 추적)
- scrollTop 변경 영역: viewport-manager (API), canvas-view (초기 로드),
  input-handler (drag autoscroll PR edwardkim#718, scrollCaretIntoView)
- scrollCaretIntoView 호출 영역: updateCaret() 안 단일 호출 (line 1609)
- updateCaret() 호출 영역: 키보드/마우스/programmatic 30+ 곳

가설 도출
- 가설 A (단순 scrollbar): native scrollbar 영역 의 mousedown/mouseup 이
  document level 발동 안 됨 → onMouseUp chain 미발동 → 본 결함 설명 부재
- 가설 B (drag-during-scroll): 사용자 가 텍스트 클릭 (isDragging=true) +
  mouseup 안 한 채 scrollbar 까지 drag → scrollbar 위 mouseup → onMouseUp
  발동 → updateCaret → scrollCaretIntoView → caret 원본 위치 scroll back
- 가설 C: 다른 trigger 영역 (focus, scrollend 등) — Stage 2 의 정정 +
  작업지시자 시각 검증 으로 confirm

산출물
- mydocs/plans/task_m100_779.md (수행계획서)
- mydocs/plans/task_m100_779_impl.md (구현계획서)
- mydocs/working/task_m100_779_stage1.md (본 보고서)

후속 (Stage 2)
- updateCaret(skipScroll: boolean = false) 시그니처 확장
- onMouseUp 의 updateCaret(true) 변경 (가설 A/B 영역)
- 작업지시자 browser 시각 검증 으로 confirm
…역 좁힘

본질
- updateCaret() 영역 의 scrollCaretIntoView() 호출 영역 이 cursor 변경 trigger 없는
  mouseup (drag-during-scroll 패턴) 영역 의 caret 원본 위치 자동 복귀 결함 발동.
- onMouseUp 영역 의 updateCaret() 호출 영역 의 본질: selection 종료 영역 의 visual
  cleanup 영역 (caret 위치 자체 변경 부재). scroll 호출 영역 의 의도 부재.

정정
- updateCaret(skipScroll: boolean = false) 시그니처 확장. 기본값 false 으로 기존 30+ 곳
  호출 영역 무영향 (opt-in skip) 영역 좁힘.
- skipScroll true 시 scrollCaretIntoView 호출 skip.
- onMouseUp 영역 (input-handler-mouse.ts:1390) 의 updateCaret() → updateCaret(true) 변경.

영역 좁힘 (회귀 부재 가드)
- 키보드 영역 (input-handler-keyboard.ts 20+ 곳): 기본값 false → 기존 동작
- programmatic cursor move (moveCursorTo, enterInlineEditing 등): 기본값 false → 기존
- onMouseDown 영역 의 cursor placement (input-handler-mouse.ts 8+ 곳): 기본값 false → 기존
- 드래그 selection autoscroll (PR edwardkim#718, updateTextSelectionDragAutoScroll): 별도 path → 보존

검증
- tsc --noEmit: clean
- npm run build: 성공 (4.6 MB WASM, 707 KB index.js)
- cargo test --lib --release: 1217 passed (rust lib 무영향)

후속 (Stage 3)
- 작업지시자 시각 판정 (수동 시나리오 1~5)
- e2e 회귀 가드 (선택) — scroll-page-preserve.test.mjs
…loses edwardkim#779)

Stage 3 검증
- tsc --noEmit: clean
- npm run build: 성공 (WASM 4.6 MB, index.js 707 KB)
- cargo test --lib --release: 1217 passed
- cargo clippy --release --lib: 신규 경고 0
- 작업지시자 시각 판정: ★ 통과 ("해결 완료")
  - 시나리오 1: 본 결함 해소 (scrollbar drag → release → 위치 보존)
  - 시나리오 2: cursor click 정상 (회귀 부재)
  - 시나리오 3: 키보드 navigation 정상 (회귀 부재)
  - 시나리오 4: 드래그 selection autoscroll PR edwardkim#718 정상 (회귀 부재)
  - 시나리오 5: wheel scroll 정상 (회귀 부재)

Stage 4 산출물
- mydocs/working/task_m100_779_stage3.md
- mydocs/report/task_m100_779_report.md (최종)
- mydocs/orders/20260510.md (메인테이너 본인 영역 신규 등록)

권위 사례 강화
- feedback_hancom_compat_specific_over_general: opt-in skipScroll 영역 좁힘
- feedback_pr_supersede_chain: PR edwardkim#718 (Task edwardkim#661) 후속 영역
- feedback_visual_judgment_authority: 작업지시자 시각 판정 confirm

후속
- e2e 회귀 가드 (별도 task) — scroll-page-preserve.test.mjs
edwardkim added a commit that referenced this pull request May 10, 2026
…k-scroll 정정

@jangster77 영역 rhwp-studio editor 영역 drag-during-scroll 결함 정정.

본질: 사용자 텍스트 클릭 (caret p.1) → 마우스 보유 상태 영역 scrollbar drag → release 시 mouseup listener 가 scrollbar release catch → updateCaret → scrollCaretIntoView → caret 원본 위치 자동 scroll back.

정정 (input-handler.ts +11/-3 + input-handler-mouse.ts +7/-1, 본질 +18/-4):
- updateCaret(skipScroll: boolean = false) 시그니처 확장
- onMouseUp 영역 updateCaret(true) — opt-in skip 영역 좁힘
- 30+ 기존 호출 무영향 (키보드/programmatic/onMouseDown/PR #718 autoscroll 보존)

거버넌스 +617 (Stage 1 진단 + Stage 2 GREEN + Stage 3+4 검증/보고서 + 거버넌스 문서).

검증:
- tsc --noEmit ✅
- cargo test --release ALL GREEN
- cargo clippy --release -- -D warnings 통과
- 광범위 sweep 170/170 same
- WASM 4.68 MB 재빌드
- 작업지시자 웹 에디터 시각 판정 ✅ 통과 (5 시나리오 — 본 결함 해소 + cursor click + 키보드 + 드래그 selection autoscroll + wheel scroll 회귀 부재)

closes #779
@edwardkim

Copy link
Copy Markdown
Owner

@jangster77 검토 완료했습니다. 감사합니다.

처리 결과

Merge commit: 6c125000 (devel)

본질

rhwp-studio editor 영역 drag-during-scroll 패턴 정정 — updateCaret(skipScroll: boolean = false) opt-in skip 영역 좁힘. 30+ 기존 호출 무영향.

단계별 분리 인상적

  • Stage 1 본질 진단 — 가설 A/B/C 도출 → 가설 B (drag-during-scroll) 확정
  • Stage 2 GREEN — updateCaret skipScroll 파라미터 + onMouseUp 영역 좁힘
  • Stage 3+4 검증 + 시각 판정 ★ + 최종 보고서

검증

  • tsc --noEmit + cargo test/clippy --release ALL GREEN
  • 광범위 sweep 170/170 same
  • WASM 4.68 MB 재빌드
  • 작업지시자 웹 에디터 시각 판정 ✅ 통과 (5 시나리오)

closes #779.

5/10 사이클 — PR #718 (Task #661, 드래그 selection autoscroll) 의 후속 영역 동일 패턴 (scrollCaretIntoView 영역) 의 다른 trigger (drag-during-scroll) 정정. 수고하셨습니다.

@edwardkim

Copy link
Copy Markdown
Owner

Merged. Merge commit: 6c12500

@edwardkim edwardkim closed this May 10, 2026
edwardkim added a commit that referenced this pull request May 10, 2026
PR #781 (closes #779) — rhwp-studio scrollbar release back-scroll 결함 정정.
updateCaret(skipScroll) opt-in skip 영역 좁힘 — 30+ 기존 호출 무영향.

Merge commit: 6c12500
Cherry-pick: a90ce16f + e524a0d8 + 3a6e976

orders 영역 컨트리뷰터 영역 'PR 신규 예정' 행 영역 PR #781 영역 갱신.
edwardkim added a commit that referenced this pull request May 10, 2026
5/10 + 5/11 사이클 누적 — 외부 기여자 다수 PR 30+ 머지.

Cargo.toml + rhwp-vscode/package.json + npm/editor/package.json + rhwp-studio/package.json: 0.7.10 → 0.7.11
rhwp-vscode/CHANGELOG.md: [0.7.11] 항목 추가

핵심 변경:
- Skia native raster P8 (#761) + P9 (#769) — Layer IR contract hardening + text replay parity
- HWP3 native 렌더링 (#753) — hwp3-sample10 8 단계 정정 + Git LFS pdf-large/ 신규
- 페이지네이션 정정 (#778) — Task #703 다단 컬럼 분배 회귀 정정
- rhwp-studio 인터랙션 (PR #781/#786/#787/#788) — scrollbar/수식/표 셀/도구 모음 결함 정정
- rhwp-studio editor 신규 기능 (PR #728/#748/#750/#760 등) — 표 편집 Undo/Redo + 다단 설정 + 다수 단축키
@edwardkim edwardkim mentioned this pull request May 10, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants