Skip to content

[FE] SISC1-197 [FEAT] : 사이드바에 게시판 리스트 추가#109

Merged
DongEun02 merged 3 commits intomainfrom
SISC1-197-FE-sidebar-board-list
Nov 15, 2025
Merged

[FE] SISC1-197 [FEAT] : 사이드바에 게시판 리스트 추가#109
DongEun02 merged 3 commits intomainfrom
SISC1-197-FE-sidebar-board-list

Conversation

@DongEun02
Copy link
Contributor

@DongEun02 DongEun02 commented Nov 14, 2025

1) 작업한 이슈번호

SISC1-197

2) 변경 요약 (What & Why)

  • 무엇을 변경했는지: 사이드바에 option, select 태그를 사용하여 팀별 게시판 리스트 구현 및 라우팅 설정
  • 변경했는지(문제/목표):

3) 스크린샷/동영상 (UI 변경 시)

전/후 비교, 반응형(모바일/데스크톱) 캡쳐

  • Before:
  • After:
image image image

4) 상세 변경사항 (전부 다)

  • 라우팅/페이지:
  • 컴포넌트: Sidebar.jsx
  • 상태관리:
  • API 호출:
  • 스타일: Sidebar.module.css
  • 기타:

5) 참고사항

Summary by CodeRabbit

릴리스 노트

  • 기능 개선

    • 사이드바의 보드 선택 인터페이스를 드롭다운으로 전환해 보드 간 이동을 간편하게 했습니다.
    • 게시판 경로 구조를 조정해 팀(또는 보드) 단위 경로와 해당 게시물 상세 경로를 지원하도록 개선했습니다.
  • 스타일

    • 드롭다운에 전체 너비, 투명 배경, 흰색 텍스트, 둥근 모서리 등 시각 스타일을 추가했습니다.

@DongEun02 DongEun02 requested a review from gxuoo as a code owner November 14, 2025 17:02
@coderabbitai
Copy link

coderabbitai bot commented Nov 14, 2025

Walkthrough

사이드바의 정적 링크들이 선택형 드롭다운으로 대체되고 React Router의 programmatic navigation(useNavigate/useLocation)과 컴포넌트 상태(selectedBoard, boardList)가 도입되었습니다. 라우트는 /board, /board/:team/board/:team/:postId 구조로 조정되었습니다.

Changes

Cohort / File(s) 변경 요약
사이드바 컴포넌트
frontend/src/components/Sidebar.jsx
useNavigate, useLocation, useState 도입; boardList 상수 추가; URL에서 현재 보드 계산(currentBoard); 기존 Home/Board 링크를 선택형 <select>로 대체; 드롭다운 변경 시 해당 보드의 경로로 navigate 호출
사이드바 스타일
frontend/src/components/Sidebar.module.css
.boardSelect 클래스 추가(전체 너비, 투명 배경, 흰색 텍스트, 테두리 없음, 패딩·둥근 모서리 등) 및 option 텍스트 색상 규칙 추가
라우트 구성 변경
frontend/src/App.jsx
라우트 구조 업데이트: /board 유지, /board/:teamBoard 컴포넌트, /board/:team/:postIdPostDetail 컴포넌트로 분리/추가
매니페스트(메타)
package.json
변경 없음 (파일 포함만 됨)

Sequence Diagram(s)

sequenceDiagram
    participant U as 사용자
    participant SB as Sidebar (select)
    participant NAV as React Router (navigate)
    participant APP as App Router
    participant B as Board
    participant P as PostDetail

    U->>SB: 드롭다운에서 보드 선택
    SB->>NAV: navigate("/board/:team") 또는 navigate("/board/:team/:postId")
    NAV->>APP: 라우트 매칭 요청
    alt /board/:team/:postId 매칭
        APP->>P: PostDetail 렌더
        note right of P `#DFF2E1`: 상세 게시물 표시
    else /board/:team 매칭
        APP->>B: Board 렌더
        note right of B `#E8F0FF`: 게시판 목록/내용 표시
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • 검토 권장 항목:
    • boardList 항목의 path/팀 식별자 일관성 확인
    • 페이지 로드 시 URL과 select 초기값 동기화(특히 직접 URL 접근 경우)
    • App.jsx의 새 라우트가 기존 링크/네비게이션과 충돌 여부
    • CSS 옵션 색상이 접근성(명암 대비)에 부합하는지

Possibly related PRs

Suggested reviewers

  • gxuoo

🐰 변경을 축하하는 토끼의 시

드롭다운 하나로 길이 바뀌네 🐇
클릭하면 길이 폴짝 열리고
팀을 지나 글로 이어지네
버튼 한 번에 길이 연결되니
토끼가 기쁘게 춤추네 ✨

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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 내용과 일치합니다. 사이드바에 게시판 리스트 추가라는 구체적이고 명확한 요약을 제공합니다.
✨ 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 SISC1-197-FE-sidebar-board-list

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd754a8 and d248bb4.

📒 Files selected for processing (1)
  • frontend/src/components/Sidebar.jsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/Sidebar.jsx

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.

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: 2

🧹 Nitpick comments (3)
frontend/src/components/Sidebar.module.css (1)

120-135: 접근성 개선을 위한 포커스 상태 추가를 권장합니다.

드롭다운에 테두리가 없고 투명한 배경을 사용하여 대화형 요소로 식별하기 어려울 수 있습니다. 키보드 내비게이션을 위한 포커스 상태와 마우스 호버 시 시각적 피드백을 추가하는 것을 고려해보세요.

다음과 같이 포커스 및 호버 상태를 추가할 수 있습니다:

 .boardSelect {
   width: 100%;
   background: transparent;
   color: #ffffff;
   border: none;
   padding: 3px;
   border-radius: 6px;
   margin-top: 6px;
   text-decoration: none;
   font-weight: 500;
   font-size: 16px;
+  cursor: pointer;
+  transition: background-color 0.2s ease;
 }
 
+.boardSelect:hover {
+  background: rgba(217, 217, 217, 0.05);
+}
+
+.boardSelect:focus {
+  outline: 2px solid rgba(255, 255, 255, 0.3);
+  outline-offset: 2px;
+  background: rgba(217, 217, 217, 0.05);
+}
+
 .boardSelect option {
   color: black;
 }
frontend/src/components/Sidebar.jsx (2)

9-18: 게시판 목록을 별도 설정 파일로 분리하는 것을 고려하세요.

현재 게시판 목록이 컴포넌트 내부에 하드코딩되어 있습니다. 목록이 자주 변경되거나 다른 컴포넌트에서도 사용될 가능성이 있다면, 별도의 설정 파일이나 상수 파일로 분리하는 것이 유지보수에 유리합니다.

예를 들어 src/constants/boardConfig.js와 같은 파일을 생성할 수 있습니다:

// src/constants/boardConfig.js
export const BOARD_LIST = [
  { name: '전체 게시판', path: '/board' },
  { name: '증권1팀 게시판', path: '/board/securities-1' },
  // ... 나머지 게시판
];

30-51: 접근성을 위해 레이블과 select 요소를 연결하세요.

현재 "게시판" 텍스트와 select 요소가 프로그래밍 방식으로 연결되어 있지 않아 스크린 리더 사용자에게 불편할 수 있습니다.

다음과 같이 개선할 수 있습니다:

 <div className={styles['menu-section']}>
-  <span className={styles['menu-title']}>게시판</span>
+  <label htmlFor="board-select" className={styles['menu-title']}>
+    게시판
+  </label>
 
   <select
+    id="board-select"
     className={styles.boardSelect}
     value={selectedBoard}
     onChange={(e) => {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81090a4 and d7b6016.

📒 Files selected for processing (2)
  • frontend/src/components/Sidebar.jsx (2 hunks)
  • frontend/src/components/Sidebar.module.css (1 hunks)
🔇 Additional comments (1)
frontend/src/components/Sidebar.jsx (1)

1-3: LGTM!

필요한 훅들을 올바르게 임포트했습니다.

Comment on lines 6 to 7
const [selectedBoard, setSelectedBoard] = useState('전체 게시판');
const navigate = useNavigate();
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

현재 URL과 선택 상태의 동기화를 고려하세요.

초기 상태가 '전체 게시판'으로 하드코딩되어 있어, 사용자가 특정 팀 게시판 URL로 직접 접근하거나 브라우저의 뒤로 가기를 사용할 경우 선택된 드롭다운 값이 실제 페이지와 일치하지 않습니다.

현재 경로를 기반으로 초기 상태를 설정하도록 개선할 수 있습니다:

+import { NavLink, useNavigate, useLocation } from 'react-router-dom';
 import styles from './Sidebar.module.css';
 import { useState } from 'react';
 
 const Sidebar = ({ isOpen, isRoot }) => {
-  const [selectedBoard, setSelectedBoard] = useState('전체 게시판');
   const navigate = useNavigate();
+  const location = useLocation();
 
   const boardList = [
     { name: '전체 게시판', path: '/board' },
     { name: '증권1팀 게시판', path: '/board/securities-1' },
     { name: '증권2팀 게시판', path: '/board/securities-2' },
     { name: '증권3팀 게시판', path: '/board/securities-3' },
     { name: '자산운용팀 게시판', path: '/board/asset-management' },
     { name: '금융IT팀 게시판', path: '/board/finance-it' },
     { name: '매크로팀 게시판', path: '/board/macro' },
     { name: '트레이딩팀 게시판', path: '/board/trading' },
   ];
+
+  const currentBoard = boardList.find(item => item.path === location.pathname);
+  const [selectedBoard, setSelectedBoard] = useState(
+    currentBoard?.name || '전체 게시판'
+  );

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

🤖 Prompt for AI Agents
In frontend/src/components/Sidebar.jsx around lines 6-7, the selectedBoard state
is hardcoded to '전체 게시판' which desynchronizes the dropdown from the current URL;
derive the initial selectedBoard from the current location (useLocation or parse
window.location) instead of a hardcoded string and replace useState('전체 게시판')
with a computed initial value, then add a useEffect that listens to location
changes and updates setSelectedBoard accordingly so direct URL access and
browser navigation keep the dropdown in sync with the displayed board.

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 d7b6016 and cd754a8.

📒 Files selected for processing (1)
  • frontend/src/App.jsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/src/App.jsx (1)
frontend/src/pages/PostDetail.jsx (1)
  • PostDetail (14-365)

Comment on lines +30 to +31
<Route path="/board/:team" element={<Board />} />
<Route path="/board/:team/:postId" element={<PostDetail />} />
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

라우트 파라미터 이름 불일치로 인한 치명적 버그

PostDetail 컴포넌트는 useParams()에서 id를 읽지만(const { id } = useParams()), 새 라우트는 :postId로 정의되어 있습니다. 이로 인해 PostDetail이 게시물 ID를 받지 못해 게시물 로드에 실패합니다.

다음 중 하나를 선택하여 수정하세요:

해결책 1 (권장): 라우트 파라미터를 id로 변경

-          <Route path="/board/:team/:postId" element={<PostDetail />} />
+          <Route path="/board/:team/:id" element={<PostDetail />} />

해결책 2: PostDetail 컴포넌트를 postId 사용하도록 수정

PostDetail.jsx를 수정:

-const { id } = useParams();
+const { postId } = useParams();

그리고 파일 전체에서 id 사용을 postId로 변경

또한 다음 사항들을 확인하세요:

  1. Board 컴포넌트가 :team 파라미터를 처리하는지 검증:

  2. 모든 navigate 호출이 새 라우트 구조를 사용하는지 검증:

  3. Sidebar의 navigation이 새 라우트와 일치하는지 확인:


🏁 Script executed:

#!/bin/bash
# Board 컴포넌트가 team 파라미터를 사용하는지 확인
rg -n "useParams" frontend/src/pages/Board.jsx -A 3 -B 1

Length of output: 0


🏁 Script executed:

#!/bin/bash
# 이전 /board/:postId 패턴을 사용하는 navigate 호출 찾기
rg -n "navigate.*['\"`]/board/" frontend/src --type tsx --type jsx -C 2

# PostDetail로 이동하는 모든 navigate 호출 확인
ast-grep --pattern 'navigate($$$)'

Length of output: 68


🏁 Script executed:

#!/bin/bash
# Sidebar에서 /board 관련 navigation 확인
rg -n "/board" frontend/src/components/Sidebar.jsx -C 3

Length of output: 539


[/run_scripts]


🏁 Script executed:

#!/bin/bash
# 1. Find PostDetail.jsx and check what parameter it uses
fd -name "PostDetail.jsx" frontend/src --exec rg -n "useParams\|const.*=\s*useParams" {} -A 2

# 2. Find all files that might navigate to board routes
rg -n "navigate\s*\(" frontend/src --type jsx --type tsx -C 2

Length of output: 258


🏁 Script executed:

#!/bin/bash
# 3. Check if Board.jsx exists and examine its implementation
fd -name "Board.jsx" frontend/src -exec cat {}

# 4. Search for any hardcoded routes to /board in the codebase
rg -n "'/board|\" /board|`/board" frontend/src --type jsx --type tsx -C 2

Length of output: 299


[/run_scripts]


🏁 Script executed:

#!/bin/bash
# Find PostDetail file and check its useParams usage
find frontend/src -name "*PostDetail*" -type f
rg "useParams" frontend/src --type ts --type js -A 3 -B 1

Length of output: 810


🏁 Script executed:

#!/bin/bash
# Find Board file
find frontend/src -name "*Board*" -type f
# Check navigate patterns in the codebase
rg "navigate\(" frontend/src --type ts --type js -C 2

Length of output: 1075


🏁 Script executed:

#!/bin/bash
# Check all board-related routes and paths
rg "board" frontend/src/App.jsx -C 2
rg "board" frontend/src -i --type ts --type js | head -50

Length of output: 4620


[/run_scripts]


🏁 Script executed:

#!/bin/bash
# Check Board.jsx implementation for team parameter handling
cat frontend/src/pages/Board.jsx | head -50

Length of output: 1335


🏁 Script executed:

#!/bin/bash
# Check PostItem.jsx navigate call in detail
rg "navigate" frontend/src/components/Board/PostItem.jsx -B 5 -A 5

Length of output: 431


🏁 Script executed:

#!/bin/bash
# Check if Board.jsx uses useParams
rg "useParams" frontend/src/pages/Board.jsx -C 3

Length of output: 0


라우트 구조 변경에 따른 여러 치명적 버그 발견

새 라우트 구조 /board/:team/:postId로 변경되면서 다음 3가지 치명적 문제가 발생합니다:

문제 1: PostDetail 파라미터 이름 불일치

  • 라우트 정의: :postId
  • PostDetail 기대값: id (line 13)
  • 결과: PostDetail이 게시물 ID를 받지 못해 로드 실패

문제 2: PostItem.jsx 네비게이션 경로 오류

  • 현재 코드: navigate('/board/${post.id}')
  • 필요한 경로: /board/:team/:postId
  • 결과: :team 파라미터 누락으로 라우트 매칭 실패 (frontend/src/components/Board/PostItem.jsx)

문제 3: Board.jsx가 :team 파라미터를 처리하지 않음

  • Board.jsx에서 useParams 미사용 확인됨
  • 결과: 팀 선택 기능이 작동하지 않고 모든 게시물이 표시됨

필수 수정 사항:

  1. PostDetail.jsx 라우트 파라미터 일치시키기 (권장)
-          <Route path="/board/:team/:postId" element={<PostDetail />} />
+          <Route path="/board/:team/:id" element={<PostDetail />} />
  1. PostItem.jsx 네비게이션 업데이트 (frontend/src/components/Board/PostItem.jsx)

    • :team 파라미터 추가 필요
    • 현재 team 정보를 어디서 가져올지 확인 필요
  2. Board.jsx에 팀 필터링 로직 추가

    • useParams() 사용하여 :team 파라미터 읽기
    • 파라미터에 따라 게시물 필터링
📝 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
<Route path="/board/:team" element={<Board />} />
<Route path="/board/:team/:postId" element={<PostDetail />} />
<Route path="/board/:team" element={<Board />} />
<Route path="/board/:team/:id" element={<PostDetail />} />
🤖 Prompt for AI Agents
frontend/src/App.jsx lines 30-31: the new route /board/:team/:postId exposes
three issues—update PostDetail.jsx to read the same param name used in the route
(change its prop/param usage from id to postId or map postId to id at component
entry), modify frontend/src/components/Board/PostItem.jsx to build navigation
URLs including the current team (e.g., navigate(`/board/${team}/${post.id}`) —
obtain team from props, context, or useParams where appropriate), and update
frontend/src/components/Board/Board.jsx to call useParams() to read :team and
apply filtering logic so only posts for that team are shown; make sure all
references consistently use the same param name (:postId) across routing and
components.

@DongEun02 DongEun02 merged commit eec2f2b into main Nov 15, 2025
1 check passed
@DongEun02 DongEun02 deleted the SISC1-197-FE-sidebar-board-list branch November 15, 2025 03:16
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.

1 participant