Skip to content

Conversation

@YouD0313
Copy link
Collaborator

@YouD0313 YouD0313 commented Jun 9, 2025

구현내용

유저 활동기록 문의하기 답변완료시 ui 수정
content 개행 받아올 수 있게 수정 사이드바 높이 100%로 수정

연관이슈

close #338

Summary by CodeRabbit

  • 신규 기능

    • 문의 답변 상태를 시각적으로 구분할 수 있는 스타일이 추가되었습니다.
    • 문의 답변 내용이 있을 경우, 답변 섹션이 별도로 표시됩니다.
  • 버그 수정

    • 문의 답변 작성/수정 버튼의 표시 조건이 기존보다 정확하게 동작하도록 개선되었습니다.
  • 개선 및 스타일

    • 답변 입력란이 자동으로 높이가 조절되어 가독성이 향상되었습니다.
    • 여러 컴포넌트의 간격, 줄바꿈, 오버플로우 등 스타일이 개선되어 UI가 더 깔끔해졌습니다.
    • 사이드바가 컨테이너 높이에 맞춰 전체 영역을 차지하도록 수정되었습니다.
  • 기타

    • 문의 처리 후 페이지 이동 타이밍이 자연스럽게 동작하도록 개선되었습니다.

@YouD0313 YouD0313 requested a review from layout-SY June 9, 2025 14:24
@YouD0313 YouD0313 self-assigned this Jun 9, 2025
@YouD0313 YouD0313 linked an issue Jun 9, 2025 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Jun 9, 2025

"""

Walkthrough

이 변경사항은 사용자 마이페이지 활동기록의 문의 UI를 개선하고, 문의 답변 관련 컴포넌트의 스타일 및 동작을 수정합니다. 주요 변경점에는 문의 답변 상태 표시, 답변 내용 표시 구조 추가, textarea 높이 자동 조절, 스타일 세부 조정 등이 포함됩니다.

Changes

파일/그룹 변경 요약
src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.styled.ts, Inquiry.tsx 문의 답변 상태 및 내용 표시용 styled 컴포넌트 추가 및 적용, 답변 textarea 자동 높이 조절, 답변 상태에 따라 스타일 변경
src/components/admin/adminInquiry/AdminInquiryAnswer.styled.ts, AdminInquiryAnswerWrite.styled.ts 답변 컨테이너 margin-bottom 추가, textarea resize 속성 제거 등 스타일 수정
src/components/admin/adminInquiry/AdminInquiryDetailContent.styled.ts 문의 내용의 줄바꿈 및 오버플로우 처리 스타일 추가
src/components/admin/adminInquiry/AdminInquiryAnswer.tsx 답변 버튼 상태 결정 로직을 answerData 기준으로 수정
src/components/admin/adminInquiry/AdminInquiryAnswerWrite.tsx textarea 높이 자동 조절 useEffect 추가, JSX self-closing 태그로 수정
src/components/common/admin/sidebar/AdminSidebar.styled.ts SidebarContainer에 height: 100% 스타일 추가
src/hooks/admin/useAdminInquiry.ts 버튼 상태 처리 로직에서 타임아웃 처리 개선

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant InquiryComponent
    participant StyledComponents

    User->>InquiryComponent: 문의 목록에서 문의 클릭
    InquiryComponent->>InquiryComponent: isOpen 상태 변경
    InquiryComponent->>StyledComponents: 문의 상태 및 답변 여부에 따라 스타일 적용
    InquiryComponent->>InquiryComponent: 답변 textarea 렌더 및 높이 자동 조절
    InquiryComponent->>User: 문의 및 답변 내용 표시
Loading

Assessment against linked issues

Objective Addressed Explanation
사용자 마이페이지 활동기록 문의 ui , api type 수정 (#338)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
SidebarContainer에 height: 100% 스타일 추가 (src/components/common/admin/sidebar/AdminSidebar.styled.ts) 마이페이지 활동기록 문의 UI와 직접 관련 없는 어드민 사이드바 스타일 변경입니다.

Suggested labels

🛠개선

Suggested reviewers

  • layout-SY
  • hyeongjun6364

Poem

🐇
문의 답변이 예쁘게,
줄바꿈도 잘 보이게!
답변 상태 색도 변하고,
textarea는 쏙쏙 늘어나네.
마이페이지 토끼도 신나서,
귀를 쫑긋 세웠네!
📝✨
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-09T14_44_21_941Z-debug-0.log


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3398240 and 8487c8d.

📒 Files selected for processing (1)
  • src/hooks/admin/useAdminInquiry.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/hooks/admin/useAdminInquiry.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: accessibility-test
✨ 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.

Copy link

@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

🧹 Nitpick comments (2)
src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.tsx (2)

24-32: 미사용 코드를 제거하거나 사용 목적을 명확히 하세요.

answerRefhandleChangeAnswerRef 함수가 정의되었지만 실제로 사용되지 않고 있습니다. 만약 향후 사용 계획이 있다면 주석으로 설명하고, 그렇지 않다면 제거하세요.

또한 옵셔널 체이닝을 사용하여 안전성을 높이세요:

  const handleChangeAnswerRef = () => {
-    if (answerRef && answerRef.current) {
+    if (answerRef.current) {
      answerRef.current.style.height = 'auto';
      answerRef.current.style.height = `${answerRef.current.scrollHeight}px`;
    }
  };
🧰 Tools
🪛 Biome (1.9.4)

[error] 28-28: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


43-47: 불필요한 삼항 연산자를 단순화하세요.

조건식을 더 간단하게 표현할 수 있습니다.

-          <S.InquiryStateSpan $isCompletedAnswer={list.state ? true : false}>
+          <S.InquiryStateSpan $isCompletedAnswer={!!list.state}>
🧰 Tools
🪛 Biome (1.9.4)

[error] 44-44: Unnecessary use of boolean literals in conditional expression.

Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with

(lint/complexity/noUselessTernary)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9b9ba14 and 3398240.

📒 Files selected for processing (9)
  • src/components/admin/adminInquiry/AdminInquiryAnswer.styled.ts (1 hunks)
  • src/components/admin/adminInquiry/AdminInquiryAnswer.tsx (1 hunks)
  • src/components/admin/adminInquiry/AdminInquiryAnswerWrite.styled.ts (1 hunks)
  • src/components/admin/adminInquiry/AdminInquiryAnswerWrite.tsx (2 hunks)
  • src/components/admin/adminInquiry/AdminInquiryDetailContent.styled.ts (1 hunks)
  • src/components/common/admin/sidebar/AdminSidebar.styled.ts (1 hunks)
  • src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.styled.ts (3 hunks)
  • src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.tsx (4 hunks)
  • src/hooks/admin/useAdminInquiry.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/hooks/admin/useAdminInquiry.ts (1)
src/constants/admin/adminModal.ts (1)
  • ADMIN_MODAL_MESSAGE (1-8)
🪛 Biome (1.9.4)
src/components/admin/adminInquiry/AdminInquiryAnswerWrite.tsx

[error] 49-49: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.tsx

[error] 28-28: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 44-44: Unnecessary use of boolean literals in conditional expression.

Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with

(lint/complexity/noUselessTernary)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: accessibility-test
🔇 Additional comments (14)
src/components/common/admin/sidebar/AdminSidebar.styled.ts (1)

20-20: 사이드바 높이 설정이 올바르게 적용되었습니다.

사이드바가 전체 높이를 차지하도록 하는 변경사항이 적절하게 구현되었습니다. 기존의 position: fixed 스타일과 잘 조화됩니다.

src/components/admin/adminInquiry/AdminInquiryAnswer.styled.ts (1)

13-15: 문의 답변 컨테이너 간격 조정이 적절합니다.

하단 여백을 추가하여 UI 레이아웃을 개선하는 변경사항입니다. 다른 관련 컴포넌트들과 일관된 간격을 유지합니다.

src/components/admin/adminInquiry/AdminInquiryAnswer.tsx (1)

18-18: 버튼 라벨 로직이 더 명확하고 안정적으로 개선되었습니다.

로컬 상태 대신 props의 answerData를 직접 확인하여 '작성하기'/'수정하기' 버튼을 결정하는 것이 더 신뢰성 있는 접근입니다. 데이터의 원본 소스를 기반으로 UI를 결정하는 올바른 패턴입니다.

src/components/admin/adminInquiry/AdminInquiryAnswerWrite.styled.ts (2)

18-20: 컨테이너 하단 여백이 일관되게 적용되었습니다.

다른 문의 관련 컴포넌트들과 동일한 margin-bottom: 5rem; 적용으로 일관된 UI 간격을 유지합니다.


43-47: textarea 리사이징 제한 제거가 적절합니다.

resize: none; 속성을 제거하여 사용자가 textarea 크기를 조절할 수 있게 하거나, 자동 크기 조절 기능과 연동되도록 개선된 것으로 보입니다. 사용자 경험 향상에 도움이 됩니다.

src/components/admin/adminInquiry/AdminInquiryDetailContent.styled.ts (1)

48-49: 스타일링 개선이 적절합니다.

white-space: pre-lineoverflow: hidden 속성 추가로 문의 내용의 줄바꿈이 제대로 표시되고 컨테이너 밖으로 내용이 넘치는 것을 방지합니다.

src/components/admin/adminInquiry/AdminInquiryAnswerWrite.tsx (1)

104-104: JSX 구문 정리가 적절합니다.

자체 닫힘 태그로 변경한 것이 좋습니다.

src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.tsx (2)

1-1: React 명시적 임포트가 좋습니다.

React와 필요한 훅들을 명시적으로 임포트한 것이 좋습니다.


74-84: 답변 내용 표시 로직이 잘 구현되었습니다.

조건부 렌더링을 통한 답변 내용 표시와 새로운 UI 컴포넌트들의 구성이 적절합니다.

src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.styled.ts (5)

1-1: LGTM! css 헬퍼 추가가 적절합니다.

조건부 스타일링을 위해 css 헬퍼를 import에 추가한 것이 올바른 변경사항입니다.


28-40: 조건부 스타일링이 잘 구현되었습니다.

$isCompletedAnswer prop을 기반으로 한 조건부 스타일링이 올바르게 구현되었습니다. 테마 색상을 일관성 있게 사용하고 있어 좋습니다.


72-74: LGTM! 답변 컨텐츠 컨테이너 스타일링이 적절합니다.

적절한 여백을 제공하는 간단하고 깔끔한 구현입니다.


76-80: LGTM! Flex 레이아웃이 잘 구성되었습니다.

gap과 margin을 사용한 flex 레이아웃이 답변 컨텐츠 구조화에 적절합니다.


90-94: LGTM! 줄바꿈 지원이 잘 구현되었습니다.

white-space: pre-line 속성을 통해 PR 목표에 명시된 줄바꿈 지원이 올바르게 구현되었습니다. 폰트 스타일링도 적절합니다.

Comment on lines +48 to +53
useEffect(() => {
if (inputRef && inputRef.current) {
inputRef.current.style.height = 'auto';
inputRef.current.style.height = `${inputRef.current.scrollHeight}px`;
}
}, [answer]);
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

텍스트에어리어 높이 자동 조절 로직을 개선하세요.

자동 높이 조절 기능은 좋지만 몇 가지 개선이 필요합니다:

  1. 옵셔널 체이닝을 사용하여 안전성을 높이세요
  2. handleChangeAnswer 함수와 코드 중복이 있습니다

다음과 같이 수정하세요:

  useEffect(() => {
-    if (inputRef && inputRef.current) {
+    if (inputRef.current) {
      inputRef.current.style.height = 'auto';
      inputRef.current.style.height = `${inputRef.current.scrollHeight}px`;
    }
  }, [answer]);

그리고 높이 조절 로직을 별도 함수로 분리하여 중복을 제거하는 것을 권장합니다:

const adjustTextareaHeight = () => {
  if (inputRef.current) {
    inputRef.current.style.height = 'auto';
    inputRef.current.style.height = `${inputRef.current.scrollHeight}px`;
  }
};
🧰 Tools
🪛 Biome (1.9.4)

[error] 49-49: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🤖 Prompt for AI Agents
In src/components/admin/adminInquiry/AdminInquiryAnswerWrite.tsx around lines 48
to 53, the textarea auto height adjustment logic should be improved by using
optional chaining for safer access to inputRef.current and by extracting the
height adjustment code into a separate function to avoid duplication with
handleChangeAnswer. Create a function like adjustTextareaHeight that sets the
height to 'auto' and then to the scrollHeight, and call this function both in
the useEffect and in handleChangeAnswer to centralize and reuse the logic.

Comment on lines +82 to +88
export const InquiryAnswerIconWrapper = styled.div`
align-items: start;
svg {
width: 1rem;
height: 1rem;
}
`;
Copy link

@coderabbitai coderabbitai bot Jun 9, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

display: flex 속성을 추가해야 합니다.

align-items: start를 사용하고 있지만 display: flex가 없어 align-items가 작동하지 않습니다.

다음 diff를 적용하여 수정하세요:

 export const InquiryAnswerIconWrapper = styled.div`
+  display: flex;
   align-items: start;
   svg {
     width: 1rem;
     height: 1rem;
   }
 `;
📝 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
export const InquiryAnswerIconWrapper = styled.div`
align-items: start;
svg {
width: 1rem;
height: 1rem;
}
`;
export const InquiryAnswerIconWrapper = styled.div`
display: flex;
align-items: start;
svg {
width: 1rem;
height: 1rem;
}
`;
🤖 Prompt for AI Agents
In src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.styled.ts
lines 82 to 88, the InquiryAnswerIconWrapper styled component uses align-items:
start without display: flex, so align-items has no effect. Add display: flex to
the InquiryAnswerIconWrapper styles to enable the flex container behavior and
make align-items work as intended.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

부모에 이미 있잖아

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

@YouD0313 부모 컨테이너에 display: flex가 있는 것은 맞지만, InquiryAnswerIconWrapper 자체에서 align-items: start를 사용하려면 해당 요소도 flex 컨테이너가 되어야 합니다.

부모의 display: flexInquiryAnswerIconWrapper를 flex 아이템으로 만들지만, 그 내부 콘텐츠(SVG 아이콘)를 정렬하려면 InquiryAnswerIconWrapper 자체도 flex 컨테이너여야 합니다.

실제 사용 방식을 확인해보겠습니다.


🏁 Script executed:

# Check how InquiryAnswerIconWrapper is used in the TSX file
cat src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.tsx | grep -A 10 -B 5 "InquiryAnswerIconWrapper"

Length of output: 801


@YouD0313 맞습니다! 다시 확인해보니 InquiryAnswerIconWrapper는 단일 아이콘만 포함하고 있고, 부모 컨테이너인 InquiryAnswerContentWrapper에서 이미 flex 레이아웃을 처리하고 있네요.

이 경우 InquiryAnswerIconWrapperalign-items: start는 실제로 불필요할 수 있습니다. 아이콘과 텍스트의 정렬은 부모 컨테이너의 flex 속성으로 충분히 제어되기 때문입니다.

제 이전 제안이 틀렸습니다. 죄송합니다!

🐰💭

    /|   /|  
   ( :v:  ) 
    |(_)|

✏️ Learnings added
Learnt from: YouD0313
PR: devpalsPlus/frontend#342
File: src/components/user/mypage/activityLog/inquiries/inquiry/Inquiry.styled.ts:82-88
Timestamp: 2025-06-09T14:42:43.429Z
Learning: InquiryAnswerIconWrapper는 단일 ChevronRightIcon만 포함하며, 부모 InquiryAnswerContentWrapper가 이미 display: flex로 레이아웃을 제어하고 있어서 align-items: start 속성이 불필요할 수 있음

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@YouD0313 YouD0313 merged commit ebef691 into develop Jun 9, 2025
4 checks passed
@YouD0313 YouD0313 deleted the feat/#338 branch June 9, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

사용자 마이페이지 활동기록 문의 ui 수정

3 participants