Skip to content

feat: edit:delete (지우기) 커맨드 구현#752

Closed
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/edit-delete-command
Closed

feat: edit:delete (지우기) 커맨드 구현#752
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/edit-delete-command

Conversation

@oksure

@oksure oksure commented May 9, 2026

Copy link
Copy Markdown
Contributor

문제

편집 > 지우기 (edit:delete) 커맨드가 canExecute: () => false 스텁으로 남아 있어 메뉴에서 비활성 상태입니다.

수정 내용

InputHandler에 performDelete() 메서드 추가

performCut()과 동일한 구조에서 클립보드 복사를 제거한 형태입니다:

상태 동작
그림/도형 개체 선택 snapshot + deletePictureControl/deleteShapeControl
표 개체 선택 snapshot + deleteTableControl
텍스트 선택 deleteSelection() (기존 private 메서드 활용)
선택 없음 무동작 (canExecute에서 차단)

커맨드 및 단축키

  • edit:delete 커맨드의 canExecuteedit:cut과 동일한 조건으로 변경
  • Ctrl+E 단축키 바인딩 추가 (기존 shortcutLabel과 일치)

테스트

  • cargo test 통과
  • cargo clippy -- -D warnings 경고 없음

감사합니다.

- InputHandler에 performDelete() 공통 메서드 추가
  (그림/표 개체 선택 → snapshot 삭제, 텍스트 선택 → deleteSelection)
- edit:delete 커맨드 스텁을 실제 구현으로 교체
- Ctrl+E 단축키 바인딩 추가
- performCut()과 동일 로직에서 클립보드 복사만 제거한 형태

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 9, 2026 15:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the previously stubbed Edit → Delete (edit:delete) command so that users can delete the current selection (text) or selected objects (picture/shape/table) from the menu/command system.

Changes:

  • Added InputHandler.performDelete() to delete text selections or selected picture/table objects with undo snapshot support.
  • Enabled edit:delete by implementing canExecute/execute in the edit command registry.
  • Added default shortcut mapping Ctrl+E → edit:delete.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
rhwp-studio/src/engine/input-handler.ts Adds performDelete() to route delete behavior for object selections and text selections.
rhwp-studio/src/command/shortcut-map.ts Maps Ctrl+E to edit:delete in default shortcuts.
rhwp-studio/src/command/commands/edit.ts Implements edit:delete command execution and enables it via canExecute.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rhwp-studio/src/engine/input-handler.ts Outdated
Comment on lines +2266 to +2271
this.executeOperation({ kind: 'snapshot', operationType: 'deleteObject', operation: (wasm: WasmBridge) => {
if (ref.type === 'image') {
wasm.deletePictureControl(ref.sec, ref.ppi, ref.ci);
} else {
wasm.deleteShapeControl(ref.sec, ref.ppi, ref.ci);
}
Comment thread rhwp-studio/src/engine/input-handler.ts Outdated
Comment on lines +2277 to +2285
if (this.cursor.isInTableObjectSelection()) {
const ref = this.cursor.getSelectedTableRef();
if (ref) {
this.cursor.moveOutOfSelectedTable();
this.eventBus.emit('table-object-selection-changed', false);
this.executeOperation({ kind: 'snapshot', operationType: 'deleteTable', operation: (wasm: WasmBridge) => {
wasm.deleteTableControl(ref.sec, ref.ppi, ref.ci);
return this.cursor.getPosition();
}});
- deleteObjectControl() 공용 헬퍼 사용으로 equation/group/line 타입
  올바른 삭제 API 호출 (image/equation→deletePictureControl,
  shape/group/line→deleteShapeControl)
- 중첩 표(cellPath.length > 1) 삭제 시도 차단 — 선택 해제만 수행

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@oksure

oksure commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

Copilot 리뷰 피드백을 d31b4512에서 반영했습니다:

  • deleteObjectControl() 공용 헬퍼 사용으로 equation/group/line 타입별 올바른 삭제 API 호출
  • 중첩 표(cellPath.length > 1) 삭제 시도 차단 — 선택 해제만 수행 (기존 Delete/Backspace 처리와 동일)

edwardkim added a commit that referenced this pull request May 10, 2026
PR #752 의 performDelete 가 this.deleteObjectControl(ref) 호출 → ref.type 영역 영역
'line' 가능 (getSelectedPictureRef 시그니처) 영역 영역 래퍼 시그니처 영역 영역
'image|shape|equation|group' 만 정의 영역 영역 tsc 오류 발생.

input-handler-picture.ts 의 실제 구현 영역 영역 이미 'line' 포함 영역 영역,
input-handler.ts 의 래퍼 3개 (getObjectProperties / setObjectProperties /
deleteObjectControl) 영역 영역 'line' 추가 영역 영역 정합.

devel HEAD 영역 영역 잠재 결함 (PR #752 와 무관, performDelete 신규 호출 영역 영역
노출됨) — PR #740 자기 정정 패턴 정합.
edwardkim added a commit that referenced this pull request May 10, 2026
performCut 패턴 정합 — 클립보드 복사만 제외한 동일 구조.
인프라 재사용: executeOperation snapshot (PR #728) + deleteSelection + deleteObjectControl + EditorContext 가드.

자기 정정 commit 2aafebc 포함 — devel HEAD 영역 영역 deleteObjectControl 래퍼 시그니처 영역 영역
'line' 타입 누락 (PR #752 와 무관, 신규 performDelete 호출 영역 영역 노출).

검증:
- tsc --noEmit ✅ (자기 정정 후)
- cargo test --release ALL GREEN
- 광범위 sweep 170/170 same
- WASM 4.66 MB
- 웹 에디터 인터랙션 검증 ✅ 통과 (텍스트 / 그림 / 표 / 중첩 표 + Undo)
@edwardkim

Copy link
Copy Markdown
Owner

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

처리 결과

Merge commit: 3eb10f4e (devel)

본질

performCut 패턴 정합 — 클립보드 복사만 제외한 동일 구조.

인프라 재사용

자기 정정 commit (2aafebc8)

본 환경 점검 결과 devel HEAD 영역 deleteObjectControl 래퍼 시그니처 (input-handler.ts:1841) 영역 영역 'line' 타입 누락 — PR #752 의 신규 performDelete 호출 영역 영역 tsc 오류로 노출. getSelectedPictureRef (line 1819) 와 _picture.deleteObjectControl 실제 구현은 모두 'line' 포함 영역 영역, 래퍼 3개 (getObjectProperties / setObjectProperties / deleteObjectControl) 영역 영역 'line' 추가 영역 영역 정합 (PR #752 와 무관, devel HEAD 잠재 결함).

검증

  • TypeScript / cargo test ALL GREEN
  • 광범위 sweep 170/170 same
  • WASM 4.66 MB
  • 웹 에디터 인터랙션 검증 통과 (텍스트 / 그림 / 표 / 중첩 표 + Undo)

5/10 사이클 20번째 PR — 수고하셨습니다.

@edwardkim

Copy link
Copy Markdown
Owner

Merged. Merge commit: 3eb10f4

@edwardkim edwardkim closed this May 10, 2026
edwardkim added a commit that referenced this pull request May 10, 2026
PR #752 처리 보고서 + 검토 문서 archives 이동 + 5/10 orders 20번째 PR 행 추가.
edit:delete 커맨드 구현 — performCut 패턴 정합 + 자기 정정 commit (deleteObjectControl 래퍼 'line' 타입 추가).

Merge commit: 3eb10f4
Cherry-pick: d7928e1 + 3b5f696
자기 정정: 2aafebc
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.

3 participants