Skip to content

[Fix] 자잘한 버그 수정 #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 22, 2025
Merged

[Fix] 자잘한 버그 수정 #235

merged 7 commits into from
Apr 22, 2025

Conversation

SeieunYoo
Copy link
Collaborator

@SeieunYoo SeieunYoo commented Apr 22, 2025

🎉 변경 사항

  • 온라인/오프라인 스터디 타입인지에 따른 분기처리 isOnlineOfflineStudyType 이라는 유틸로 분리
  • admin client dev 실행시키는 스크립트 추가
pnpm admin
pnpm client
  • 멘토용 페이지 active 네비게이션 처리 안되는 버그 수정
    • NavBar 최상단 레이아웃에서 불러오는 걸로 수정
  • 학생용 페이지 main 태그는 최상단 레이아웃에서만 불러오는 것으로 수정
  • 네비게이션 currentPath 일때는 라우팅 가지 않도록 수정

🚩 관련 이슈

🙏 여기는 꼭 봐주세요!

Summary by CodeRabbit

  • New Features
    • 온라인/오프라인 스터디 타입 판별을 위한 유틸리티 함수가 추가되었습니다.
    • package.json에 admin과 client 개발 서버 실행 스크립트가 추가되었습니다.
  • 개선사항
    • 네비게이션 메뉴에서 활성화된 항목 클릭 시 페이지 이동이 방지됩니다.
    • 관리자 페이지의 네비게이션 구조가 개선되었습니다.
    • 커리큘럼 관련 컴포넌트에서 스터디 타입 처리 방식이 명확해졌습니다.
    • 스터디 상세 페이지에서 출석 리스트가 온라인/오프라인 스터디에만 표시되도록 변경되었습니다.
    • 클라이언트 및 관리자 레이아웃에서 불필요한 main 태그가 제거되거나 변경되어 구조가 간소화되었습니다.
  • 버그 수정
    • 일부 레이아웃에서 불필요한 main 태그가 제거되어 구조가 간소화되었습니다.
  • 기타
    • CODEOWNERS 파일이 최신화되었습니다.

Copy link

coderabbitai bot commented Apr 22, 2025

Warning

Rate limit exceeded

@SeieunYoo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 59 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c654fd9 and b8504dd.

📒 Files selected for processing (1)
  • apps/client/app/(afterLogin)/(pc)/my-study/[studyId]/_components/StudyCurriculum/CurriculumItem.tsx (3 hunks)

"""

Walkthrough

이번 변경에서는 네비게이션 및 레이아웃 구조를 일부 조정하고, 스터디 타입 관련 렌더링 로직을 개선하였습니다. 주요 변경점으로는 Navbar의 위치 조정, CurriculumList 및 CurriculumListItem에서 studyType 타입을 명확히 지정하고, 온라인/오프라인 스터디 타입 여부를 확인하는 유틸리티 함수 도입이 있습니다. 또한, package.json에 admin과 client 앱을 위한 실행 스크립트가 추가되고, CODEOWNERS 파일의 코드 오너가 갱신되었습니다. 내비게이션 컴포넌트에서는 활성화된 메뉴 클릭 시 이동을 방지하는 기능이 추가되었습니다.

Changes

파일/경로 요약 변경 내용 요약
.github/CODEOWNERS 코드 오너에서 @eugene028, @strawji02를 제거하고 @jsomnium을 추가
apps/admin/app/layout.tsx Navbar 컴포넌트 import 및 렌더링 추가
apps/admin/app/students/layout.tsx
apps/admin/app/studies/layout.tsx
Navbar 컴포넌트 import 및 렌더링 제거
apps/admin/app/studies/[studyId]/_components/curriculum/CurriculumList.tsx studyType prop 타입을 string?에서 필수 StudyType으로 변경
apps/admin/app/studies/[studyId]/_components/curriculum/CurriculumListItem.tsx studyType prop을 필수 StudyType으로 변경, 렌더링 조건을 유틸리티 함수로 대체
apps/admin/app/studies/[studyId]/page.tsx AttendanceListCurriculumList 렌더링 조건에 isOnlineOfflineStudyType 함수 적용, 불필요한 import 제거
apps/admin/components/Navbar.tsx 네비게이션 링크 경로를 /studies로 변경, 하위 메뉴 href에서 접두어 제거
apps/admin/utils/isOnlineOfflineStudyType.ts
apps/client/utils/isOnlineOfflineStudyType.ts
isOnlineOfflineStudyType 유틸리티 함수 신설 (StudyType이 "ONLINE" 또는 "OFFLINE"인지 판별)
apps/client/app/(afterLogin)/(pc)/my-page/layout.tsx
apps/client/app/(afterLogin)/(pc)/study-apply/layout.tsx
레이아웃의 최상위 wrapper를 <main>에서 React fragment로 변경
apps/client/app/(afterLogin)/(pc)/my-study/layout.tsx 레이아웃의 최상위 wrapper를 <main>에서 <div>로 변경
apps/client/app/(afterLogin)/(pc)/my-study/[studyId]/_components/StudyCurriculum/CurriculumItem.tsx 렌더링 조건을 유틸리티 함수 기반으로 변경, 기존 boolean 변수 제거
package.json "admin""client" 실행 스크립트 추가, "storybook" 뒤에 콤마 추가
packages/ui/src/components/NavItem/index.tsx 활성화된 네비게이션 항목 클릭 시 이동 방지 기능 추가, href 템플릿 문자열 단순화

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Navbar
    participant Router

    User->>Navbar: 메뉴 항목 클릭
    alt 활성화된(현재) 메뉴 클릭
        Navbar-->>User: e.preventDefault()로 이동 방지
    else 비활성 메뉴 클릭
        Navbar->>Router: 해당 경로로 이동
    end
Loading
sequenceDiagram
    participant CurriculumListItem
    participant isOnlineOfflineStudyType

    CurriculumListItem->>isOnlineOfflineStudyType: studyType 전달
    isOnlineOfflineStudyType-->>CurriculumListItem: true/false 반환
    alt true (온라인/오프라인)
        CurriculumListItem-->>UI: 날짜/시간, 제목, 설명 렌더링
    else false (과제)
        CurriculumListItem-->>UI: 과제 정보만 렌더링
    end
Loading

Possibly related PRs

Suggested labels

⛏멘토용

Suggested reviewers

  • chocoboy08
  • eugene028

Poem

🐇
네비게이션 hop hop, 클릭을 막아
스터디 타입도 더 똑똑해졌지!
온라인, 오프라인 구분은 이제 함수에게 맡기고
새 코드 오너도 토끼와 인사해요
레이아웃은 더 깔끔하게,
스크립트도 추가해서
오늘도 코드밭에 당근이 풍성해졌어요!
🥕
"""


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copy link

@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 a051864 and c654fd9.

📒 Files selected for processing (16)
  • .github/CODEOWNERS (1 hunks)
  • apps/admin/app/layout.tsx (2 hunks)
  • apps/admin/app/students/layout.tsx (0 hunks)
  • apps/admin/app/studies/[studyId]/_components/curriculum/CurriculumList.tsx (2 hunks)
  • apps/admin/app/studies/[studyId]/_components/curriculum/CurriculumListItem.tsx (3 hunks)
  • apps/admin/app/studies/[studyId]/page.tsx (2 hunks)
  • apps/admin/app/studies/layout.tsx (0 hunks)
  • apps/admin/components/Navbar.tsx (1 hunks)
  • apps/admin/utils/isOnlineOfflineStudyType.ts (1 hunks)
  • apps/client/app/(afterLogin)/(pc)/my-page/layout.tsx (1 hunks)
  • apps/client/app/(afterLogin)/(pc)/my-study/[studyId]/_components/StudyCurriculum/CurriculumItem.tsx (2 hunks)
  • apps/client/app/(afterLogin)/(pc)/my-study/layout.tsx (1 hunks)
  • apps/client/app/(afterLogin)/(pc)/study-apply/layout.tsx (1 hunks)
  • apps/client/utils/isOnlineOfflineStudyType.ts (1 hunks)
  • package.json (1 hunks)
  • packages/ui/src/components/NavItem/index.tsx (2 hunks)
💤 Files with no reviewable changes (2)
  • apps/admin/app/studies/layout.tsx
  • apps/admin/app/students/layout.tsx
🧰 Additional context used
🧬 Code Graph Analysis (6)
apps/admin/utils/isOnlineOfflineStudyType.ts (1)
apps/client/utils/isOnlineOfflineStudyType.ts (1)
  • isOnlineOfflineStudyType (3-4)
apps/client/utils/isOnlineOfflineStudyType.ts (1)
apps/admin/utils/isOnlineOfflineStudyType.ts (1)
  • isOnlineOfflineStudyType (3-4)
apps/admin/app/studies/[studyId]/page.tsx (1)
apps/admin/utils/isOnlineOfflineStudyType.ts (1)
  • isOnlineOfflineStudyType (3-4)
apps/admin/app/studies/[studyId]/_components/curriculum/CurriculumList.tsx (1)
apps/admin/types/entities/study.ts (1)
  • StudyType (10-10)
apps/client/app/(afterLogin)/(pc)/my-study/[studyId]/_components/StudyCurriculum/CurriculumItem.tsx (1)
apps/client/utils/isOnlineOfflineStudyType.ts (1)
  • isOnlineOfflineStudyType (3-4)
apps/admin/app/studies/[studyId]/_components/curriculum/CurriculumListItem.tsx (3)
apps/admin/types/dtos/studyList.ts (1)
  • StudySessionApiResponseV2Dto (35-46)
apps/admin/types/entities/study.ts (1)
  • StudyType (10-10)
apps/admin/utils/isOnlineOfflineStudyType.ts (1)
  • isOnlineOfflineStudyType (3-4)
🔇 Additional comments (25)
.github/CODEOWNERS (1)

1-1: 코드 오너십 업데이트가 적절하게 이루어졌습니다.

코드 오너십 변경이 잘 이루어졌습니다. 이전 코드 오너(@eugene028, @strawji02)가 제거되고 새로운 코드 오너(@jsomnium)가 추가되었으며, 기존 오너(@SeieunYoo, @chocoboy08)는 유지되었습니다.

apps/client/app/(afterLogin)/(pc)/my-page/layout.tsx (1)

15-18:

❓ Verification inconclusive

시맨틱 HTML 구조 변경에 대한 확인이 필요합니다.

<main> 태그를 React 프래그먼트(<></>)로 변경하셨네요. 이러한 변경은 apps/client/app/(afterLogin)/(pc)/study-apply/layout.tsx 파일과 동일한 방식으로 이루어졌습니다.

<main> 태그를 제거하면 페이지의 시맨틱 구조와 접근성에 영향을 줄 수 있습니다. 이는 여러 레이아웃에서 일관되게 변경된 것으로 보이므로, 상위 레이아웃에서 <main> 태그를 사용하고 있는지 확인하는 것이 중요합니다.

다음 스크립트를 통해 상위 레이아웃에서 <main> 태그가 적절히 사용되고 있는지 확인해주세요:


🏁 Script executed:

#!/bin/bash
# 최상위 레이아웃 파일에서 main 태그 사용 확인
cat apps/client/app/(afterLogin)/layout.tsx 2>/dev/null | grep -A 5 -B 5 "<main" || echo "최상위 레이아웃 파일이 없거나 main 태그를 사용하지 않습니다."

Length of output: 310


죄송합니다, 이전 스크립트에서 경로의 괄호로 인해 오류가 발생했습니다. 다음 스크립트로 최상위 레이아웃 파일을 찾아 <main> 태그 사용 여부를 다시 확인해주세요:

#!/bin/bash
# apps/client/app 내부에서 layout.tsx 파일 경로 및 <main> 태그 확인
FILE=$(fd layout.tsx apps/client/app -t f | head -n1)
if [ -z "$FILE" ]; then
  echo "layout.tsx 파일을 찾을 수 없습니다."
else
  echo "파일 경로: $FILE"
  grep -Hn "<main" "$FILE" || echo "<main> 태그를 찾을 수 없습니다."
fi

다음 스크립트로 (afterLogin) 경로 이슈를 우회하여 apps/client/app 하위의 모든 layout.tsx 파일에서 <main> 태그 사용 여부를 확인해주세요:

#!/bin/bash
# apps/client/app 하위 layout.tsx 파일들에서 <main> 태그 확인
fd layout.tsx apps/client/app -t f | while read -r FILE; do
  echo "파일: $FILE"
  grep -Hn '<main' "$FILE" || echo "  → <main> 태그를 찾을 수 없습니다."
done

아래 스크립트를 실행해서 apps/client/app 하위의 모든 layout.tsx 파일에서 <main> 태그 사용 여부를 확인해주세요. 결과를 알려주시면 시맨틱 구조 변경의 영향도를 정확히 검토할 수 있습니다.

#!/usr/bin/env bash
echo "apps/client/app 하위 layout.tsx에서 <main> 태그 검증"
find apps/client/app -type f -name "layout.tsx" | while read -r file; do
  echo "파일: $file"
  if grep -q "<main" "$file"; then
    grep -Hn "<main" "$file"
  else
    echo "  → <main> 태그를 사용하지 않음"
  fi
done

죄송합니다. 이전 스크립트가 실행되지 않은 것 같습니다. 아래 스크립트를 실행해 apps/client/app 하위의 모든 layout.tsx 파일에서 <main> 태그 사용 여부를 확인해주세요. 결과를 알려주시면 시맨틱 구조 변경 영향도를 정확히 검토하겠습니다.

#!/usr/bin/env bash
echo "apps/client/app 하위 layout.tsx에서 <main> 태그 검증 시작"
find apps/client/app -type f -name "layout.tsx" | while IFS= read -r FILE; do
  echo "파일: $FILE"
  if grep -q "<main" "$FILE"; then
    grep -Hn "<main" "$FILE"
  else
    echo "  → <main> 태그 사용 안함"
  fi
done

죄송합니다. 이전 스크립트가 여전히 실행되지 않은 것 같습니다. 아래 스크립트를 실행하셔서 apps/client/app 하위에서 <main> 태그가 어디에 사용되고 있는지 확인 부탁드립니다. 결과를 알려주시면 시맨틱 구조 변경 영향도를 정확히 검토하겠습니다.

#!/usr/bin/env bash
echo "apps/client/app 하위에서 <main> 태그 위치 검색 시작"
grep -R -n "<main[^>]*>" apps/client/app || echo "→ <main> 태그 사용 위치를 찾을 수 없습니다."

상위 레이아웃에서 <main> 태그가 여전히 사용되고 있는지 직접 확인 부탁드립니다.
apps/client/app/(afterLogin)/layout.tsx 등 최상위 layout.tsx 파일에 <main> 태그가 있어야 시맨틱 구조와 접근성 일관성이 유지됩니다.

확인 후 결과를 알려주시면 감사하겠습니다.

package.json (1)

19-21: 개발 편의를 위한 스크립트 추가가 잘 되었습니다.

admin과 client 앱을 위한 개발 스크립트를 추가해주셨네요. 이제 pnpm adminpnpm client 명령어로 각각의 개발 서버를 쉽게 실행할 수 있어 개발 편의성이 향상되었습니다. 좋은 개선사항입니다!

apps/admin/utils/isOnlineOfflineStudyType.ts (1)

1-4: 우수한 유틸리티 함수 구현

스터디 타입이 온라인 또는 오프라인인지 확인하는 함수를 명확하게 구현했습니다. 단일 책임 원칙을 잘 따르고 있으며, 함수명이 기능을 명확히 설명하고 있습니다.

클라이언트 앱에서도 동일한 유틸리티가 구현되어 있어 코드베이스 전반에 걸쳐 일관성을 유지하는 좋은 접근법입니다.

apps/client/utils/isOnlineOfflineStudyType.ts (1)

1-4: 일관된 유틸리티 함수 구현

관리자 앱에 구현된 동일한 함수와 일관성 있게 구현되었습니다. 스터디 타입 체크 로직을 별도 함수로 분리하여 코드 가독성과 재사용성을 높였습니다.

import 경로가 약간 다르지만(types/entities/common/study), 클라이언트 앱에 맞게 적절히 조정된 것으로 보입니다.

apps/client/app/(afterLogin)/(pc)/my-study/layout.tsx (1)

16-19: 시맨틱 태그 변경에 대한 접근성 검토 필요

<main> 태그에서 <div> 태그로 변경하셨습니다. 이는 HTML 시맨틱 구조에 영향을 줄 수 있습니다.

<main> 태그는 페이지의 주요 콘텐츠를 나타내는 시맨틱 의미가 있으며, 스크린 리더 등 접근성 도구에서 중요한 역할을 합니다. 상위 레이아웃에서 이미 <main> 태그를 사용하고 있는지, 혹은 이 변경이 접근성에 미치는 영향이 있는지 확인해보세요.

apps/client/app/(afterLogin)/(pc)/my-study/[studyId]/_components/StudyCurriculum/CurriculumItem.tsx (3)

16-16: 유틸리티 함수 임포트 추가

스터디 타입 체크를 위한 유틸리티 함수를 적절히 임포트했습니다.


84-89: 로직 개선: 스터디 타입 체크 방식 통일

기존 studyType !== "ASSIGNMENT" 조건을 isOnlineOfflineStudyType(studyType) 함수로 대체하여 코드 가독성과 의도를 명확히 했습니다. 이는 admin 앱에서의 변경사항과 일관성을 유지하며, 향후 스터디 타입이 추가되더라도 유연하게 대응할 수 있습니다.


92-105: 로직 개선: 일관된 조건부 렌더링 패턴 적용

이전 코드의 studyType !== "ASSIGNMENT" 조건을 isOnlineOfflineStudyType(studyType) 함수로 일관되게 변경하여 코드의 의도를 더 명확히 표현했습니다. 이러한 변경은 코드베이스 전반에 걸쳐 스터디 타입을 체크하는 방식을 통일하여 유지보수성을 높입니다.

apps/admin/components/Navbar.tsx (2)

27-27: 내비게이션 링크 경로 개선

href를 빈 문자열에서 "/studies"로 변경하여 메인 네비게이션 항목의 경로를 명확하게 지정하였습니다. 이 변경은 네비게이션 상태의 일관성을 유지하는 데 도움이 됩니다.


33-33: 하위 네비게이션 항목 경로 간소화

스터디 항목의 href를 간소화하여 "studies/" 접두사를 제거하고 studyId만 사용하도록 변경하였습니다. 이는 NavItem 컴포넌트의 업데이트와 함께 활성 상태의 네비게이션 항목 클릭 시 불필요한 페이지 리로드를 방지합니다.

apps/admin/app/layout.tsx (2)

7-7: Navbar 컴포넌트 임포트 추가

루트 레이아웃에 Navbar 컴포넌트를 추가하기 위한 임포트 문을 추가했습니다.


60-60: Navbar 컴포넌트를 루트 레이아웃으로 이동

Navbar 컴포넌트를 루트 레이아웃에 추가하여 내비게이션을 중앙 집중화했습니다. 이 변경으로 모든 페이지에서 일관된 내비게이션 상태가 유지되며, 멘토 페이지에서 발생했던 활성 상태 미적용 버그가 해결됩니다.

apps/admin/app/studies/[studyId]/_components/curriculum/CurriculumList.tsx (2)

4-4: StudyType 타입 임포트 추가

스터디 타입에 대한 타입 안전성을 강화하기 위해 StudyType 타입을 임포트하였습니다.


14-14: studyType 프롭 타입 강화

studyType 프롭의 타입을 선택적 string에서 필수 StudyType으로 변경하였습니다. 이렇게 하면 컴포넌트가 항상 올바른 스터디 타입("ASSIGNMENT", "ONLINE", "OFFLINE" 중 하나)을 받게 되어 타입 안전성이 향상됩니다.

apps/admin/app/studies/[studyId]/page.tsx (3)

7-7: isOnlineOfflineStudyType 유틸리티 함수 임포트 추가

온라인/오프라인 스터디 타입을 확인하는 유틸리티 함수를 임포트하여 코드의 가독성과 재사용성을 향상시켰습니다.


48-50: 스터디 타입에 따른 조건부 렌더링 개선

isOnlineOfflineStudyType 유틸리티 함수를 사용하여 온라인 또는 오프라인 스터디 타입인 경우에만 AttendanceList 컴포넌트를 렌더링하도록 변경했습니다. 이는 과제(ASSIGNMENT) 타입의 스터디에서는 출석 목록이 필요하지 않기 때문에 적절한 조건부 렌더링입니다.


56-56: 기본 스터디 타입 설정

studyType이 undefined인 경우를 대비하여 "OFFLINE"을 기본값으로 설정했습니다. 이는 CurriculumList 컴포넌트에서 studyType이 필수 프롭으로 변경된 것과 일치하며, 타입 안전성을 보장합니다.

packages/ui/src/components/NavItem/index.tsx (2)

63-66: 활성화된 네비게이션 항목 클릭 시 이동 방지 기능 추가

이미 활성화된 NavItem 클릭 시 페이지 재로딩을 방지하는 좋은 사용자 경험(UX) 개선입니다. 불필요한 리렌더링과 네트워크 요청을 줄여 성능에도 긍정적인 영향을 줍니다.


106-108: 서브메뉴 활성화 항목 클릭 시 이동 방지 기능 추가

메인 네비게이션 항목과 동일한 방식으로 서브메뉴 항목에도 이미 활성화된 경우 클릭 시 이동을 방지하는 기능을 추가했습니다. 일관된 사용자 경험을 제공하는 좋은 개선점입니다.

apps/admin/app/studies/[studyId]/_components/curriculum/CurriculumListItem.tsx (5)

5-6: 스터디 타입 관리 개선을 위한 임포트 추가

스터디 타입을 더 안전하게 관리하기 위해 타입 정의와 유틸리티 함수를 추가했습니다. 타입 안전성을 높이고 코드의 일관성을 유지하는 좋은 접근 방식입니다.


14-14: studyType 속성이 필수 타입으로 변경

기존의 선택적 문자열 타입에서 필수 StudyType 타입으로 변경되었습니다. 이로써 타입 안전성이 향상되고 컴파일 시점에 오류 검출이 가능해집니다.


50-50: Flex 컴포넌트에서 alignItems="baseline" 속성 제거

Flex 컴포넌트에서 alignItems="baseline" 속성이 제거되어 레이아웃에 영향을 줄 수 있습니다. 디자인 요구사항에 따라 의도된 변경인지 확인해주세요.


53-63: 스터디 타입 확인 로직의 중앙화

기존의 studyType !== "ASSIGNMENT" 조건 대신 isOnlineOfflineStudyType(studyType) 유틸리티 함수를 사용하여 일관성을 높였습니다. 이는 코드의 가독성과 유지보수성을 향상시키는 좋은 리팩토링입니다.


66-80: 레슨 제목 및 설명에 조건부 렌더링 추가

온라인/오프라인 스터디 타입일 경우에만 레슨 제목과 설명을 렌더링하도록 수정했습니다. 이는 스터디 타입에 따른 UI 일관성을 유지하는 좋은 개선점입니다.

Comment on lines +15 to +18
<>
{children}
{modal}
</main>
</>
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

시맨틱 HTML 구조 변경에 대한 확인이 필요합니다.

<main> 태그를 React 프래그먼트(<></>)로 변경하셨네요. 이는 다른 레이아웃 컴포넌트에서도 동일하게 적용된 변경사항으로 보입니다. 그러나 이런 변경은 페이지의 시맨틱 구조와 접근성에 영향을 줄 수 있습니다.

<main> 태그는 페이지의 주요 콘텐츠를 나타내는 중요한 시맨틱 태그입니다. 이 태그를 제거함으로써 페이지의 계층 구조가 명확하지 않을 수 있습니다. 상위 레이아웃에서 <main> 태그를 사용하고 있다면 문제가 없지만, 그렇지 않다면 접근성 문제가 발생할 수 있습니다.

상위 레이아웃 구조를 확인하여 <main> 태그가 적절히 사용되고 있는지 확인해주세요.


🏁 Script executed:

#!/bin/bash
# 상위 레이아웃 파일 구조 확인
find apps/client/app/(afterLogin)/(pc) -name "layout.tsx" | xargs cat | grep -A 5 -B 5 "<main"

Length of output: 277


괄호가 포함된 경로 때문에 이전 스크립트가 실패했습니다. 상위 레이아웃 파일에서 <main> 태그를 한 번에 검색할 수 있는 스크립트를 실행해 주세요.


🏁 Script executed:

#!/bin/bash
# apps/client/app 하위의 모든 layout.tsx에서 <main> 태그 위치 확인
fd --type f --name layout.tsx apps/client/app | xargs rg -n '<main'

Length of output: 1591


앱 클라이언트 루트, (afterLogin)/(pc) 그룹 레이아웃, 그리고 study-apply 레이아웃 파일 각각에서 <main> 태그가 사용되고 있는지 한 번에 확인해 보세요.


🏁 Script executed:

#!/bin/bash
set -e

echo "=== Root Layout ==="
grep -n '<main' apps/client/app/layout.tsx || echo "(없음)"

echo -e "\n=== (afterLogin)/(pc) Layout ==="
grep -n '<main' 'apps/client/app/(afterLogin)/(pc)/layout.tsx' || echo "(없음)"

echo -e "\n=== study-apply Layout ==="
grep -n '<main' 'apps/client/app/(afterLogin)/(pc)/study-apply/layout.tsx' || echo "(없음)"

Length of output: 451


(afterLogin)/(pc) 디렉터리 내의 모든 TSX 파일에서 <main> 태그가 사용되고 있는지 추가로 확인해 보겠습니다.


🏁 Script executed:

#!/bin/bash
# (afterLogin)/(pc) 하위의 TSX 파일에서 <main> 태그 검색
rg -t tsx -n '<main' apps/client/app/\(afterLogin\)/\(pc\) || echo "(없음)"

Length of output: 105


<main> 태그 누락으로 인한 시맨틱 및 접근성 검토 필요

현재 apps/client/app/(afterLogin)/(pc)/study-apply/layout.tsx에서 React Fragment(<></>)로 감싼 부분이 있는데, 상위 레이아웃(apps/client/app/layout.tsx(afterLogin)/(pc)/layout.tsx)에서도 <main> 태그가 전혀 존재하지 않아 주요 콘텐츠를 나타내는 시맨틱 태그가 누락되었습니다. 이로 인해 스크린 리더 등 접근성 도구가 페이지 구조를 제대로 파악하지 못할 수 있습니다.

다음 중 한 가지 방법으로 수정해주세요:

  • 해당 레이아웃 파일에서 Fragment 대신 <main> 태그를 사용
  • 상위 레이아웃 중 최소 한 곳에 <main>을 추가하여 페이지 구조 보장

파일 및 위치:

  • apps/client/app/(afterLogin)/(pc)/study-apply/layout.tsx (15–18행)

추천 변경 예시:

-    <>
+    <main>
       {children}
       {modal}
-    </>
+    </main>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<>
{children}
{modal}
</main>
</>
<main>
{children}
{modal}
</main>

@SeieunYoo SeieunYoo merged commit 1f7232c into dev Apr 22, 2025
2 of 3 checks passed
@SeieunYoo SeieunYoo deleted the fix/bug branch April 22, 2025 07:39
Copy link

@SeieunYoo SeieunYoo added 📝학생용 학생용 페이지 작업 ⛏멘토용 멘토용 페이지 작업 labels Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⛏멘토용 멘토용 페이지 작업 📝학생용 학생용 페이지 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant