Files
Aislo/A00_Common/app_settings_find.ts
T
eomsangdonandClaude Opus 5.5 2e4316567c feat(설정 단축키): CAD 리본 묶음 · 찾기 · 다른 곳 = 실제 동작 등록부 표 · 키 바꾸기 · 겹침 막음 (PLAN 588-1~3 · 요구 445 C2 · C3)
- 새 key_registry.ts — 화면마다 받는 키 · 마우스 동작 한 벌 · keyIs(evt, id) · 바꾼 키만 input-prefs.keys
- ☰ [설정] CAD 탭 = 찾기 칸 + 「키 · 마우스」 + 리본 탭 › 패널 접이 묶음(기타 여섯) · 날 input → 부품 입력
- 다른 곳 탭 = 손글 안내 지우고 등록부 표(B05 방향키 · D03 Delete 등 빠진 것 포함) · 찾기
- 키 기록 칸 · 줄마다 [기본값] · [모두 기본값] · 같은 화면 · 모든 화면 겹침 · 브라우저 몫 · CAD 글자 단독은 저장 막음
- 배선: B05 되돌림 · 자유지정 Enter · Backspace · D03 되돌림 · 그리기 · 지움(한글 자판도 자판 자리) · CAD F3 · F7 · F8 · F10 · Ctrl 명령 · Delete
- 낡은 글 대조 시험 셋(215-1 · 345-3 · 346-4)은 새 배선 글로 고침

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:50:41 +09:00

45 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* =============================================================================
* app_settings_find.ts
* ☰ [설정] 단축키 탭 셈(PLAN 588-1) — CAD 명령 묶음 · 찾기 판정. 화면 · 저장소 안 씀.
*
* - 묶음 = 리본 탭 › 패널 이름 그대로(`openwebcad/src/ribbon/ribbon.config.ts` · 순수 자료) · 두 패널에 있으면 앞 패널 · 리본에 없는 명령 = 기타
* - 찾기 = 띄어 나눈 낱말이 모두 어느 글에든 들면 맞음 · 대소문자 무시
* 시험 = `resources/tester/test_588_key_registry.py`
* ========================================================================== */
import { RIBBON_TABS } from "../B07_DesignDetail/openwebcad/src/ribbon/ribbon.config";
export interface CadGroup {
/** 「홈 › 그리기」 · 기타는 빈 글 */
label: string;
ids: string[];
}
/** 명령 id 들 → 리본 묶음(리본 차례) + 끝에 기타(`label` 빈 글) */
export function cadCommandGroups(ids: string[]): CadGroup[] {
const known = new Set(ids);
const seen = new Set<string>();
const groups: CadGroup[] = [];
for (const tab of RIBBON_TABS) {
for (const panel of tab.panels) {
const mine = [...(panel.big ?? []), ...(panel.commands ?? []), ...(panel.overflow ?? [])]
.filter((id) => known.has(id) && !seen.has(id))
.filter((id) => seen.add(id));
if (mine.length) groups.push({ label: `${tab.label} › ${panel.label}`, ids: mine });
}
}
const rest = ids.filter((id) => !seen.has(id));
if (rest.length) groups.push({ label: "", ids: rest });
return groups;
}
/** 찾기 — 빈 찾기 = 맞음 · 낱말마다 어느 글에든 들어야 */
export function matchesFind(query: string, texts: string[]): boolean {
const hay = texts.join("\n").toLowerCase();
return query
.toLowerCase()
.split(/\s+/)
.filter(Boolean)
.every((word) => hay.includes(word));
}