Skip to content

fix: 사용하지 않는 타입 삭제#187

Merged
Yejiin21 merged 1 commit intodevelopfrom
fix/#186/build-error
Jun 21, 2025
Merged

fix: 사용하지 않는 타입 삭제#187
Yejiin21 merged 1 commit intodevelopfrom
fix/#186/build-error

Conversation

@Yejiin21
Copy link
Copy Markdown
Contributor

@Yejiin21 Yejiin21 commented Jun 21, 2025

Summary by CodeRabbit

  • Refactor
    • 파일 업로드, 텍스트 에디터, 링크 입력 컴포넌트의 상태 관리 방식을 변경하여 입력값과 변경 핸들러를 제거했습니다.

@Yejiin21 Yejiin21 self-assigned this Jun 21, 2025
@Yejiin21 Yejiin21 added the 🛠️ BugFix 오류 해결 과정 기록 label Jun 21, 2025
@Yejiin21 Yejiin21 linked an issue Jun 21, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 21, 2025

Walkthrough

이 변경사항은 EventDetailPage.tsx에서 FileUpload, TextEditor, LinkInput 컴포넌트에 대한 제어 컴포넌트 패턴을 제거합니다. 각 컴포넌트에서 valueonChange 프롭이 삭제되어, 로컬 상태와의 연결이 끊어졌습니다.

Changes

파일/경로 변경 요약
src/pages/dashboard/ui/EventDetailPage.tsx FileUpload, TextEditor, LinkInput에서 valueonChange 프롭 제거

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EventDetailPage
    participant FileUpload
    participant TextEditor
    participant LinkInput

    User->>EventDetailPage: 페이지 진입/렌더링
    EventDetailPage->>FileUpload: 컴포넌트 렌더링 (프롭 없이)
    EventDetailPage->>TextEditor: 컴포넌트 렌더링 (프롭 없이)
    EventDetailPage->>LinkInput: 컴포넌트 렌더링 (프롭 없이)
Loading

Possibly related PRs

  • fix: 기능/CSS 에러 수정 및 개선 #143: FileUpload 컴포넌트에 새로운 선택적 프롭 useDefaultImage를 추가하고, 사용 시 명시적으로 useDefaultImage={false}를 전달하도록 수정합니다. 본 PR과 마찬가지로 FileUpload 사용 방식을 변경하므로 코드 레벨에서 연관성이 있습니다.

Suggested reviewers

  • hyeeuncho
  • xaexunxang

Poem

🐰
폼의 값과 변화, 이제는 자유롭게
연결된 줄을 풀고, 컴포넌트는 홀가분하게
FileUpload도, TextEditor도, LinkInput도
제어의 손길 없이, 자신만의 길로
대시보드의 봄바람 따라,
코드도 마음도 가벼워지네!

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🔭 Outside diff range comments (1)
src/pages/dashboard/ui/EventDetailPage.tsx (1)

19-21: 사용되지 않는 상태 변수들을 정리하세요.

컴포넌트들과의 연결이 끊어진 상태 변수들(bannerImageUrl, description, referenceLinks)이 여전히 선언되어 있습니다. 이들이 실제로 사용되지 않는다면 관련 코드도 함께 정리해야 합니다.

만약 이 상태 변수들이 정말 필요 없다면 다음과 같이 정리하세요:

-  const [bannerImageUrl, setBannerImageUrl] = useState('');
-  const [description, setDescription] = useState('');
-  const [referenceLinks, setReferenceLinks] = useState<Link[]>([]);

그리고 useEffecthandleSave에서도 해당 코드들을 제거하세요 (23-30번째 줄, 40-42번째 줄).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 049083a and 9851c82.

📒 Files selected for processing (1)
  • src/pages/dashboard/ui/EventDetailPage.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: storybook

<FileUpload value={bannerImageUrl} onChange={setBannerImageUrl} useDefaultImage={false} />
<TextEditor value={description} onChange={setDescription} />
<LinkInput value={referenceLinks} onChange={setReferenceLinks} />
<FileUpload onChange={setBannerImageUrl} useDefaultImage={false} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

FileUpload 컴포넌트의 제어 패턴이 불완전합니다.

FileUpload 컴포넌트에서 value prop은 제거되었지만 onChange는 유지되어 있어 불완전한 제어 컴포넌트가 되었습니다. 이는 예상치 못한 동작을 일으킬 수 있습니다.

다음 중 하나의 방법으로 수정하세요:

방법 1: 완전한 제어 컴포넌트로 복원

-        <FileUpload onChange={setBannerImageUrl} useDefaultImage={false} />
+        <FileUpload value={bannerImageUrl} onChange={setBannerImageUrl} useDefaultImage={false} />

방법 2: 상태 변수가 실제로 사용되지 않는다면 제거

-        <FileUpload onChange={setBannerImageUrl} useDefaultImage={false} />
+        <FileUpload useDefaultImage={false} />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<FileUpload onChange={setBannerImageUrl} useDefaultImage={false} />
<FileUpload value={bannerImageUrl} onChange={setBannerImageUrl} useDefaultImage={false} />
🤖 Prompt for AI Agents
In src/pages/dashboard/ui/EventDetailPage.tsx at line 69, the FileUpload
component is used with an onChange prop but without a value prop, making it a
partially controlled component which can cause unexpected behavior. To fix this,
either restore the value prop to make FileUpload a fully controlled component by
managing its state externally, or if the state variable for the value is not
used elsewhere, remove the onChange handler and treat FileUpload as an
uncontrolled component.

<LinkInput value={referenceLinks} onChange={setReferenceLinks} />
<FileUpload onChange={setBannerImageUrl} useDefaultImage={false} />
<TextEditor />
<LinkInput />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

LinkInput과 상태 간의 연결이 끊어졌습니다.

LinkInput 컴포넌트에서 모든 props가 제거되었지만, referenceLinks 상태 변수는 여전히 handleSave 함수에서 사용되고 있습니다 (42번째 줄). 이로 인해 사용자가 입력한 링크 정보가 저장되지 않습니다.

다음 중 하나의 방법으로 수정하세요:

방법 1: 제어 컴포넌트로 복원

-        <LinkInput />
+        <LinkInput value={referenceLinks} onChange={setReferenceLinks} />

방법 2: referenceLinks 상태가 불필요하다면 handleSave에서 제거

-      referenceLinks: referenceLinks.map(({ title, url }) => ({ title, url })) || data.result.referenceLinks || [],
+      referenceLinks: data.result.referenceLinks || [],
🤖 Prompt for AI Agents
In src/pages/dashboard/ui/EventDetailPage.tsx at line 71, the LinkInput
component is no longer connected to the referenceLinks state, but handleSave at
line 42 still uses referenceLinks, causing user input not to be saved. Fix this
by either restoring LinkInput as a controlled component passing referenceLinks
and its setter as props, or if referenceLinks is no longer needed, remove all
references to it including from handleSave to avoid using stale or undefined
data.

<TextEditor value={description} onChange={setDescription} />
<LinkInput value={referenceLinks} onChange={setReferenceLinks} />
<FileUpload onChange={setBannerImageUrl} useDefaultImage={false} />
<TextEditor />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

TextEditor와 상태 간의 연결이 끊어졌습니다.

TextEditor 컴포넌트에서 모든 props가 제거되었지만, description 상태 변수는 여전히 handleSave 함수에서 사용되고 있습니다 (41번째 줄). 이로 인해 사용자가 입력한 내용이 저장되지 않습니다.

다음 중 하나의 방법으로 수정하세요:

방법 1: 제어 컴포넌트로 복원

-        <TextEditor />
+        <TextEditor value={description} onChange={setDescription} />

방법 2: description 상태가 불필요하다면 handleSave에서 제거

-      description: description || data.result.description || '',
+      description: data.result.description || '',
🤖 Prompt for AI Agents
In src/pages/dashboard/ui/EventDetailPage.tsx at line 70, the TextEditor
component is no longer connected to the description state, but handleSave at
line 41 still uses description, causing user input not to be saved. Fix this by
either restoring TextEditor as a controlled component passing description and an
onChange handler to update the state, or if description state is unnecessary,
remove its usage from handleSave to avoid referencing stale or missing data.

@m3k0813
Copy link
Copy Markdown
Member

m3k0813 commented Jun 21, 2025

LGTMM~

@Yejiin21 Yejiin21 merged commit c0ee440 into develop Jun 21, 2025
2 checks passed
@Yejiin21 Yejiin21 deleted the fix/#186/build-error branch June 21, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ BugFix 오류 해결 과정 기록

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] yarn run build시 사용하지 않는 타입 오류 해결

2 participants