Repository navigation
[DONE] Pattern Lab 에서 휠로 확대할 때 패널이 함께 구르지 않는다 - #100
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011XiRG6u444B5VRcNGmCgvy
React 는 wheel 을 passive 로 위임해서 onWheel 안의 preventDefault 가 먹지 않았다. Pixel 뷰포트와 그림 가져오기 미리보기에 passive: false 리스너를 직접 붙이고, 옆으로 구르는 휠은 확대하지 않고 굴림으로 둔다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011XiRG6u444B5VRcNGmCgvy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011XiRG6u444B5VRcNGmCgvy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011XiRG6u444B5VRcNGmCgvy
patternflow-bot
marked this pull request as ready for review
October 16, 2026 16:54
10 tasks done
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.
dev / https://claude.ai/code/session_011XiRG6u444B5VRcNGmCgvy
Pattern Lab 의 Pixel 패널에서 휠로 확대하면 이제 그림만 커져요. 지금은 휠을 한 번 내리면 축소와 함께 뷰포트가 100px 굴러서 보던 자리가 밀려나요. 그림 가져오기 창의 미리보기도 같아서, 키가 낮은 창에선 휠을 돌릴 때 창 안이 같이 굴렀어요.
좋아지는 것: 휠로 확대하면 그림만 커진다 — 보던 자리가 굴러가지 않는다
체크리스트
dev에서 아직 안 고쳐졌는지 보기:dev빌드에서 휠 한 번에 뷰포트가 100px 굴렀어요usePixelViewport.ts휠 리스너ImportImageModal.tsx휠 리스너16b6ba8에서 Drift checks, Web CI 둘 다 success한 일
panels/pixel/usePixelViewport.ts는 React 의onWheel대신 뷰포트에wheel리스너를{ passive: false }로 직접 붙여요. React 는 wheel 을 뿌리에서 passive 로 받아서, 그 안의preventDefault()를 브라우저가 무시했어요. Chromium 은 휠마다 「Unable to preventDefault inside passive event listener invocation」을 찍었어요. Director 의useTimelineZoom.ts가 이미 같은 까닭으로 같은 꼴을 써요. 뷰포트는 픽셀 레이어를 고른 동안만 그려져요. 그래서 리스너는hasPixel이 바뀔 때 다시 붙고, 코드 레이어를 보다 픽셀 레이어로 옮겨 가도 휠이 먹어요.PixelPanel.tsx의onWheel은 뺐어요.panels/ImportImageModal.tsx는 미리보기 캔버스에 같은 리스너를 붙여요. 그림을 고르기 전엔 붙이지 않아서, 빈 미리보기 위에선 휠이 창을 굴려요. 리스너가 부르는clampScale은 컴포넌트 밖으로 올렸어요.두 곳 다
deltaY가 0 인 휠은 확대하지 않고 굴림으로 둬요. 트랙패드를 옆으로 밀 때나 Shift+휠이 그래요. 전엔deltaY < 0 ? 1 : -1이라 옆으로 밀면 한 칸 축소됐어요.시험은 넷이에요.
PixelPanel.test.tsx에 둘을 더했어요. 위아래 휠이 확대하고defaultPrevented가 참인지, 옆 휠은 그대로 굴림인지 하나, 코드 레이어를 띄운 뒤 픽셀 레이어를 골라도 휠이 먹는지 하나예요. 새ImportImageModal.test.tsx에 둘이에요. 그림 전엔 휠을 건드리지 않는지, 그림 뒤엔 108%, 100% 로 가고 굴림을 막는지예요. jsdom 도 passive 리스너 안의preventDefault()를 무시해요. 그래서 고치기 전 코드에서 넷 가운데 셋이 떨어졌어요.hasPixel을 deps 에서 잠깐 빼면 둘째 시험이 떨어지는 것도 봤어요.증거
web/에서 돌린 각 출력의 끝줄이에요.check:ci안의check:panels는Test Files 40 passed (40),Tests 523 passed (523)이에요. 바퀴 4 의 39, 519 에서 파일 하나, 시험 넷이 늘었어요.고치기 전 코드에 새 시험만 얹어 돌린 끝이에요.
dev(e7de77e)와 이 브랜치를 각각 빌드해서 Chromium 으로 열고, Pixel 탭에서 픽셀 레이어를 더한 뒤 뷰포트 한가운데서 휠을 돌렸어요. 줄마다 확대 배율과 뷰포트의 굴림 위치(왼쪽, 위)예요.그림 가져오기 창은
product_v2.jpg를 고르고 미리보기 위에서 돌렸어요. 390×844 와 1440×900 에선 창이 화면에 다 들어가 굴릴 데가 없어요. 경고만 3 에서 0 이 됐고 배율은 전과 뒤가 같아요(100% → 93% → 108%). 폰을 눕힌 844×390 에선 창 안이 162px 굴러요.사진은 휠을 다 돌린 뒤예요. 고친 뒤엔 확대해도 뷰포트가 왼쪽 위에 그대로 있어요. 고치기 전 사진은 같은 차례 뒤 100px 내려가 있어요.
실행법
http://localhost:3100/pattern-lab의 Pixel 탭에서 「+ Add pixel layer」를 누르고 그림 위에서 휠을 돌려요. 개발 도구 콘솔에 passive 경고가 없고, 확대해도 뷰포트가 제자리예요. Import image 로 그림을 하나 고르면 미리보기 위의 휠이 scale 을 바꿔요.가정
deltaY가 0)을 확대에서 뺐어요. 후보 줄엔 없는 말이지만, 막지 않은 굴림이 이제 막히니 옆 굴림까지 같이 막히지 않게 하는 것이 같은 일이라고 봤어요. 위아래 휠은 전처럼 언제나 확대예요.Changelog
Web
passive: false, and a sideways wheel scrolls instead of zooming out.바퀴
바퀴 5 · 후보 5 「Pattern Lab 에서 휠로 확대할 때 패널이 함께 구르지 않는다」
다음 바퀴
/product_v2.jpg가 이미 있고, 폰 단추의aria-pressed를 데스크톱 단추로 옮기면 돼요.BuildCards.tsx의Links꼴을 가져오면 돼요.AudioShots.tsx가 이미 언어별 alt 를 써서 본이 있어요.https://claude.ai/code/session_011XiRG6u444B5VRcNGmCgvy
Generated by Claude Code