Repository navigation
feat: 문장 분석 읽기와 선택적 구간·계층 수정 - #163
Merged
Yelihi merged 4 commits intoOct 5, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Yelihi
commented
Oct 5, 2026
Yelihi
commented
Oct 5, 2026
Yelihi
commented
Oct 5, 2026
| import type { AnalysisEditorProps, AnalysisEditorState } from "./interface"; | ||
| import { editAnalysis } from "../services/editAnalysis"; | ||
|
|
||
| export function createAnalysisEditorStore({ initialAnalysis, onChange }: AnalysisEditorProps) { |
Owner
Author
There was a problem hiding this comment.
인자로 초기값과 이벤트를 받는데, 분석 에디터의 경우 여러 군데에서 스토어가 생성되어야 하나요 아니면 테스트 대비 의존 주입일까요?
Yelihi
commented
Oct 5, 2026
Yelihi
commented
Oct 5, 2026
This was referenced Oct 5, 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.
AI가 나눈 문장을 읽는 것을 기본 흐름으로 제공합니다. chunk를 누르면 문장 아래에 직독직해·문장 성분·설명·관련 구문이 나타납니다. 선택은 흰 블록과 중립색 그림자로 표현하고, 작은 상승/등장 효과에는 reduced-motion 대응을 적용했습니다.
분석 수정에서만 의미 덩어리 경계 이동·나누기·합치기와 문법 항목의 구간·계층을 편집합니다.읽기로 돌아가기/Escape로 복귀할 수 있고, 미적용 입력은 공통 ConfirmDialog로 보호합니다. 원문을 보존하며 잘못된 경계/계층 수정은 원자적으로 거절합니다. 문장 끝에서 빈 구간을 추가하는 동작도 차단했습니다.Closes #150
선행 PR: #162 (#149). Base는
feature/149-grammar-domain입니다. #162 병합 후 main 기준으로 변경해 검토할 수 있습니다.인터페이스·상태·편집 이벤트는 features의 model/store/service에 두고 읽기 표시, 도구 모음, 편집 탐색, 입력, 이탈 확인을 작은 컴포넌트로 분리했습니다. Tailwind/CVA 및 chunk 단위 상태 구독을 사용합니다.
편집 이벤트는
edit(service => service.moveBoundary(chunkId, end))처럼EditAnalysisService메서드를 직접 호출합니다. 공통 도메인 검증, 순차 편집 적용, store의 성공 반영을 분리하여 새 편집 추가 시 중앙 action-type 분기를 수정하지 않도록 했습니다. 배치가 실패하면 중간 결과를 반영하지 않습니다.읽기 모델 변환은
models/converters/convertAnalysisToChunkReading.ts에 둡니다. 에디터별 store를 Provider 수명에 묶어 분석·선택·미적용 입력을 격리하고, Context에는 고정된 store 참조만 전달합니다. 부모 콜백이 바뀌어도 최신 수신자에게 알리며 편집 내용은 유지합니다. 다른 문서로 교체할 때는 key를 변경합니다.풀이 필드, 경계 미리보기, 나누기 미리보기를 분리했습니다. 풀이 입력은 적용 시 읽고 미리보기 state는 각각의 컴포넌트가 소유합니다. Escape 핸들러는 이벤트 시점의 store 상태를 읽어 별도 구독을 없앴고 확인창 내부 Escape는 Radix가 처리합니다. DOM에 직접 전달하는 핸들러에는 참조 메모화가 필요하지 않아 useCallback을 추가하지 않았습니다.
검증:
미리보기:
npm run storybook→ features/grammar-analysis-edit/GrammarAnalysisEditor.범위는 독립 컴포넌트와 Storybook이며 fixture를 사용합니다. 실제 등록 페이지·AI·저장 연결은 #153 및 선행 이슈에서 진행합니다. 검토 기록:
docs/design/echo/grammar-practice-20261005/analysis-reading-review.md.