Skip to content

[PR] 진행 중인 프로젝트 이어서 진행하도록 수정#63

Closed
TTOCHIwas wants to merge 3 commits intomainfrom
refector#62-resume-inprogress-project
Closed

[PR] 진행 중인 프로젝트 이어서 진행하도록 수정#63
TTOCHIwas wants to merge 3 commits intomainfrom
refector#62-resume-inprogress-project

Conversation

@TTOCHIwas
Copy link
Copy Markdown
Collaborator

📝 요약 (Summary)

마이페이지에서 진행 중인 프로젝트 클릭 시 이전에 진행하던 스텝부터 이어서 작업할 수 있도록 구현했습니다.

✅ 주요 변경 사항 (Key Changes)

  • 프로젝트 상태별 클릭 분기 처리
    • IN_PROGRESS -> 업로드 페이지
    • COMPLETED -> 상세 페이지
  • UploadStepPage에서 현재 진행할 스텝 판별 및 이동

💻 상세 구현 내용 (Implementation Details)

프로젝트 클릭 분기 ProjectListSection

  • 프로젝트 상태에 따라 클릭 시 이동 경로를 분기합니다.
// ProjectListSection.tsx
onClick={() => {
  if (project.status === "IN_PROGRESS") {
    navigate(
      `${ROUTE_PATHS.UPLOAD_STEP_BASE}/${project.projectId}/1`,
    );
  } else {
    navigate(
      DYNAMIC_ROUTE_PATHS.PROJECT_DETAIL(project.projectId),
    );
  }
}}
  • IN_PROGRESS → /upload/step/{projectId}/1로 이동
  • COMPLETED → /project/{projectId}로 이동

스텝 자동 판별 UploadStepPage

  • useGetProjectDetail로 조회한 stepResponses에서 userSubmittedResult가 null인 첫 번째 스텝을 찾아 해당 스텝으로 navigate되도록 했습니다.
// UploadStepPage
// isStepResolved - 이동할 스탭이 정해졌는지의 유무를 판별해서 마지막에 useEffect에서 startStepAPI를 호출하는 것을 막는 역할
// false: 사용자가 이동할 스탭의 위치 찾는중(startStepAPI 호출 X) | true: 사용자가 올바른 스탭에 도착함(startStepAPI 호출 O)
const [isStepResolved, setIsStepResolved] = useState(false);
useEffect(() => {
  if (!project) return;

  const stepResponses = project.stepResponses ?? [];

// stepResponse가 없는 프로젝트
  if (stepResponses.length === 0) {
    setIsStepResolved(true);
    return;
  }

// stepResponse에서 userSubmittedResult(사용자가 입력한 작업 결과 입력값)이 없는 스탭의 위치를 찾음
// 여기서 나온 값을 기준으로 이어서 진행해야할 step을 찾음
  const nextStepIndex = stepResponses.findIndex(
    (step) => !step.userSubmittedResult,
  );

// 이동해야하는 스탭의 위치 (-1: 전부 제출 완료 -> 마지막 스탭 번호 | 그 이외의 값: 이어서 진행할 위치 -> 사용자가 작업 결과를 입력하지 않은 스탭 번호)
  const targetStep =
    nextStepIndex === -1 ? stepResponses.length : nextStepIndex + 1;
// 현재 URL의 스탭과 이동해야하는 스탭이 다를 경우 올바른 스탭으로 이동 | 올바른 스탭이면 isStepResolved = true
  if (stepNum !== targetStep) {
    navigate(
      `${ROUTE_PATHS.UPLOAD_STEP_BASE}/${projectId}/${targetStep}`,
      { replace: true },
    );
  } else {
    setIsStepResolved(true);
  }
}, [project, stepNum, projectId, navigate]);

useEffect(() => {
  if (!isStepResolved || !projectId || !stepCode) return;
 // startStepAPI 호출
}, [isStepResolved, projectId, stepCode]);
  • stepResponses가 없는 프로젝트(새로 만든 프로젝트) -> 기존 흐름대로 step 1 진행
  • stepResponses 있는 프로젝트 (진행 중이거나 완료된 프로젝트) → 미제출 스텝으로 이동 후 startStepAPI 호출
  • isStepResolved 상태로 스텝 판별 완료 전 불필요한 startStepAPI 호출 방지

🚀 트러블 슈팅 (Trouble Shooting)

해당 없음

⚠️ 알려진 이슈 및 참고 사항 (Known Issues & Notes)

이전 단계로 버튼

image
  • 이전 단계로 버튼을 눌렸을 때 api 중복 호출을 방지하기 위해서 추가했던 isStepResolved 값 때문에 이전 단계로 넘어가지지 않는 문제가 있습니다.
  • 다음 이슈에서 리펙토링 진행하며 이전 단계로의 버튼을 마이페이지로 넘어가는 버튼으로 변경해야할 것 같습니다.

인디케이터 ui

image
  • 해당 ui 가 각 단계를 보여주고 있으나, 각 단계로 갈 수 있는 네비게이션 버튼이 되는 건 어떤가요?

📸 스크린샷 (Screenshots)

해당 없음

#️⃣ 관련 이슈 (Related Issues)

@TTOCHIwas TTOCHIwas self-assigned this Mar 25, 2026
@TTOCHIwas TTOCHIwas added the ⚒️ Refactor 작업한 코드를 리팩토링 하는 경우 label Mar 25, 2026
@TTOCHIwas TTOCHIwas linked an issue Mar 25, 2026 that may be closed by this pull request
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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

  • 프로젝트 클릭 동작 개선: 마이페이지에서 프로젝트 클릭 시 프로젝트 상태에 따라 다른 페이지로 이동하도록 분기 처리했습니다.
  • 진행 중인 프로젝트 재개: IN_PROGRESS 상태의 프로젝트는 사용자가 이전에 작업하던 스텝부터 이어서 진행할 수 있도록 업로드 페이지로 이동합니다.
  • 완료된 프로젝트 상세 보기: COMPLETED 상태의 프로젝트는 프로젝트 상세 페이지로 이동합니다.
  • 스텝 자동 판별 로직 추가: UploadStepPage에서 userSubmittedResult가 없는 첫 번째 스텝을 찾아 해당 스텝으로 자동 이동하는 로직을 구현했습니다.
  • 불필요한 API 호출 방지: isStepResolved 상태를 도입하여 스텝 판별이 완료되기 전 불필요한 startStepAPI 호출을 방지했습니다.

🧠 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.

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new navigation flow for 'in-progress' projects, directing users to a multi-step upload page. On this upload page, a new mechanism ensures users are automatically redirected to the next uncompleted step. However, a critical issue was identified where the current redirection logic prevents users from navigating to previous steps, as it always forces them to the 'targetStep'. The reviewer suggests modifying this logic to only apply when stepNum is 1, allowing users to revisit prior steps.

Comment on lines 178 to +202
useEffect(() => {
if (!projectId || !stepCode) return;
if (!project) return;

const stepResponses = project.stepResponses ?? [];

if (stepResponses.length === 0) {
setIsStepResolved(true);
return;
}

const nextStepIndex = stepResponses.findIndex(
(step) => !step.userSubmittedResult,
);

const targetStep =
nextStepIndex === -1 ? stepResponses.length : nextStepIndex + 1;

if (stepNum !== targetStep) {
navigate(`${ROUTE_PATHS.UPLOAD_STEP_BASE}/${projectId}/${targetStep}`, {
replace: true,
});
} else {
setIsStepResolved(true);
}
}, [project, stepNum, projectId, navigate]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

PR 설명에 언급된 '이전 단계로' 버튼 비활성화 문제를 발견했습니다. 이는 사용자의 의도와 다른 페이지 이동을 유발하여 주요 기능 사용에 제약을 주는 문제입니다.

현재 구현은 stepNum과 관계없이 항상 targetStep으로 리디렉션하여, 사용자가 이전 단계로 이동할 수 없게 만듭니다.

이 로직은 사용자가 마이페이지에서 프로젝트를 처음 시작할 때만 실행되어야 합니다. 진입점이 /step/.../1 이므로, stepNum이 1일 때만 리디렉션 로직을 실행하도록 제한하면 이 문제를 해결할 수 있습니다. 아래와 같이 수정을 제안합니다.

  useEffect(() => {
    if (!project) return;

    const stepResponses = project.stepResponses ?? [];

    // 사용자가 이전 단계로 이동하는 것을 허용하기 위해,
    // 마이페이지에서 진입하는 첫 단계(stepNum === 1)에서만 다음 진행할 단계로 리디렉션합니다.
    if (stepNum === 1 && stepResponses.length > 0) {
      const nextStepIndex = stepResponses.findIndex(
        (step) => !step.userSubmittedResult,
      );

      const targetStep =
        nextStepIndex === -1 ? stepResponses.length : nextStepIndex + 1;

      if (targetStep !== stepNum) {
        navigate(`${ROUTE_PATHS.UPLOAD_STEP_BASE}/${projectId}/${targetStep}`, {
          replace: true,
        });
        return;
      }
    }

    setIsStepResolved(true);
  }, [project, stepNum, projectId, navigate]);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

다음 이슈에서 처리하려했는데 stepNum === 1일 때만 리다이렉션되도록 수정하는 게 좋을 것 같습니다.
반영하겠습니다.

@TTOCHIwas TTOCHIwas closed this Mar 25, 2026
@TTOCHIwas
Copy link
Copy Markdown
Collaborator Author

과제 업로드 단계 페이지(UploadStepPage) 리펙토링과 충돌이 있을 수 있어 두 이슈를 하나의 PR로 다시 올리겠습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚒️ Refactor 작업한 코드를 리팩토링 하는 경우

Projects

None yet

Development

Successfully merging this pull request may close these issues.

진행 중인 프로젝트 이어서 진행하도록 수정

1 participant