Feat/comment hotfix#165
Conversation
- useReplyActions ๋์ postReply API ์ง์ ์ฌ์ฉ - ์ํ ๋๊ธฐํ ์ง์ฐ์ผ๋ก ์ธํ ๋๊ธ ์ ์ก ๋ฒ๊ทธ ์์ - ๋๊ธ ์์ฑ ์ ์ฆ์ ์ ๋ก๋๋๋๋ก ๊ฐ์ - BookSearchBottomSheet ํจํด์ผ๋ก Memory ํ์ด์ง์์๋ง ๋ ๋๋ง
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Walkthrough์ ์ญ ๋๊ธ ๋ฐํ ์ํธ๋ฅผ ๋์ . Zustand ์คํ ์ด๋ก ์ด๋ฆผ/์ปจํ ์คํธ ์ํ๋ฅผ ๊ด๋ฆฌํ๊ณ , ํ์ด์ง(Memory)์์ ๊ธ๋ก๋ฒ ์ปดํฌ๋ํธ๋ฅผ ๋ง์ดํธ. RecordItem ํด๋ฆญ์ผ๋ก ์คํ ์ด๋ฅผ ํตํด ์ํธ๋ฅผ ์ด๊ณ , ์ํธ ์ปดํฌ๋ํธ๋ ์ด๋ฆด ๋ ๋๊ธ์ ๋ก๋ํ๋ฉฐ ์ ๋ ฅ/์ ์ก/๋ต๊ธ ํ๋ฆ๊ณผ ๋ซ๊ธฐ๋ฅผ ์ฒ๋ฆฌ. ์ ๊ท ์คํ์ผ ๋ชจ๋ ํฌํจ. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant RI as RecordItem
participant Store as useCommentBottomSheetStore
participant Page as Memory Page
participant Sheet as GlobalCommentBottomSheet
participant API as API (getComments/postReply)
U->>RI: ๋๊ธ ๋ฒํผ ํด๋ฆญ
RI->>Store: openCommentBottomSheet(postId, postType)
Store-->>Page: isOpen=true ์ํ ๋ณ๊ฒฝ
Page-->>Sheet: ์ปดํฌ๋ํธ ๋ ๋๋ง/๊ฐฑ์
Sheet->>API: getComments(postId, postType)
API-->>Sheet: ๋๊ธ ๋ชฉ๋ก
U->>Sheet: ์
๋ ฅ ํ ์ ์ก
Sheet->>API: postReply(payload)
API-->>Sheet: ์ฑ๊ณต ์๋ต
Sheet->>API: getComments ์ฌ์กฐํ
U->>Sheet: ๋ฐ๊นฅ ์์ญ ํด๋ฆญ(๋ซ๊ธฐ)
Sheet->>Store: closeCommentBottomSheet()
Estimated code review effort๐ฏ 4 (Complex) | โฑ๏ธ ~60 minutes Possibly related PRs
Suggested labels
Poem
Tip ๐ Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. โจ Finishing Touches
๐งช Generate unit tests
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. ๐ชง TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
๐งน Nitpick comments (6)
src/stores/useCommentBottomSheetStore.ts (1)
3-12: postType ๋ฆฌํฐ๋ด ํ์ ์ฌ์ฌ์ฉ์ ์ํ ๋ณ๋ ํ์ ๋์ ์ ์'RECORD' | 'VOTE' ์ ๋์จ์ ์ฌ๋ฌ ๊ตฐ๋ฐ์์ ๋ฐ๋ณต ์ฌ์ฉํ๋ฏ๋ก, ํ ๊ณณ์์ ์ ์ํด ์ฌ์ฌ์ฉํ๋ฉด ์ ์ง๋ณด์์ฑ์ด ์ข์์ง๋๋ค.
์๋์ฒ๋ผ ํ์ ์ ์ ์ํด ์ฌ์ฌ์ฉํด ์ฃผ์ธ์.
interface CommentBottomSheetState { isOpen: boolean; postId: number | null; - postType: 'RECORD' | 'VOTE' | null; + postType: CommentPostType | null; } interface CommentBottomSheetActions { - openCommentBottomSheet: (postId: number, postType: 'RECORD' | 'VOTE') => void; + openCommentBottomSheet: (postId: number, postType: CommentPostType) => void; closeCommentBottomSheet: () => void; } +export type CommentPostType = 'RECORD' | 'VOTE';Also applies to: 21-22
src/components/memory/RecordItem/RecordItem.tsx (2)
58-59: Zustand ์ ๋ ํฐ๋ก ๋ถํ์ํ ๋ฆฌ๋ ๋ ์ค์ด๊ธฐํ์ฌ
useCommentBottomSheetStore()๋ฅผ ์ ์ฒด ์ํ๋ก ๊ตฌ๋ ํ๊ณ ์์ด ๋ฐํ ์ํธ ์ํ ๋ณ๊ฒฝ ์ ๋ชจ๋ RecordItem์ด ๋ฆฌ๋ ๋๋ ์ ์์ต๋๋ค. ์ก์ ๋ง ์ ํ ๊ตฌ๋ ํ๋ฉด ๋ฆฌ์คํธ ์ฑ๋ฅ์ด ๊ฐ์ ๋ฉ๋๋ค.- const { openCommentBottomSheet } = useCommentBottomSheetStore(); + const openCommentBottomSheet = useCommentBottomSheetStore(s => s.openCommentBottomSheet);
261-265: parseInt์ ๊ธฐ์(radix) ๋ช ์ (๊ฐ๋ ์ฑ/์์ ์ฑ ํฅ์)ํํ ์คํ์ ๊ธฐ๋ณธ 10์ง์ผ๋ก ํ์ฑ๋์ง๋ง, ์๋๋ฅผ ๋ช ํํ ํ๊ธฐ ์ํด radix๋ฅผ ๋ช ์ํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
- openCommentBottomSheet(parseInt(id), type === 'poll' ? 'VOTE' : 'RECORD'); + openCommentBottomSheet(parseInt(id, 10), type === 'poll' ? 'VOTE' : 'RECORD');src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.tsx (1)
61-62: ๋ถํ์ํ ํ์ ๋จ์ธ ์ ๊ฑฐ ์ ์
postType์ ์ด๋ฏธ'RECORD' | 'VOTE'๋ก ์ถฉ๋ถํ ์ข์ ํ์ ์ด๋ฏ๋ก, ์์ ์ ๋์จ('FEED' | 'RECORD' | 'VOTE')์ผ๋ก์ ๋จ์ธ์ด ํ์ ์์ต๋๋ค. ๋จ์ธ์ ์ค์ด๋ฉด ํ์ ์ ๋ขฐ๋๊ฐ ์ฌ๋ผ๊ฐ๋๋ค.- postType: postType as 'FEED' | 'RECORD' | 'VOTE' + postTypesrc/components/common/CommentBottomSheet/GlobalCommentBottomSheet.styled.ts (2)
20-33: min-width(360px)๋ก ์ธํ ์ํ ๋๋ฐ์ด์ค overflow ๊ฐ๋ฅ์ฑํญ 320px ๊ธฐ๊ธฐ(์: iPhone SE)์์ ๊ฐ๋ก ์คํฌ๋กค์ด ๋ฐ์ํ ์ ์์ต๋๋ค. ๋ชจ๋ฐ์ผ ๋์์ ์ํด min-width๋ฅผ ์ ๊ฑฐํ๊ฑฐ๋ ๋ฏธ๋์ด์ฟผ๋ฆฌ๋ก ์กฐ๊ฑด๋ถ ์ ์ฉ์ ๊ถ์ฅํฉ๋๋ค.
export const BottomSheet = styled.div<{ isOpen: boolean }>` width: 100%; max-width: 540px; - min-width: 360px; background: ${colors.darkgrey.main}; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; max-height: 80vh; min-height: 50vh; transform: translateY(${props => (props.isOpen ? '0' : '100%')}); transition: transform 0.3s ease; overflow: hidden; `;
15-17: transition ์์ฑ ์ผ์นํ (๋ฏธ์ธ ๊ฐ์ )
background๊ฐ์ ๋ณ๊ฒฝํ๊ณ ์์ผ๋ฏ๋กtransition: background๋ก ๋ง์ถ๋ฉด ์๋๊ฐ ๋ถ๋ช ํด์ง๋๋ค. opacity๋ ํจ๊ป ํธ๋์ง์ ํ๋ฉด ๋ ์์ฐ์ค๋ฝ์ต๋๋ค.- transition: background-color 0.3s ease; + transition: background 0.3s ease, opacity 0.3s ease;
๐ Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
๐ก Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
๐ Files selected for processing (5)
src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.styled.ts(1 hunks)src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.tsx(1 hunks)src/components/memory/RecordItem/RecordItem.tsx(5 hunks)src/pages/memory/Memory.tsx(2 hunks)src/stores/useCommentBottomSheetStore.ts(1 hunks)
๐งฐ Additional context used
๐งฌ Code Graph Analysis (3)
src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.styled.ts (1)
src/styles/global/global.ts (2)
colors(4-53)typography(56-77)
src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.tsx (7)
src/stores/useCommentBottomSheetStore.ts (1)
useCommentBottomSheetStore(14-26)src/api/comments/getComments.ts (2)
CommentData(3-16)getComments(50-68)src/hooks/useReplyActions.ts (1)
useReplyActions(10-54)src/stores/useReplyStore.ts (1)
useReplyStore(15-28)src/api/comments/postReply.ts (1)
postReply(19-22)src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.styled.ts (7)
Overlay(4-18)BottomSheet(20-33)Header(35-39)Title(41-47)Content(49-53)LoadingState(55-63)InputSection(65-70)src/components/today-words/MessageInput.styled.ts (1)
MessageInput(62-90)
src/components/memory/RecordItem/RecordItem.tsx (2)
src/stores/useCommentBottomSheetStore.ts (1)
useCommentBottomSheetStore(14-26)src/components/memory/RecordItem/RecordItem.styled.ts (1)
ActionButton(60-79)
๐ Additional comments (4)
src/stores/useCommentBottomSheetStore.ts (1)
14-26: ์ ์ญ ๋ฐํ ์ํธ ์ํ/์ก์ ์ค๊ณ ๊น๋ โ LGTM์ด๊ธฐ๊ฐ/๋ฆฌ์ ์ฒ๋ฆฌ์ open/close ์ก์ ์ธํฐํ์ด์ค๊ฐ ๋ช ํํฉ๋๋ค. ๋ค๋ฅธ ์ปดํฌ๋ํธ๋ค์ด ์์กดํ๊ธฐ ์ข๊ฒ ์ ๋ถ๋ฆฌ๋์ด ์์ด์.
src/pages/memory/Memory.tsx (1)
8-8: GlobalCommentBottomSheet ํ์ด์ง ๋ง์ดํธ ์ถ๊ฐ โ LGTM๊ณ ์ ์ค๋ฒ๋ ์ด(ํฌ์ง์ fixed) ํน์ฑ์ ํ์ด์ง ์ตํ๋จ์ ๋ง์ดํธํด๋ ์ ์ ๋์ํฉ๋๋ค. Memory ํ์ด์ง ๋ฒ์์์๋ง ์ฌ์ฉํ๋ ค๋ ์๋์๋ ๋ถํฉํฉ๋๋ค.
Also applies to: 299-301
src/components/memory/RecordItem/RecordItem.tsx (1)
379-382: ๋๊ธ ๋ฒํผ โ ๋ฐํ ์ํธ ์ด๊ธฐ ์ฐ๋ โ LGTM๋ฒ๋ธ๋ง ๋ฐฉ์ง์ ์ ์ญ ์ํธ ์คํ ํ๋ฆ์ด ์ผ๊ด๋๊ฒ ์ ์ฐ๊ฒฐ๋์์ต๋๋ค.
src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.tsx (1)
92-97: ์ด๋ฆด ๋ ๋ก๋/๋ซํ ๋ ๋ฆฌ์ ํ๋ก์ฐ ๋ช ํ โ LGTM
- ์ํธ ์คํ ์ ๋ชฉ๋ก ๋ก๋
- ์ํธ ๋ซํ ์ ์ ๋ ฅ/๋ต๊ธ/๋ชฉ๋ก ๋ฆฌ์
์ํ ์๋ช ์ฃผ๊ธฐ๊ฐ ๋ช ํํด UX ๋ฐ ๋ฉ๋ชจ๋ฆฌ ํจ์จ ์ธก๋ฉด์์ ์ข์ต๋๋ค.
Also applies to: 98-105
#๏ธโฃ ์ฐ๊ด๋ ์ด์
์๋ต
๐ ์์ ๋ด์ฉ
๊ธฐ๋ก์ฅ์์ ๋๊ธ ๊ธฐ๋ฅ์ ๊ตฌํํ์ต๋๋ค. ์ฌ์ฉ์๊ฐ ๊ธฐ๋ก์ ๋ํด ๋๊ธ์ ์์ฑํ๊ณ ๋ต๊ธ์ ๋ฌ ์ ์๋ ๋ฐํ ์ํธ UI๋ฅผ ์ถ๊ฐํ์ต๋๋ค.
๐ธ๏ธ ์ฃผ์ ๊ตฌํ ์ฌํญ
1. ๋๊ธ ๋ฐํ ์ํธ ์์คํ ๊ตฌ์ถ
useCommentBottomSheetStore๋ฅผ ํตํ ์ ์ญ ์ํ ๊ด๋ฆฌ ๊ตฌํGlobalCommentBottomSheet์ปดํฌ๋ํธ๋ก ํ๋จ์์ ์ฌ๋ผ์ด๋์ ๋๋ ๋ฐํ ์ํธ UI ์ ์BookSearchBottomSheet์ ๋์ผํ ์ํคํ ์ฒ ํจํด ์ ์ฉ2. ๊ธฐ๋ก์ฅ ๋๊ธ ๋ฒํผ ์ฐ๋
RecordItem์ปดํฌ๋ํธ์ ๋๊ธ ๋ฒํผ์ ํด๋ฆญ ํธ๋ค๋ฌ ์ถ๊ฐpostId์postType(RECORD/VOTE)์ ์ ๋ฌํ์ฌ ๋ฐํ ์ํธ ์คํ3. ๋๊ธ ๊ธฐ๋ฅ ์์ ๊ตฌํ
getCommentsAPI ์ฐ๋)postReplyAPI ์ฐ๋)ReplyList,MessageInput์ปดํฌ๋ํธ ์ฌ์ฌ์ฉ์ผ๋ก ์ผ๊ด๋ UX ์ ๊ณต4. UI/UX ๊ฐ์
5. ์ฑ๋ฅ ์ต์ ํ
useCallback์ ํตํ ๋ถํ์ํ ๋ฆฌ๋ ๋๋ง ๋ฐฉ์งSummary by CodeRabbit