feat: 단축키 표 공개 (RichEditorShortcuts) - #49
Merged
Merged
Conversation
자체 툴바·메뉴를 만드는 호스트가 편집기가 실제로 반응하는 제스처를 읽을 수 없었다. 그래서 "Ctrl+B"를 편집기가 보지 못하는 곳에 다시 적어야 했고, 바인딩이 바뀌는 날 둘이 갈라진다. - RichEditorShortcuts.All(전체 표) · Display(id)(힌트 텍스트) · Gesture(id)(메뉴용 KeyGesture) 공개. - 타입 이름을 RichEditorShortcutId(enum) · RichEditorShortcut(record)로 바꿨다 — 나머지 공개 표면이 전부 RichEditor* 접두어라(RichEditorIcon·RichEditorView·RichEditorLocalization) 접두어 없는 ShortcutId/ShortcutSpec는 호스트의 같은 이름과 부딪힌다. 내부 이름 변경이라 호환 영향 없음 (사용자 결정 2026-09-20). 명령은 뒤에 붙이므로 enum 숫자 값의 뜻은 유지된다. - All은 읽기 전용 뷰다(Array.AsReadOnly). 배열을 그대로 주면 호스트가 편집기 자신의 키 핸들러가 매칭하는 표를 고칠 수 있다. - TryMatch는 내부로 남겼다(사용자 결정): 호스트는 All로 직접 맞추면 되고, 키 라우팅 방식은 바꿀 자유를 남긴다(F5는 메뉴 힌트로만 표에 있다). 테스트 PublicShortcutTableTests 8개(1127 → 1135), 렌더 41 그대로, 클린 빌드 0 warn(공개 enum이라 멤버마다 XML 주석 필요 — CS1591 35건을 채웠다). 공개 API 추가 55줄. 반증 3종 전부 의도한 테스트만 빨강: - 키 핸들러의 Bold 분기 제거 → 표가 광고하는 제스처가 아무 일도 안 함(자기 일관성만으론 못 잡는 축). - Bold의 Display를 "Ctrl+Q"로 → 힌트가 자기 수정자·키와 어긋남. - All을 내부 배열 그대로 반환 → 바깥에서 표를 고칠 수 있음. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 20, 2026
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.
백로그의 "
RichEditorShortcuts공개". 1.3.0 계획 3건 중 두 번째다(#48에 이어서).자체 툴바나 메뉴를 만드는 호스트는 편집기가 실제로 반응하는 제스처를 읽을 수 없었다. 그래서
"Ctrl+B"를 편집기가 보지 못하는 곳에 다시 적어야 했고, 바인딩이 바뀌는 날 둘이 갈라진다.공개된 것
ShortcutId→RichEditorShortcutId,ShortcutSpec→RichEditorShortcut. 나머지 공개 표면이 전부RichEditor*접두어라(RichEditorIcon·RichEditorView·RichEditorLocalization), 접두어 없는 이름은 호스트가using으로 끌어썼을 때 자기ShortcutId와 부딪힌다. 내부 이름 변경이라 호환 영향은 없다. 명령은 뒤에 붙이므로 enum 숫자 값의 뜻은 유지된다(RichEditorIcon과 같은 규칙).All은 읽기 전용 뷰다. 배열을 그대로 주면 호스트가 편집기 자신의 키 핸들러가 매칭하는 표를 고칠 수 있다.TryMatch는 내부로 남겼다(사용자 결정). 호스트는All로 직접 맞추면 되고, 편집기는 키 라우팅 방식을 바꿀 자유를 남긴다 — F5는 실제로 표에 메뉴 힌트로만 올라가 있고 라우팅은 따로 한다.검증
PublicShortcutTableTests8개 — 유닛 1127 → 1135, 렌더 41 그대로, 클린 빌드 0 warn(공개 enum이라 멤버마다 XML 주석이 필요해 CS1591 35건을 채웠다).Bold분기 제거 → 표가 광고하는 제스처가 아무 일도 안 한다. 표의 자기 일관성만으론 못 잡는 축이라 이 테스트를 넣었다.Bold의Display를"Ctrl+Q"로 → 힌트가 자기 수정자·키와 어긋난다.All이 내부 배열을 그대로 반환 → 바깥에서 표를 고칠 수 있다.공개 API 추가 55줄(제거·시그니처 변경 없음 — 바뀐 이름은 둘 다 internal이었다).
🤖 Generated with Claude Code