Conversation
Summary of ChangesHello @PeraSite, 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은 프로젝트 대본 관리 기능을 대폭 개선합니다. 사용자는 이제 특정 프로젝트의 모든 슬라이드 대본을 한 번에 조회할 수 있으며, 여러 슬라이드의 대본을 효율적으로 일괄 수정할 수 있게 됩니다. 이는 대본 작업의 생산성을 향상시키고, 데이터 일관성을 보장하기 위한 강력한 유효성 검사 로직을 포함합니다. Highlights
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
|
| const invalidSlide = normalizedScripts.find((item) => !projectSlideIds.has(item.slideId)); | ||
|
|
||
| if (invalidSlide) { | ||
| throw new ScriptBulkEditSlideNotFoundError({ | ||
| projectId, | ||
| slideId: invalidSlide.slideId, | ||
| }); | ||
| } |
There was a problem hiding this comment.
현재 구현에서는 find를 사용하여 프로젝트에 속하지 않는 첫 번째 슬라이드 ID만 찾아 에러를 발생시키고 있습니다. 만약 여러 개의 유효하지 않은 슬라이드 ID가 포함된 경우, 사용자는 한 번에 하나의 에러만 피드백 받고 수정을 반복해야 하므로 불편할 수 있습니다. filter를 사용하여 모든 유효하지 않은 슬라이드 ID를 한 번에 찾아 알려주면 개발자 경험을 개선할 수 있습니다.
| const invalidSlide = normalizedScripts.find((item) => !projectSlideIds.has(item.slideId)); | |
| if (invalidSlide) { | |
| throw new ScriptBulkEditSlideNotFoundError({ | |
| projectId, | |
| slideId: invalidSlide.slideId, | |
| }); | |
| } | |
| const invalidSlideIds = normalizedScripts | |
| .filter((item) => !projectSlideIds.has(item.slideId)) | |
| .map((item) => item.slideId); | |
| if (invalidSlideIds.length > 0) { | |
| throw new ScriptBulkEditSlideNotFoundError({ | |
| projectId, | |
| slideIds: invalidSlideIds, | |
| }); | |
| } |
| for (const item of normalizedScripts) { | ||
| const { isUpdated } = await processScriptUpdate(item.slideId, item.scriptText); | ||
|
|
||
| if (isUpdated) { | ||
| updatedSlideCount += 1; | ||
| updatedSlideIds.push(item.slideId); | ||
| continue; | ||
| } | ||
|
|
||
| unchangedSlideCount += 1; | ||
| } |
There was a problem hiding this comment.
대본 일괄 수정 시 for 루프 내에서 await를 사용하여 각 대본을 순차적으로 업데이트하고 있습니다. 대본이 많을 경우 이로 인해 API 응답 시간이 길어질 수 있습니다. 각 슬라이드의 대본 업데이트는 서로 독립적이므로 Promise.all을 사용하여 병렬로 처리하면 성능을 크게 향상시킬 수 있습니다. 아래와 같이 수정하는 것을 제안합니다.
const updatePromises = normalizedScripts.map((item) =>
processScriptUpdate(item.slideId, item.scriptText),
);
const updateResults = await Promise.all(updatePromises);
updateResults.forEach((result, index) => {
if (result.isUpdated) {
updatedSlideCount++;
updatedSlideIds.push(normalizedScripts[index].slideId);
} else {
unchangedSlideCount++;
}
});
🔗 관련 이슈
✨ 변경 내용
GET /presentations/:projectId/scripts를 추가해 프로젝트 전체 대본 조회를 지원합니다.PATCH /presentations/:projectId/scripts/bulk-edit를 추가해 여러 슬라이드 대본 일괄 수정을 지원합니다.SC003~SC005)로 정리했습니다.✅ 체크리스트
POST /presentations/:projectId/scripts/import경로 제거로 인해 해당 엔드포인트를 호출하던 클라이언트는 신규 bulk edit 계약으로 전환이 필요합니다.📌 기타 참고 사항 (선택)
npm test -- tests/script