Conversation
Summary of ChangesHello @seseoju, 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! 이 Pull Request는 스택에 이전 액티비티가 없는 상태에서 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
|
There was a problem hiding this comment.
Code Review
✅ 잘한 점
- 스택에 이전 화면이 없을 경우
pop이 동작하지 않는 문제를 해결하기 위해, fallback UI로 이동하는useStack훅을 추가하여 문제를 해결한 점이 좋습니다. stackflow의actions을stackflow.tsx에서 export하여useStack훅에서 사용하도록 수정한 것은 적절한 변경입니다.
❌ 위반 사항
- 해당 PR에서는 스타일 가이드 위반 사항을 찾지 못했습니다.
🔧 개선 제안
ScheduleDetailPage.tsx에 디버깅 목적으로 추가된 것으로 보이는console.log구문이 남아있습니다. 머지 전 삭제가 필요합니다.- 새로 추가된
useStack훅의pop함수가 호출 시점이 아닌, 훅 초기화 시점의 스택 정보를 사용하고 있어 잠재적인 버그를 유발할 수 있습니다.pop함수가 호출될 때마다 스택 정보를 새로 가져오도록 수정하여 안정성을 높이는 것을 제안합니다.
| export const useStack = () => { | ||
| const stack = actions.getStack(); | ||
| const stackSize = stack.activities.length; | ||
| const { push, pop: originalPop } = useFlow(); | ||
|
|
||
| const pop = (fallback?: ActivityName) => { | ||
| if (stackSize === 1 && fallback) { | ||
| push(fallback, {}, { animate: false }); | ||
| return; | ||
| } | ||
|
|
||
| originalPop(); | ||
| }; | ||
|
|
||
| return { pop }; | ||
| }; |
There was a problem hiding this comment.
useStack 훅이 처음 호출될 때의 스택 크기를 기준으로 pop 동작을 결정하고 있습니다. 이는 pop 함수가 실제로 실행되는 시점의 스택 상태와 다를 수 있어 예기치 않은 동작을 유발할 수 있습니다. pop 함수 내부에서 스택 정보를 가져오도록 수정하여 항상 최신 상태를 반영하도록 하는 것이 더 안전합니다.
| export const useStack = () => { | |
| const stack = actions.getStack(); | |
| const stackSize = stack.activities.length; | |
| const { push, pop: originalPop } = useFlow(); | |
| const pop = (fallback?: ActivityName) => { | |
| if (stackSize === 1 && fallback) { | |
| push(fallback, {}, { animate: false }); | |
| return; | |
| } | |
| originalPop(); | |
| }; | |
| return { pop }; | |
| }; | |
| export const useStack = () => { | |
| const { push, pop: originalPop } = useFlow(); | |
| const pop = (fallback?: ActivityName) => { | |
| const stack = actions.getStack(); | |
| const stackSize = stack.activities.length; | |
| if (stackSize === 1 && fallback) { | |
| push(fallback, {}, { animate: false }); | |
| return; | |
| } | |
| originalPop(); | |
| }; | |
| return { pop }; | |
| }; |
| const handleBack = () => { | ||
| pop(); | ||
| console.log('handleBack'); | ||
| pop('SchedulePage'); | ||
| }; |
🛠️ 변경 사항
세부 변경 내용
shared/lib/stackflow/useStack.ts훅을 추가했습니다.🔍 관련 이슈
📸 스크린샷 / GIF (선택)
🔄 연관 작업