Repository navigation
[DONE] Pattern Lab 의 ! 단언 가운데 타입으로 좁힐 수 있는 일곱이 빠진다 - #248
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkUCcHKEkbGmU8en5vWofb
! 단언 가운데 타입으로 좁힐 수 있는 일곱이 빠진다
… by ! Seven non-null assertions trusted an earlier boolean check; parseMatrixSize and textEffectSource hand back the checked value instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkUCcHKEkbGmU8en5vWofb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkUCcHKEkbGmU8en5vWofb
! 단언 가운데 타입으로 좁힐 수 있는 일곱이 빠진다! 단언 가운데 타입으로 좁힐 수 있는 일곱이 빠진다
patternflow-bot
marked this pull request as ready for review
October 25, 2026 06:13
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 25, 2026
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 25, 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.
lsh / https://claude.ai/code/session_01LkUCcHKEkbGmU8en5vWofb
Pattern Lab 코드가
!로 값이 있다고 믿던 일곱 곳을 타입으로 좁혔어요. 저장된 판 크기는parseMatrixSize가 맞는 크기나null로 돌려주고, 텍스트 효과가 무엇을 그리는지는textEffectSource한 곳에서 정해요. 화면은 그대로예요. 머지하면 손으로 고친 저장의 판 크기 127.6 이 128 로 열리고, source 가 없는 흐르기 레이어를 그리라고 해도 TypeError 없이 지나가요.좋아지는 것: 없음
dce6b5e)에서 아직 그대로isValidMatrix를parseMatrixSize로 바꾸고candidate!넷 빼기textEffectSource를 두고layer.source!셋 빼기source가null인 효과 레이어를 내보내는 시험6d2ddee)한 일
lib/pattern/matrix.ts의isValidMatrix는boolean만 돌려줘서, 그걸 거친legacyDraft.ts의readMatrix와serialize.ts의deserializeProject가candidate!.width,candidate!.height를 다시Number()로 읽었어요. 그 자리에parseMatrixSize를 두었어요. 범위를 보는 셈(clampDimension)은 같고, 맞으면 그 셈이 낸 크기를, 아니면null을 돌려줘요. 두 파일은?? DEFAULT_MATRIX와?? undefined로 받아요.isValidMatrix를 부르는 곳은 이 둘과matrix.test.ts뿐이라 이름째 바꿨어요.텍스트 효과는 「twinkle 은 비트맵을, scroll 과 ramp 는 source 를 그린다」를
flatten.ts와hExport.ts가 따로 적고 있었어요(effect === "twinkle" ? { x: 0, … } : layer.source!). 그 한 줄을textEffects.ts의textEffectSource로 옮겼어요. scroll 과 ramp 는sourceFits를 거친 source 만 돌려줘요. 두 내보내기는 효과를 모으는 Map 에 source 를 같이 담아서, 쓸 때 다시 꺼낼 일이 없어요.renderTextEffect는sourceFits로 거르고, 맞지 않으면out을 건드리지 않고 돌아가요.표대로 나머지 열(
project!들,getContext("2d")!,stack.pop()!,raw.get(t)!,ownerSVGElement!들)은 그대로 뒀어요.증거
시험 아닌 Lab 코드(
lib/lab,app/pattern-lab,lib/pattern)의!를 TypeScript AST 의NonNullExpression으로 셌어요.새 시험을 dev 에서 돌렸어요. dev 엔 두 이름이 없어서, dev 의 옛 셈 그대로(
!와Number()) 두 이름을 덧대고 돌렸어요.이 브랜치에선 다 초록이에요.
GitHub 에서도
6d2ddee의 Drift checks 와 Web CI 가 둘 다 success 예요. dev(dce6b5e)는 이 브랜치가 갈라진 뒤 움직이지 않아서 merge 할 것이 없었어요.화면을 바꾸지 않아서 사진은 없어요.
실행법
가정
isValidMatrix는 범위만 보고 값은Number()그대로 돌려줘서, 손으로 고친 저장의 127.6 이 그대로 판 크기가 됐어요.parseMatrixSize는clampDimension이 반올림한 128 을 돌려줘요. Lab 이 쓰는 저장은 늘 정수라서 Lab 이 남긴 저장은 열리는 모습이 그대로예요.source가null인 효과 레이어를 내보내는」 시험은 dev 에서도 초록이에요. dev 의 내보내기도activeTextEffect가null을 돌려줘서 비트맵으로 내보내요. 이 시험은 그 길을 지켜요. dev 에서 빨간 것은 위의 셋이에요.renderTextEffect가 맞지 않는 source 앞에서out을 그대로 두는 길은 지금 부르는 쪽에선 닿지 않아요.engine.ts는activeTextEffect를,text.ts는placeTextSource를 거친 뒤에만 불러요.lib/lab/serialize.ts는@/lib/pattern/matrix를:16과:46두 줄로 따로 불러와요.Changelog
Web
경험
언제: 바퀴에서 새 이름을 부르는 시험이 dev 에서 빨갰다는 것을 보일 때
교훈: dev worktree 에 그 이름을 dev 의 옛 셈 그대로 덧대고 돌리면, import 실패 대신 동작이 달라 빨간 시험만 골라 볼 수 있어요
근거: #248 에서
textEffectSource와parseMatrixSize를 옛 셈으로 덧대니 42개 가운데 셋만 빨갰고, 내보내기 시험 둘은 dev 에서도 초록이라는 걸 알았어요바퀴
바퀴 99 · 후보 7 「Pattern Lab 의
!단언 가운데 타입으로 좁힐 수 있는 일곱이 빠진다」다음 바퀴
globals.css에서 아무도 쓰지 않는 옛 Inside 패널 규칙 377줄이 빠진다」. 남은 줄 가운데 순위가 가장 높아요.globals.css에 남은 안 쓰는 규칙 70개와 그것만 쓰던 애니메이션 둘, 변수 넷이 빠진다」. 8위와 같은 파일이라 8위 다음에 하면 줄 번호가 덜 어긋나요.https://claude.ai/code/session_01LkUCcHKEkbGmU8en5vWofb
Generated by Claude Code