Skip to content

✨Feat: node page layout #56

Merged
jjangminii merged 8 commits intodevelopfrom
feat/#55/node-page-layout
Oct 28, 2025
Merged

✨Feat: node page layout #56
jjangminii merged 8 commits intodevelopfrom
feat/#55/node-page-layout

Conversation

@jjangminii
Copy link
Copy Markdown
Contributor

@jjangminii jjangminii commented Oct 26, 2025

🔥 작업 내용

  • node page layout

🤔 추후 작업 사항

  • 로그인 여부 체크
  • 리워드 페이지로 이동 , 위치 에러일경우 모달창

🔗 이슈

PR Point (To Reviewer)

  • 따로 특별한 이상은 없었으나 기획/디자인측하고 상의해볼 문제가 조금 있었어요 추후 답변오면 반영하겠습니다

📸 피그마 스크린샷 or 기능 GIF

(작업 내역 스크린샷)

2025-10-26.5.22.41.mov

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 노드 상세 페이지 추가로 보드 항목 클릭 시 개별 정보 조회 가능
    • 위치 조회 버튼 추가로 기기 위치 요청 및 처리 가능
    • PressStamp 아이콘 추가
  • 스타일

    • 카드 및 주소 복사 컴포넌트의 너비를 컨테이너 기반으로 조정하여 반응성 개선
  • 리팩토링

    • 라우팅 호출 방식 변경으로 뒤로가기·페이지 이동 동작 개선

@jjangminii jjangminii linked an issue Oct 26, 2025 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel bot commented Oct 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
af-fe Ready Ready Preview Comment Oct 26, 2025 8:28am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 26, 2025

Walkthrough

노드 페이지를 새로 추가하고 여러 페이지에서 next/router의 기본 import를 useRouter 훅으로 전환했습니다. 위치 획득 유틸(getLocation)을 추가하고, 일부 공유 컴포넌트의 너비 스타일과 아이콘 목록에 PressStamp를 등록했습니다.

Changes

코호트 / 파일(s) 변경 요약
라우터 훅 전환
src/pages/main/Board.tsx, src/pages/main/index.tsx, src/pages/main/components/board/Boardgame.tsx
next/router의 기본 import를 제거하고 useRouter 훅을 도입해 컴포넌트 내에서 router 인스턴스를 사용하도록 변경(이전 동작 유지, 클릭 시 push/back 호출).
노드 페이지 추가
src/pages/main/Node.tsx
새 페이지 컴포넌트(기본 export): 헤더, 보드 이미지, 플로팅 버튼, LocationCard 및 AddressCopy 사용, 라우트 쿼리로부터 제목 추출 및 위치 조회 트리거 구현.
보드 게임 네비게이션
src/pages/main/components/board/Boardgame.tsx
활성 셀 클릭 시 /main/Nodelabel 쿼리 전달하여 라우팅하도록 onClick 핸들러 변경(로그인 체크 TODO 주석 포함).
공유 컴포넌트 스타일 조정
src/shared/components/button/AddressCopy.tsx, src/shared/components/container/Card.tsx
고정 너비(w-[35.4rem], w-[17rem] 등) 클래스를 w-full로 변경하여 크기 변형 조정.
아이콘 추가/재정렬
src/shared/icons/iconNames.ts, src/shared/icons/index.ts
PressStampiconNames 배열에 추가하고 관련 SVG를 import/reindex(파일 내 아이콘 import 순서 일부 변경).
위치 유틸리티 추가
src/shared/utils/handleGetLocation.ts
Geolocation API 래퍼 getLocation(onSuccess, onError?) 추가(고정 옵션: enableHighAccuracy: true, timeout: 5000, maximumAge: 0).

Sequence Diagram(s)

sequenceDiagram
    participant U as 사용자
    participant BG as Boardgame 컴포넌트
    participant Router as Next useRouter
    participant Node as Node 페이지
    participant Geo as navigator.geolocation
    participant CB as 콜백

    U->>BG: 보드 셀 클릭
    BG->>Router: router.push("/main/Node?label=...")
    Router->>Node: 페이지 로드 (쿼리 포함)
    U->>Node: 플로팅 버튼 클릭
    Node->>Geo: getLocation(onSuccess, onError)
    Geo->>CB: 위치 정보 반환 / 에러
    CB->>Node: 위치 상태 업데이트 / 에러 처리
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • 주의 확인 항목:
    • src/pages/main/Node.tsx: 라우트 쿼리 처리, 상태/콜백 안전성, UI 조건부 렌더링 점검
    • src/shared/utils/handleGetLocation.ts: 브라우저 호환성, 에러 메시지(한글 로그) 및 옵션 검토
    • 아이콘 변경(iconNamesicons/index.ts)으로 인한 타입/사용처 영향 점검
    • 스타일 변경(w-full 대체)이 레이아웃에 미치는 영향 확인

Possibly related PRs

Suggested labels

feat

Suggested reviewers

  • skyblue1232
  • KongMezu

Poem

🐰 탭을 톡, 페이지가 훌쩍 건너가네
쿼리 한 줌에 제목이 피어나고,
발자국 따라 위치를 캐내는 손길,
아이콘 새로 달고 스타일 옷 갈아입어,
당근 들고 축하하는 토끼 한 마리 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed PR 제목 "✨Feat: node page layout"은 변경사항의 주요 내용인 노드 페이지 레이아웃 구성을 명확하게 반영하고 있습니다. 실제로 새로운 Node.tsx 페이지 컴포넌트가 추가되었고, 관련 라우팅 및 UI 컴포넌트들이 함께 수정되어 노드 페이지를 완성하는 것으로 확인됩니다. 제목은 간결하고 구체적이며 개발자 관점에서 주요 변경사항을 효과적으로 전달합니다.
Linked Issues Check ✅ Passed PR의 변경사항이 연결된 이슈 #55의 목표인 "노드 페이지 레이아웃 구성"을 구현하고 있습니다. 새로운 Node.tsx 페이지 컴포넌트 추가, 라우팅 네비게이션 설정, UI 컴포넌트 반응형 개선, 위치 정보 기능 추가 등 모든 변경사항이 노드 페이지 완성을 위한 것입니다. PR 설명에서 명시한 추후 작업 사항(로그인 체크, 리워드 페이지 이동, 위치 에러 모달)도 이슈와 일관성 있게 연결되어 있습니다.
Out of Scope Changes Check ✅ Passed 변경사항들이 대체로 노드 페이지 레이아웃 구성이라는 범위 내에 있습니다. AddressCopy.tsx와 Card.tsx의 스타일 변경, handleGetLocation.ts 추가 등은 노드 페이지의 UI 및 기능을 완성하기 위한 필요한 변경이며, PR 설명에서 "기획/디자인측하고 상의해볼 문제"로 이미 인식되고 있습니다. 모든 코드 변경사항이 노드 페이지 완성을 직간접적으로 지원합니다.
Description Check ✅ Passed PR 설명이 저장소의 템플릿 구조를 따르고 있으며 모든 필수 섹션이 작성되어 있습니다. 작업 내용, 추후 작업 사항, 이슈 연결(#55), 리뷰어를 위한 PR Point, 그리고 피그마 스크린샷이 모두 포함되어 있습니다. 작업 내용 부분이 다소 간단하지만, 전체적으로 템플릿을 충실히 따르고 있으며 필요한 정보가 충분히 제공되고 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#55/node-page-layout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jjangminii jjangminii changed the title Feat: node page layout ✨Feat: node page layout Oct 26, 2025
@github-actions
Copy link
Copy Markdown

🏷️ Labeler has automatically applied labels based on your PR title, branch name, or commit message.
Please verify that they are correct before merging.

@github-actions github-actions bot added the comment 필요한 주석 추가 및 변경 label Oct 26, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/shared/components/button/AddressCopy.tsx (1)

37-48: 클릭 가능한 div의 접근성 보강 + copied 상태 활용

  • 키보드 접근 불가(div+onClick). role/tabIndex/onKeyDown 필요.
  • copied 상태가 UI에 반영되지 않음.

아래처럼 최소 수정 제안:

   const AddressCopy = ({
@@
 }: AddressCopyProps) => {
   const [copied, setCopied] = useState(false);
 
+  const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {
+    if (e.key === 'Enter' || e.key === ' ') {
+      e.preventDefault();
+      handleCopy();
+    }
+  };
+
   const handleCopy = () => {
@@
   return (
-    <div
+    <div
       onClick={handleCopy}
+      role="button"
+      tabIndex={0}
+      onKeyDown={handleKeyDown}
+      aria-pressed={copied}
+      aria-label={copied ? `${label} 복사됨` : `${label} 복사`}
       className={cn(
         addressCopyStyle({ variant }),
         'w-full h-[4rem] px-[1.3rem] py-[1rem] gap-[0.4rem]',
         'cursor-pointer select-none',
         className,
       )}

Also applies to: 51-58

src/pages/main/index.tsx (1)

34-46: 섹션 onClick 네비게이션은 접근성에 취약 — Link 사용 권장

키보드/스크린리더 접근을 위해 Link로 교체해 주세요. 프리페치 이점도 있습니다.

-import { useRouter } from 'next/router';
+import { useRouter } from 'next/router';
+import Link from 'next/link';
@@
-        <section
-          onClick={() => {
-            router.push('/main/Board');
-          }}
-        >
-          <Image
-            src='/assets/board.svg'
-            alt='보드판'
-            width={354}
-            height={426.36}
-            className='w-full h-auto object-cover block'
-          />
-        </section>
+        <Link href="/main/Board" className="block">
+          <Image
+            src="/assets/board.svg"
+            alt="보드판"
+            width={354}
+            height={426.36}
+            className="w-full h-auto object-cover block"
+          />
+        </Link>
♻️ Duplicate comments (1)
src/shared/icons/index.ts (1)

1-22: 자동 생성 파일의 수정 프로세스를 확인하세요.

이 파일도 iconNames.ts와 마찬가지로 자동 생성 파일입니다. PressStamp.svg 추가를 포함한 모든 변경사항이 적절한 생성 도구를 통해 이루어졌는지 확인이 필요합니다. 수동 편집 시 향후 유지보수에 문제가 발생할 수 있습니다.

참고: iconNames.ts에서 요청한 검증 스크립트를 통해 함께 확인할 수 있습니다.

🧹 Nitpick comments (4)
src/shared/components/container/Card.tsx (1)

14-16: w-full로의 전환은 합리적이지만 컨테이너 제약 확인 필요

  • flex-shrink-0 + w-full 조합은 가로 플렉스 컨텍스트에서 다수의 카드가 나란히 있을 때 수평 스크롤을 유발할 수 있습니다. 사용 컨테이너에서 max-w 또는 column 레이아웃 보장 여부를 확인해 주세요.
  • 필요 시 size 변형에 max-w 옵션을 추가하는 것도 고려해 보세요(예: max-w-[35.4rem]).
src/shared/utils/handleGetLocation.ts (1)

6-15: SSR/보안 컨텍스트 가드 추가 제안

  • SSR에서 navigator 접근 방지.
  • HTTPS가 아니면 Geolocation 동작하지 않음(로컬 제외). isSecureContext 체크 권장.
 export const getLocation = (
   onSuccess: (pos: GeolocationPosition) => void,
   onError?: (err: GeolocationPositionError) => void,
 ) => {
-  if (!navigator.geolocation) {
+  if (typeof window === 'undefined') {
+    return;
+  }
+  if (!('geolocation' in navigator)) {
     console.error('❌ 현재 브라우저에서 위치 정보 사용이 불가능합니다.');
     return;
   }
+  if (!isSecureContext) {
+    console.error('❌ 보안 컨텍스트(HTTPS)가 아니어서 위치 정보를 가져올 수 없습니다.');
+    return;
+  }
 
   navigator.geolocation.getCurrentPosition(onSuccess, onError, {
     enableHighAccuracy: true,
     timeout: 5000,
     maximumAge: 0,
   });
 };
src/pages/main/Node.tsx (2)

16-16: 모바일 100vh 이슈 — dvh/svh 사용 권장

모바일 브라우저 주소창 영역 변화로 100vh가 화면을 넘칠 수 있습니다. dvh/svh 또는 임의 값으로 대체 권장.

-    <div className='relative w-full h-[100vh] overflow-auto px-[2.4rem]'>
+    <div className='relative w-full min-h-[100dvh] overflow-auto px-[2.4rem]'>

36-44: 지오로케이션 UX: 실패/권한 거부 처리

현재 콘솔 로깅만 존재합니다. TODO에 맞춰 모달/토스트 + 재시도/권한 안내(설정 이동)가 필요합니다. 성공 시 보상 페이지로 라우팅 로직도 함께 포함을 권장합니다. 원하시면 기본 모달/토스트 유틸 코드 드리겠습니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07d6602 and 813922e.

⛔ Files ignored due to path filters (1)
  • src/shared/icons/source/PressStamp.svg is excluded by !**/*.svg
📒 Files selected for processing (9)
  • src/pages/main/Board.tsx (1 hunks)
  • src/pages/main/Node.tsx (1 hunks)
  • src/pages/main/components/board/Boardgame.tsx (2 hunks)
  • src/pages/main/index.tsx (1 hunks)
  • src/shared/components/button/AddressCopy.tsx (1 hunks)
  • src/shared/components/container/Card.tsx (1 hunks)
  • src/shared/icons/iconNames.ts (1 hunks)
  • src/shared/icons/index.ts (1 hunks)
  • src/shared/utils/handleGetLocation.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/pages/main/Node.tsx (2)
src/shared/lib/utils.ts (1)
  • cn (71-73)
src/shared/utils/handleGetLocation.ts (1)
  • getLocation (2-16)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-and-deploy
🔇 Additional comments (5)
src/shared/icons/iconNames.ts (1)

1-22: 자동 생성 검증 완료 - 정상 상태입니다.

생성 스크립트(generate-icon-list.ts)를 검토한 결과, 다음이 확인되었습니다:

  • 스크립트는 src/shared/icons/source/ 디렉토리에서 모든 .svg 파일을 자동으로 검색합니다
  • 아이콘 이름을 추출한 후 자동으로 알파벳순으로 정렬합니다 (.sort())
  • PressStamp.svg가 존재하므로 스크립트 실행 시 자동으로 포함됩니다
  • 제공된 코드에서 PressStamp는 MapPin_과 Save 사이에 올바르게 배치되어 있습니다

파일은 pnpm icons:gen 명령으로 정상적으로 생성되었습니다.

src/shared/components/button/AddressCopy.tsx (1)

55-58: w-full 전환은 OK

레이아웃 일관성 측면에서 적절합니다.

src/pages/main/Board.tsx (1)

3-7: useRouter 전환 LGTM

Pages Router(파일 경로: src/pages/...)에서 next/router 사용은 적합합니다. App Router 사용 파일과 혼용되지 않는지만 확인해 주세요.

src/pages/main/components/board/Boardgame.tsx (1)

36-45: 경로 케이스 일관성 지적은 부정확 - 현재 일치하고 있음

검증 결과:

  • 파일명 Node.tsx와 라우트 /main/Node 이미 일치
  • 프로젝트 전체 라우팅 컨벤션: 파스칼케이스 (/main/Board, /main/Node 등)
  • 소문자로 변경 제안은 실제 프로젝트 컨벤션과 맞지 않음

A11y 개선는 선택사항 (Good Practice)

프로젝트 기존 패턴(CustomDropdown.tsx 등)에서 role, tabIndex, onKeyDown, aria-label 구현이 있으므로, div+onClick의 키보드 접근성 개선는 유용하나 필수는 아님.

Likely an incorrect or invalid review comment.

src/pages/main/Node.tsx (1)

29-33: 리뷰 댓글이 부정확합니다. 조치가 필요하지 않습니다.

Tailwind CSS v4.1.14에서 blur-xs는 표준 유틸리티 클래스이며, filter: blur(4px)로 매핑됩니다. 현재 코드의 사용이 올바르므로 별도의 변경이나 대체가 필요하지 않습니다.

Likely an incorrect or invalid review comment.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 813922e and 0538d16.

📒 Files selected for processing (1)
  • src/shared/utils/handleGetLocation.ts (1 hunks)
🔇 Additional comments (2)
src/shared/utils/handleGetLocation.ts (2)

1-4: 함수 시그니처가 명확하고 타입이 적절합니다.

콜백 기반 설계가 깔끔하고, TypeScript 타입이 올바르게 지정되어 있습니다.


10-14: 타임아웃 설정이 사용 사례에 적합한지 확인하세요.

5초 타임아웃은 GPS cold start 또는 약한 신호 환경에서 부족할 수 있습니다. 특히 실내나 건물 밀집 지역에서 위치를 처음 가져올 때 더 오래 걸릴 수 있습니다. 노드 페이지의 사용자 경험을 고려하여 타임아웃이 충분한지 테스트해 보시기 바랍니다.

Comment on lines +5 to +8
if (!navigator.geolocation) {
console.error('❌ 현재 브라우저에서 위치 정보 사용이 불가능합니다.');
return;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

위치 정보 미지원 시 onError 콜백을 호출해야 합니다.

현재는 콘솔 로그만 남기고 조용히 반환하므로, 호출자가 이 에러를 프로그래밍 방식으로 처리할 수 없습니다. onError 콜백이 제공된 경우 이를 호출하여 일관된 에러 처리를 보장하세요.

다음 diff를 적용하여 수정하세요:

 export const getLocation = (
   onSuccess: (pos: GeolocationPosition) => void,
   onError?: (err: GeolocationPositionError) => void,
 ) => {
   if (!navigator.geolocation) {
     console.error('❌ 현재 브라우저에서 위치 정보 사용이 불가능합니다.');
+    if (onError) {
+      // GeolocationPositionError 인터페이스에 맞춰 에러 객체 전달
+      onError({
+        code: 0,
+        message: '현재 브라우저에서 위치 정보 사용이 불가능합니다.',
+        PERMISSION_DENIED: 1,
+        POSITION_UNAVAILABLE: 2,
+        TIMEOUT: 3,
+      } as GeolocationPositionError);
+    }
     return;
   }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/shared/utils/handleGetLocation.ts around lines 5 to 8, when
navigator.geolocation is not available the function currently only logs to
console and returns; update it to, if an onError callback is provided, invoke
onError with an Error (or a descriptive error object/message) describing that
location is unsupported, then return — ensure you still keep the console.error
for backwards visibility but call onError so callers can handle the failure
programmatically.

@jjangminii jjangminii added the feat 새로운 기능 추가 / 퍼블리싱 label Oct 26, 2025
Copy link
Copy Markdown
Contributor

@KongMezu KongMezu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

버튼 width 수정 감사합니다 :) 많이 도움 받네요 큰 리뷰가 없어서(잘하셔서요)
금방 주소복사 수정해서 가져오도록 하겠습니다. approve 하겠습니다!

className={cn(
addressCopyStyle({ variant }),
'w-[35.4rem] h-[4rem] px-[1.3rem] py-[1rem] gap-[0.4rem]',
'w-full h-[4rem] px-[1.3rem] py-[1rem] gap-[0.4rem]',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

full 처리 감사합니다 :) 빠르게 address 버튼 수정해두겠습니다.

@jjangminii jjangminii merged commit ffea974 into develop Oct 28, 2025
6 checks passed
This was referenced Oct 29, 2025
This was referenced Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comment 필요한 주석 추가 및 변경 feat 새로운 기능 추가 / 퍼블리싱

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 노드 페아지 레이아웃 구성

2 participants