Skip to content

feat: 랜딩 페이지에 MathLive 기반 수학 점역 데모 추가 및 한글·수학 탭 통합 - #177

Open
jessieyeon wants to merge 14 commits into
dev-five-git:mainfrom
jessieyeon:demo-math-landing
Open

feat: 랜딩 페이지에 MathLive 기반 수학 점역 데모 추가 및 한글·수학 탭 통합#177
jessieyeon wants to merge 14 commits into
dev-five-git:mainfrom
jessieyeon:demo-math-landing

Conversation

@jessieyeon

Copy link
Copy Markdown

개요

랜딩 페이지에 수학 점역 체험 데모를 추가하고, 기존 한글 점역 데모와 함께 '한글' / '수학' 탭 토글 하나로 통합했습니다. 사용자는 MathLive 화면 수식 키보드로 수식을 WYSIWYG 편집하고, 자동 생성된 LaTeX가 실시간으로 한국 수학 점자로 변환되는 것을 체험할 수 있습니다.

주요 변경

수학 점역 데모

  • mathlive@^0.110.0 도입, MathLive 폰트를 public/mathlive/fonts/self-host (braillify의 "외부 연결 없이 실행" 원칙 유지 — CDN 미사용)
  • MathTransInput — MathLive <math-field> 웹 컴포넌트 래퍼. SSR 회피(동적 import), 데스크톱에서도 가상 수식 키보드 노출(manual 정책), 언마운트 시 키보드 자동 닫힘
  • MathLive가 생성한 LaTeX를 $...$로 감싸 기존 braillify WASM translateToUnicode에 전달 — 코어 엔진(libs/braillify) 무수정

한글·수학 탭 통합

  • DemoTabs — '한글'/'수학' 탭 토글(기본 '한글'). WAI-ARIA tablist/tab/tabpanel, 좌우 화살표 키 이동 지원
  • 수학 안내문을 입력창 placeholder로 이동(한글 데모와 동일한 방식), 출력창은 예시만 표시
  • 입력·출력 박스를 동일 flex-basis 2단 구조로 맞춰 전 브레이크포인트에서 크기 통일(모바일 343×203 / 태블릿 693×256 / 데스크톱 498×500, 모두 좌우 동일)
  • DemoChrome — 한글·수학 데모가 공유하는 헤딩/화살표 컴포넌트 추출

세부 보정

  • \frac 정규화: MathLive의 중괄호 생략 직렬화(\frac34)를 braillify가 인식하는 \frac{3}{4} 정규형으로 변환. 미종료 중괄호·제어기호 인자도 안전하게 처리
  • 입력 박스 전체 클릭 시 수식 필드 포커스(기존 한글 데모와 동일 동작)

검증

  • bun run build 통과, 기존 테스트 스위트 14,165개 전부 통과(회귀 없음)
  • 브라우저 확인: 한글 변환(학교⠚⠁⠈⠬), 수학 변환(x²+1⠭⠘⠼⠃⠢⠼⠁, ¾⠼⠙⠌⠼⠉), 탭 전환/화살표 키 이동, 가상 키보드 열림·닫힘, 다크 테마 가독성, 폰트 로컬 서빙(404 없음)
  • 반응형 3개 브레이크포인트에서 좌우 박스 크기 일치 실측

알려진 후속 작업 (이 PR 범위 밖)

  • braillify 엔진의 LaTeX 파서가 중괄호 없는 \frac34을 직접 분수로 인식하도록 일반화 — 현재는 랜딩측 normalizeFracBraces로 경계에서 처리. 엔진 수정은 별도 서브시스템(Rust + PDF 근거 테스트)이라 분리함.

jessieyeon and others added 11 commits July 22, 2026 15:31
- MathTransInput: 박스 전체 클릭 시 math-field 포커스(TransInput과 동일 동작)
- readArg: 미종료 중괄호 내용 보존, 제어기호 인자 균형 유지
- DemoChrome: 한글·수학 데모 공통 헤딩/화살표 컴포넌트 추출
- DemoTabs: type=button, aria-controls, role=tabpanel, 좌우 화살표 키 이동
- MathTransInput: latex 상태를 부모에서 단일 관리(controlled), placeholder 흐름 배치로 매직 넘버 제거
- 입출력 박스를 동일 flex-basis 2단 구조로 맞춰 크기(498×500) 통일

Co-Authored-By: Claude Fable 5 <[email protected]>

@owjs3901 owjs3901 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.

superpowers 를 gitignore에 추가요망

Comment thread apps/landing/src/app/DemoChrome.tsx Outdated
Comment thread apps/landing/src/app/MathTrans.tsx Outdated
Comment thread apps/landing/src/app/MathTransInput.tsx Outdated
minH="25dvh"
onClick={() => fieldRef.current?.focus()}
p={['16px', null, null, '40px']}
w="100%"

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.

이미 flex라서 w="100%"가 필요 없을거에요

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

w="100%"를 제거했습니다. 다만 바깥 컨테이너가 row 방향 flex라 align-items: stretch가 가로를 늘리지 않아, w="100%"를 그냥 지우면 입력·출력 박스 너비가 어긋났습니다. 그래서 w="100%" 대신 flex="1"으로 가로를 채우도록 바꿨습니다.

Comment thread apps/landing/src/app/MathTransInput.tsx Outdated
Comment thread apps/landing/src/app/MathTransInput.tsx Outdated
Comment thread apps/landing/src/app/Trans.tsx Outdated
Comment thread docs/superpowers/plans/2026-07-22-demo-tabs-unify.md Outdated
jessieyeon and others added 3 commits July 28, 2026 13:15
- Trans/MathTrans/MathTransInput의 세로 컨테이너를 Flex→VStack으로 변경
- VStack 기본값과 중복되는 flexDirection="column" 및 불필요한 w="100%" 제거
- DemoArrow의 transform 기본값 rotate(0deg)→null (항등 변환이라 불필요)
- 미사용 Flex import 정리

Co-Authored-By: Claude Fable 5 <[email protected]>
- MathTransInput: math-field의 인라인 style을 css()로 전환
- Trans/MathTrans: VStack 기본값과 중복되는 flexDirection 맨 앞 column을 null로
- docs/superpowers 플랜 문서 2개 제거
바깥 컨테이너가 row 방향 flex라 align-items stretch가 가로를 늘리지
않아 w=100%가 제거되면 입력·출력 박스 너비가 어긋난다. w=100% 대신
flex=1로 가로를 채워 박스 크기 동일을 유지하면서 명시적 w=100%를 제거한다.
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