fix(web): 결과 페이지 — 문제 텍스트 가독성, 풀이 표시, 죽은 버튼 제거#23
Merged
Conversation
Three user-facing defects on /app/new/result:
1. Korean problem text was passed whole into KaTeX math mode, which drops
all spaces and clips to one line. Add LatexAuto — splits undelimited
prose+math: ASCII runs with a math signal (\cmd, ^{, _{, =, operators
between operands) render via KaTeX, everything else stays plain text.
Applied to result cards, verify preview, and export sheet, with a
question-stage prose variant (left-aligned, keep-all wrapping).
2. 풀이 보기 was always empty: the agent never sent explanation_latex.
wire-adapter now projects proposed_solution_trace through formatLatex
into the (already specced) explanation_latex field; the web hook and
result page already consumed it. Cards without a solution hide the
disclosure instead of showing a dead expander.
3. Removed the three permanently-disabled placeholder buttons (다시 생성/
수정/폐기, 'v2 예정') — only the working star (채택) remains. Filter
chips with no matching problems (e.g. 개념동형 in structural mode) are
hidden.
Verified live via Playwright against a real 3-problem generation: prose
wraps without horizontal clipping, solutions expand with content, star
toggle enables PDF export, 주의 filter shows the warning card.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
2 issues found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/web/components/math/latex-renderer.tsx">
<violation number="1" location="packages/web/components/math/latex-renderer.tsx:195">
P2: Operator heuristic misclassifies hyphen/slash prose words as math. This breaks readability by rendering normal words in KaTeX math mode.</violation>
<violation number="2" location="packages/web/components/math/latex-renderer.tsx:199">
P2: Any literal `$` disables `segmentAuto` for the remaining text because parsing is delegated too early. Mixed text containing currency plus undelimited math will skip math rendering after the `$`.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| const TRAILING_PUNCT = /[.,]+$/; | ||
|
|
||
| export function segmentAuto(source: string): Segment[] { | ||
| if (/\$|\\\(|\\\[/.test(source)) return splitDelimited(source); |
There was a problem hiding this comment.
P2: Any literal $ disables segmentAuto for the remaining text because parsing is delegated too early. Mixed text containing currency plus undelimited math will skip math rendering after the $.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/web/components/math/latex-renderer.tsx, line 199:
<comment>Any literal `$` disables `segmentAuto` for the remaining text because parsing is delegated too early. Mixed text containing currency plus undelimited math will skip math rendering after the `$`.</comment>
<file context>
@@ -181,3 +181,86 @@ export function LatexMixed({ source }: LatexMixedProps) {
+const TRAILING_PUNCT = /[.,]+$/;
+
+export function segmentAuto(source: string): Segment[] {
+ if (/\$|\\\(|\\\[/.test(source)) return splitDelimited(source);
+ const out: Segment[] = [];
+ let text = "";
</file context>
| */ | ||
|
|
||
| const MATH_WORD = /^[A-Za-z0-9\\^_{}+\-*/=<>().,:%|']+$/; | ||
| const MATH_SIGNAL = /\\[a-zA-Z]+|[\^_]\{|=|[0-9A-Za-z)] ?[+\-*/] ?[0-9A-Za-z(]/; |
There was a problem hiding this comment.
P2: Operator heuristic misclassifies hyphen/slash prose words as math. This breaks readability by rendering normal words in KaTeX math mode.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/web/components/math/latex-renderer.tsx, line 195:
<comment>Operator heuristic misclassifies hyphen/slash prose words as math. This breaks readability by rendering normal words in KaTeX math mode.</comment>
<file context>
@@ -181,3 +181,86 @@ export function LatexMixed({ source }: LatexMixedProps) {
+ */
+
+const MATH_WORD = /^[A-Za-z0-9\\^_{}+\-*/=<>().,:%|']+$/;
+const MATH_SIGNAL = /\\[a-zA-Z]+|[\^_]\{|=|[0-9A-Za-z)] ?[+\-*/] ?[0-9A-Za-z(]/;
+const TRAILING_PUNCT = /[.,]+$/;
+
</file context>
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.
문제 (결과 화면 찐빠 3종)
스크린샷 기준 /app/new/result 의 사용자 가시 결함:
문화제진행팀에는서로다른12명의학생...)explanation_latex를 아예 안 실음 (웹 hook/스키마는 이미 수신 준비 완료 상태였음)수정
LatexAuto컴포넌트 신설^{,=, 피연산자 사이 연산자)가 있는 ASCII 구간만 KaTeX, 나머지는 텍스트.$...$있으면 기존 splitDelimited 위임question-stageCSSword-break: keep-all, 가로 클리핑 제거proposed_solution_trace→formatLatex→explanation_latex송출 (빈 trace 는 생략). 풀이 없는 카드는 '풀이 보기' 자체를 숨김검증 (실LLM 생성 + Playwright)
새 wire-adapter 로 실생성 3문항 → result 이벤트에 풀이 본문 확인 → 실페이로드를 sessionStorage 에 시드해 결과 페이지 구동:
has_spaces=True), 가로 클리핑 없음(h_clipped=False×3)🤖 Generated with Claude Code
Summary by cubic
Fixes the result page so Korean prose renders correctly, solutions display when available, and only working actions are shown. The same rendering improvements apply to verify preview and PDF export.
LatexAutoto split undelimited prose+math and render only math runs via KaTeX; used for questions/answers on result cards, verify preview, and export sheet..question-stagestyles for prose (left-aligned, keep-all wrapping) to preserve spacing and prevent horizontal clipping.wire-adapternow emitsexplanation_latexby convertingproposed_solution_tracewithformatLatex; hides “풀이 보기” when no solution is present.segmentAutoand solution trace formatting.Written for commit 00a5440. Summary will update on new commits.