Skip to content

[DONE] 기기 주소 칸을 비우거나 http:// 를 붙여 넣어도 「Send over Wi-Fi」 링크가 그 보드로 간다 - #150

Merged
patternflow-bot merged 2 commits into
devfrom
claude/lsh-pf-round51-d11wth
Oct 22, 2026
Merged

patternflow-bot merged 2 commits into
devfrom
claude/lsh-pf-round51-d11wth

Conversation

@patternflow-bot

@patternflow-bot patternflow-bot commented Oct 22, 2026 •

Copy link
Copy Markdown

lsh / https://claude.ai/code/session_01Hgcm29v2NjCuKz27EzDv9m

기기 주소 칸을 비우면 「Send over Wi-Fi」가 http:///patterns 로 가서 브라우저가 patterns 라는 호스트를 찾았고, 콘솔 탭에서 http://192.168.0.44/ 를 복사해 붙이면 http 라는 호스트로 갔다. 주소를 다듬는 함수 하나를 deviceHost.ts 에 두고 보내는 링크 여섯 곳과 설치 링크 네 곳이 다 그걸 쓰게 했으니, 머지하면 빈 칸은 patternflow.local 로, 붙여 넣은 주소는 그 보드로 간다.

좋아지는 것: 보드 주소를 붙여 넣은 그대로 보내도 보드에 닿는다 — 주소를 손으로 다듬지 않아도 된다

체크리스트

한 일

  • web/src/lib/community/deviceHost.ts 에 deviceHostName(value) 를 둔다. 앞뒤 공백과 앞의 http://·https:// 를 떼고, 첫 /·?·# 뒤를 버리고, 비면 patternflow.local 이다. useDeviceHost() 가 그 값을 host 로 돌려주고 patternsUrl 이 그걸로 링크를 만든다. 그래서 patternsUrl 을 쓰는 여섯 곳(DeckPanel.tsx:178, SendModuleModal.tsx:131·:240, DeckDock.tsx:474, DeckDetailClient.tsx:382·:549)은 고치지 않아도 따라온다.
  • deviceHost.trim() || "patternflow.local" 을 저마다 적던 네 곳(ZipDownload.tsx, ShippedPackCard.tsx, app/update/UpdateClient.tsx, app/features/TryInstall.tsx)이 훅의 host 를 쓴다.
  • 칸은 친 값을 그대로 보여 준다. 다듬는 것은 링크뿐이다.
  • 부르는 곳이 없고 가리키는 /api/community/builds/[id]/firmware 라우트도 없는 updateUrl 을 뺀다.

증거

dev(776387d)에서 새 시험을 먼저 돌렸다. 고치기 전 출력:

   × useDeviceHost > sends an emptied field to patternflow.local, not to a host called patterns
   × useDeviceHost > sends a pasted http:// address to the board, not to a host called http
AssertionError: expected 'patterns' to be 'patternflow.local' // Object.is equality
AssertionError: expected 'http' to be '192.168.0.44' // Object.is equality

고친 코드를 되돌린 채 ZipDownload.test.tsx 의 새 시험만:

   × zip surfaces > sends a pasted http:// address and an emptied field to a real board
AssertionError: expected 'http' to be '192.168.0.44' // Object.is equality

고친 뒤 npx vitest run src/lib/community/deviceHost.test.ts src/components/community/:

 Test Files  9 passed (9)
      Tests  49 passed (49)

web/ 에서 다섯 검사(head b10fa61):

npm ci                              → 32초, 오류 없음
npm run lint -- --max-warnings=0    → eslint --max-warnings=0 (출력 없음)
npm run typecheck                   → tsc --noEmit && tsc --noEmit -p ../tools/virtual-panel (출력 없음)
npm run build                       → exit 0, ƒ (Dynamic) server-rendered on demand
npm run check:ci                    → exit 0, Test Files 83 passed (83) · Tests 861 passed (861),
                                      drift 14 passed · links-absolute, roadmap skipped(책상)
npm run check:voice                 → read: 115 added lines in 7 files · check:voice: nothing found

PR 의 Actions(head b10fa61):

Drift checks | completed | success
Web CI | completed | success

빌드한 사이트(next start -p 3100)를 Chromium 390×844 로 열고 칸에 값을 넣은 뒤 링크의 new URL(href).host 를 쟀다:

/update field=""                     -> host=patternflow.local
/update field="http://192.168.0.44/" -> host=192.168.0.44
/update field="192.168.0.44"         -> host=192.168.0.44
/features field=""                     -> hosts=patternflow.local (2 links)
/features field="http://192.168.0.44/" -> hosts=192.168.0.44 (2 links)

화면 모양은 그대로이고 링크가 가는 곳만 바뀌어서 사진은 없다. 보내기 창과 덱 쪽은 커뮤니티 DB 가 있는 Pi 배포에서만 열려서 jsdom 시험으로 쟀다.

실행법

cd web
npx vitest run src/lib/community/deviceHost.test.ts src/components/community/ZipDownload.test.tsx

손으로 볼 때는 npm run build && npx next start -p 3100 뒤 /update 의 주소 칸에 http://192.168.0.44/ 를 붙이고 「Update over Wi-Fi」 단추 링크가 http://192.168.0.44/update?src=… 인지 본다.

가정

  • 줄은 「뒤의 / 를 뗀다」고 했는데, 첫 /·?·# 뒤를 다 버리게 했다. 콘솔의 Patterns 쪽 주소(http://192.168.0.44/patterns)를 붙여도 보드로 가게 하려고다.
  • updateUrl 은 줄이 「부르는 곳도 라우트도 없다」고 적은 함수라 다듬는 함수로 고치지 않고 뺐다. 펌웨어 갱신 링크는 /update, /features, editions 가 저마다 만든다.
  • editions 의 EditionCard.tsx:109 도 trim() || "patternflow.local" 만 해서 붙여 넣은 http:// 에 같은 일이 난다. 창작자 영역이라 고치지 않았다. deviceHostName 을 부르면 된다(incoming/ROUND.md 「창작자가 열어야 하는 것」의 editions 줄).
  • 표 밖: 가이드의 보내기 흉내(components/guide/desk/community/SendDialog.tsx:34)가 http://{shownHost}/patterns 를 글로 보여 주는데, 칸에 http:// 를 붙이면 http://http://… 로 찍힌다. 링크는 아니다.

Changelog

Web

  • Send over Wi-Fi reaches the board when the address field is empty or holds a pasted http:// address. An emptied field made http:///patterns, which a browser reads as a host called patterns, and http://192.168.0.44/ made a host called http. Every handoff and install link now cleans the address the same way, in lib/community/deviceHost.ts.

바퀴

바퀴 51 · 후보 7 「기기 주소 칸을 비우거나 http:// 를 붙여 넣어도 「Send over Wi-Fi」 링크가 그 보드로 간다」

경험

언제: 바퀴에서 /features 쪽의 「Try it」 주소 칸이나 링크를 브라우저로 잴 때
교훈: 그 칸은 닫힌 <details> 안이라 Playwright fill 이 「element is not visible」로 30초를 기다리니, 먼저 document.querySelectorAll("details").forEach(d => d.open = true) 로 연다
근거: #150 에서 /update 는 바로 재졌는데 /features 는 locator.fill: Timeout 30000ms exceeded 로 멈췄고, details 를 연 뒤 링크 2개의 호스트가 재졌다

다음 바퀴

  • 후보 8 「Lab 과 Live Editor 의 복사 단추가 복사에 실패하면 그렇다고 말한다」 · 클립보드가 거절하면 Lab 은 처리되지 않은 오류만, Live Editor 는 됐다고 거짓 alert 를 띄운다
  • 후보 9 「커뮤니티에서 Lab 으로 연 패턴을 손대지 않고 다시 올려도 크기 검사에 막히지 않는다」 · 받은 그대로 다시 올리는 길이 막히는 근간 버그다
  • 후보 10 「커뮤니티 API 가 원작 패턴의 라이선스를 거둔 MIT 나 CC0 로 바꾸는 요청을 거절한다」 · 라이선스 규칙을 서버가 지키지 않는 곳이다

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hgcm29v2NjCuKz27EzDv9m

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hgcm29v2NjCuKz27EzDv9m
@patternflow-bot patternflow-bot changed the title [WIP] pf 51바퀴 — 고를 일을 찾는 중 [WIP] 기기 주소 칸을 비우거나 http:// 를 붙여 넣어도 「Send over Wi-Fi」 링크가 그 보드로 간다 Oct 22, 2026
An emptied field made http:///patterns and a pasted http://192.168.0.44/ made a host called http.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hgcm29v2NjCuKz27EzDv9m
@patternflow-bot patternflow-bot changed the title [WIP] 기기 주소 칸을 비우거나 http:// 를 붙여 넣어도 「Send over Wi-Fi」 링크가 그 보드로 간다 [DONE] 기기 주소 칸을 비우거나 http:// 를 붙여 넣어도 「Send over Wi-Fi」 링크가 그 보드로 간다 Oct 22, 2026
@patternflow-bot
patternflow-bot marked this pull request as ready for review October 22, 2026 02:20
@patternflow-bot
patternflow-bot merged commit 39cf879 into dev Oct 22, 2026
2 checks passed
@patternflow-bot
patternflow-bot deleted the claude/lsh-pf-round51-d11wth branch October 22, 2026 02:22
engmung pushed a commit to engmung/Patternflow that referenced this pull request Oct 22, 2026
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