사각형 글상자 안 picture 클릭 hit-test / 속성 / 삽입 지원 (#1171)#1254
Merged
Conversation
사각형 글상자(Shape text_box) 안 picture click hit-test / 속성 지원. - 접근 B(cellPath 일반화) + picture 우선 UX 확정 - 5단계 구현계획서, 오늘 할일 등록 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
사각형(Shape) text_box 안 picture 가 controls JSON 에 cellPath (cell_index=0 sentinel)로 노출되도록 식별자 생성. - shape_layout.rs: Control::Picture 분기에 CellContext 전달 (text-run/equation/table 와 동일 sentinel 패턴, None→Some) - rendering.rs collect_controls: Rectangle(Shape) 핸들러 조기 return 제거 → Table 처럼 자식 재귀하여 글상자 내부 picture 수집 (계획 외 발견) - 신규 테스트 issue_1171_textbox_picture_cellpath - 전체 cargo test 1947 passed / 0 failed Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
글상자(Shape text_box) path(cell_index=0 sentinel)로 picture 속성 read/write 가능하도록 resolver 정합. - getter: resolve_cell_by_path → resolve_paragraph_by_path (표/글상자 모두 처리) - setter 공통 헬퍼 resolve_cell_paragraph_mut 에 Shape arm 추가 (immutable 짝 resolve_paragraph_by_path 와 대칭화, get_textbox_from_shape_mut) - 신규 round-trip 테스트 picture_in_textbox_get_set_by_path - cargo test --lib 1527 passed / 0 failed (표 셀 by_path 회귀 0) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
글상자(Shape text_box) 내부 클릭이 텍스트 편집으로 단락되기 전에 글상자 안 picture 를 선제 hit-test 하여 picture 객체선택 (picture 우선). - input-handler-mouse.ts: hit.isTextBox 시 findPictureAtClick 선제 호출, cellPath 동반 image/equation 이면 enterPictureObjectSelectionDirect 로 dispatch 후 return. picture 없으면 텍스트 편집 fall-through. - tsc 변경 파일 에러 0. 행위 검증은 Stage 5 (WASM 재빌드 후). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
E2E 검증 중 findPictureAtClick 이 글상자 picture bbox 에서 컨테이너 Shape 를 먼저 반환하는 결함 확인 → 우선순위 수정. - input-handler-picture.ts: findPictureAtClick 선두에 우선 패스 추가. 클릭이 Shape + cellPath nested image/equation 둘 다 hit 시 picture 우선 (shapeHit && nestedPic 일 때만 동작 → 표 셀 picture 무영향). - 신규 E2E textbox-picture-1171: cellPath 노출 + hit-test(image) + by_path round-trip(width 15040→20040) 통과. - Stage 4 결론: insert.ts 무변경 (depth-1 재구성이 글상자 cellPath 생성, E2E 확정). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
글상자(Shape text_box) 위에 이미지 드롭 시 삽입 실패(controls[N]가 표가 아닙니다) 수정. 한컴처럼 본문 레벨 floating 개체(글상자 sibling)로 삽입. - 원인(pre-existing): 글상자 hit 의 cellPath(sentinel)를 insertPicture 에 넘겨 표 전용 resolve_cell_by_path 가 거부 → 삽입 실패. - finishImagePlacement: 글상자(isTextBox) hit 은 cellPath 없이 본문 para(parentParaIndex)에 floating 삽입. 표 셀(edwardkim#1151)/본문은 불변. - 신규 E2E textbox-picture-insert-1171 (TDD red→green; before0→after1, treat_as_char=false floating, shape 독립 — 한컴 정합 확인). - 작업지시자 실환경 한컴 정합 확인 완료. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cellPath 일반화로 글상자 picture hit-test/속성(Stage1-4) + 글상자 위 이미지 드롭 본문 sibling 삽입(Stage6). cargo test 1948 pass, E2E pass, 한컴 정합 확인. orders 는 작업지시자(메인테이너) 영역이라 컨트리뷰터 추가분 원복. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
|
PR #1254 검토 및 메인테이너 검증을 완료했습니다. 반영 내용:
추가 보완:
검증:
검증 완료 커밋은 |
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.
배경
samples/tac-img-02.hwp6/7쪽의 "사각형(Shape, InFrontOfText) → 글상자(text_box) → paragraph → picture" 이중 중첩 picture가 rhwp-studio에서 클릭·선택·속성편집되지 않았습니다 (#1171). 작업 중 발견된 "글상자 위 이미지 드롭 시 삽입 실패"(별개 결함)도 함께 처리했습니다.접근 — cellPath 일반화
글상자를 "cell_index=0 sentinel 단일 셀 컨테이너"로 취급하여, 표 셀 picture가 이미 쓰던 cellPath 메커니즘을 글상자까지 확장했습니다. text/equation/table은 이미 이 방식을 사용하고 있었고 picture만 누락되어 있었습니다 (신규 평행 메커니즘 없음).
변경 요약
백엔드
src/renderer/layout/shape_layout.rs: 글상자 picture의layout_picture에CellContext(sentinel) 전달.src/document_core/queries/rendering.rscollect_controls: 사각형(Rectangle) 노드 조기return제거 → Table 처럼 자식 재귀하여 글상자 내부 picture 수집.src/document_core/commands/object_ops.rs: by_path picture getter/setter 가 글상자 path도 해석 (resolver 를 immutable 짝과 대칭화).프런트엔드 (rhwp-studio)
input-handler-mouse.ts: 글상자 내부 클릭이 텍스트 편집으로 단락되기 전 picture 선제 hit-test (picture 우선).input-handler-picture.tsfindPictureAtClick: 컨테이너 Shape + nested picture 동시 hit 시 picture 우선 반환.input-handler-table.ts: 글상자 위 이미지 드롭은 본문(body) floating sibling 으로 삽입 (한컴 정합).검증
cargo fmt --all -- --check✓cargo clippy --lib -- -D warnings✓ (경고 0건)cargo test✓ (1948 passed / 0 failed) — 신규tests/issue_1171_textbox_picture_cellpath.rs(cellPath 노출 + by_path get/set round-trip) 포함, 표 셀 by_path 회귀 0.rhwp-studio/e2e/textbox-picture-1171.test.mjs(선택/속성),textbox-picture-insert-1171.test.mjs(드롭→본문 sibling, TDD red→green).범위 밖 (후속)
Closes #1171
🤖 Generated with Claude Code