Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @MlNTYS, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 현상소 보기 기능에 대한 4차 QA 피드백을 반영하여 사용자 경험을 개선합니다. 캘린더에서 현재 시간 이전의 시간 슬롯을 선택할 수 없도록 수정하고, 토스트 메시지 컴포넌트의 레이아웃을 조정하여 패딩 문제를 해결했습니다. 이를 통해 사용자가 보다 직관적이고 정확하게 필터를 설정할 수 있도록 합니다. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| // "오전 9:00" → 9, "오후 2:00" → 14 변환 | ||
| const parseHour = (slot: string): number => { | ||
| const [period, hm] = slot.split(" "); | ||
| const h = parseInt(hm); |
There was a problem hiding this comment.
| const isToday = | ||
| date.getFullYear() === now.getFullYear() && | ||
| date.getMonth() === now.getMonth() && | ||
| date.getDate() === now.getDate(); |
There was a problem hiding this comment.
이 날짜 비교 로직은 filteredSlots 내부(110-113행)에서도 반복됩니다. isSameDay와 같은 헬퍼 함수로 추출하여 중복을 제거하고 코드 가독성을 높이는 것을 추천합니다. utils/date.ts 같은 파일에 만들어두고 재사용하면 더 좋습니다.
// 예시
const isSameDay = (d1: Date, d2: Date) =>
d1.getFullYear() === d2.getFullYear() &&
d1.getMonth() === d2.getMonth() &&
d1.getDate() === d2.getDate();| const filteredSlots = useMemo(() => { | ||
| if (!selectedDate) return TIME_SLOTS; | ||
| const now = new Date(); | ||
| const isToday = | ||
| selectedDate.getFullYear() === now.getFullYear() && | ||
| selectedDate.getMonth() === now.getMonth() && | ||
| selectedDate.getDate() === now.getDate(); | ||
| if (!isToday) return TIME_SLOTS; | ||
| const currentHour = now.getHours(); | ||
| return TIME_SLOTS.filter((slot) => parseHour(slot) > currentHour); | ||
| }, [selectedDate]); |
There was a problem hiding this comment.
filteredSlots가 selectedDate에만 의존하고 있어, 시간이 지나도 필터링된 시간 목록이 실시간으로 업데이트되지 않는 잠재적인 문제가 있습니다. 예를 들어, 사용자가 오늘 날짜를 선택한 상태로 필터 창을 9:59에 열어두면, 10:01이 되어도 '오전 10:00' 슬롯이 사라지지 않습니다.
이 문제를 해결하기 위해 useEffect와 useState를 사용하여 1분마다 현재 시간을 업데이트하고, 이 시간 값을 useMemo의 의존성 배열에 추가하는 것을 고려해볼 수 있습니다.
// 컴포넌트 상단에 추가
const [currentTime, setCurrentTime] = useState(new Date());
useEffect(() => {
const timerId = setInterval(() => setCurrentTime(new Date()), 60000); // 1분마다 업데이트
return () => clearInterval(timerId);
}, []);
// useMemo 수정
const filteredSlots = useMemo(() => {
if (!selectedDate) return TIME_SLOTS;
const now = currentTime; // new Date() 대신 상태 사용
// ...
}, [selectedDate, currentTime]); // 의존성 배열에 currentTime 추가There was a problem hiding this comment.
큰 문제는 아니고, 시간 빼는 것도 UX를 위해 추가한거라 굳이
jeonbinggu
left a comment
There was a problem hiding this comment.
PRAISE: 고생하셨습니다! 코멘트 가볍게 한번만 읽어주시면 될 것 같아요
| if (period === "오전") return h; | ||
| return h === 12 ? 12 : h + 12; | ||
| } | ||
|
|
There was a problem hiding this comment.
QUESTION : 이 부분은 유틸 함수로 안 빼신 이유가 있으실까요??
🔀 Pull Request Title
현상소 보기 4차 QA 반영
📌 PR 설명
📷 스크린샷