Skip to content

[fix]지원서가 만들어지지 않던 문제 해결 #679

Merged
Zepelown merged 2 commits intomainfrom
develop-fe
Aug 19, 2025
Merged

[fix]지원서가 만들어지지 않던 문제 해결 #679
Zepelown merged 2 commits intomainfrom
develop-fe

Conversation

@Zepelown
Copy link
Member

@Zepelown Zepelown commented Aug 19, 2025

#️⃣연관된 이슈

ex) #이슈번호, #이슈번호

📝작업 내용

  • 저번에 이벤트를 바꾸어 해결했던건 onInput이 contenteditable div에 적용되는 이벤트가 아니여서 state가 변경되지않음에 따라 정상적으로 된것처럼 보인것입니다.
  • 따라서 div태그대신 textarea로 변경하여 오류를 수정하였습니다

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

  • New Features
    • 제목 입력을 텍스트 영역으로 개선해 여러 줄 편집과 가독성을 강화.
  • Bug Fixes
    • 글자 수 제한이 일관되게 적용되고, 줄바꿈/단어 줄바꿈이 안정적으로 동작.
    • 스크롤·오버플로우로 인한 텍스트 잘림 해소.
    • 답변 모드에서 편집이 비활성화되어 오입력 방지.
  • Style
    • 자동 높이 조절 및 줄바꿈 가독성 향상.
  • Refactor
    • 입력을 제어형으로 전환해 값/변경 처리를 일관화.

@vercel
Copy link

vercel bot commented Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
moadong Ready Ready Preview Comment Aug 19, 2025 4:12am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 19, 2025

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • 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

Walkthrough

QuestionTitle 컴포넌트의 편집 방식을 contentEditable div에서 제어되는 textarea로 전환. 스타일 선언을 textarea 기반으로 변경하고 wrapping/오버플로우 속성을 조정. TSX에서는 readOnly/value/onChange를 사용하는 제어 컴포넌트 패턴으로 업데이트.

Changes

Cohort / File(s) Change Summary
QuestionTitle 편집 모델 전환
frontend/src/components/application/QuestionTitle/QuestionTitle.styles.ts, frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
styled.div를 styled.textarea로 변경. textarea에 field-sizing, pre-wrap, overflow 제어 등 스타일 추가. 컴포넌트를 contentEditable → 제어된 textarea(value/onChange)로 전환하고 모드별 readOnly 적용, onChange에서 e.target.value 사용 및 maxLength 검사 유지.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant QuestionTitle as QuestionTitle (textarea)
  participant Parent as Parent Component

  User->>QuestionTitle: 입력 (builder 모드)
  QuestionTitle->>QuestionTitle: onChange(e.target.value) + maxLength 검사
  QuestionTitle-->>Parent: onTitleChange(title)
  Parent-->>QuestionTitle: props.title 갱신 (value로 반영)

  User->>QuestionTitle: 포커스/입력 시도 (answer 모드)
  QuestionTitle->>QuestionTitle: readOnly=true로 입력 차단
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

🐞 Bug, 🛠Fix, 💻 FE

Suggested reviewers

  • lepitaaar
  • seongwon030
  • oesnuj
  • PororoAndFriends

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop-fe

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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
Contributor

@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: 2

🔭 Outside diff range comments (1)
frontend/src/components/application/QuestionTitle/QuestionTitle.styles.ts (1)

50-57: textarea에서는 &:empty:before 기반 placeholder가 동작하지 않습니다

textarea는 ::before/::after가 적용되지 않고, :empty도 기대대로 매칭되지 않습니다. 현재 data-placeholder로 전달해도 표시되지 않아 placeholder가 사라지는 UX 이슈가 발생합니다. 표준 placeholder 속성 사용으로 전환해야 합니다.

아래처럼 CSS를 교체해 주세요:

-  &:empty:before {
-    content: attr(data-placeholder);
-    color: #c5c5c5;
-  }
-
-  &:focus:before {
-    opacity: 0;
-  }
+  &::placeholder {
+    color: #c5c5c5;
+  }

TSX 쪽에서도 data-placeholder 대신 placeholder 속성을 사용하도록 함께 수정 제안(별도 코멘트 참고).

🧹 Nitpick comments (1)
frontend/src/components/application/QuestionTitle/QuestionTitle.tsx (1)

31-36: onChange의 길이 체크는 maxLength 속성으로 대체 가능(간소화 제안)

이미 maxLength 속성을 추가하면 중복된 로직이 됩니다. 간결성을 위해 제거 고려 바랍니다.

간소화 예:

-          onChange={(e) => {
-            const value = e.target.value || '';
-            if (value.length <= APPLICATION_FORM.QUESTION_TITLE.maxLength) {
-              onTitleChange?.(value);
-            }
-          }}
+          onChange={(e) => onTitleChange?.(e.target.value ?? '')}
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c573134 and 6835258.

📒 Files selected for processing (2)
  • frontend/src/components/application/QuestionTitle/QuestionTitle.styles.ts (1 hunks)
  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
frontend/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (frontend/.cursorrules)

frontend/**/*.{ts,tsx}: Replace magic numbers with named constants for clarity.
Replace complex or nested ternary operators with if/else statements or IIFEs for readability.
Assign complex boolean conditions to named variables.
Use consistent return types for similar functions and hooks.
Avoid hidden side effects; functions should only perform actions implied by their signature (Single Responsibility Principle).
Use unique, descriptive names for custom wrappers and functions to avoid ambiguity.
Define constants near related logic or ensure names link them clearly.

Files:

  • frontend/src/components/application/QuestionTitle/QuestionTitle.styles.ts
  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
frontend/**/*.tsx

📄 CodeRabbit Inference Engine (frontend/.cursorrules)

frontend/**/*.tsx: Abstract complex logic/interactions into dedicated components or higher-order components (HOCs).
Separate significantly different conditional UI/logic into distinct components.
Colocate simple, localized logic or use inline definitions to reduce context switching.
Choose field-level or form-level cohesion based on form requirements.
Break down broad state management into smaller, focused hooks or contexts.
Use component composition instead of props drilling.

Files:

  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
🧬 Code Graph Analysis (1)
frontend/src/components/application/QuestionTitle/QuestionTitle.tsx (1)
frontend/src/constants/APPLICATION_FORM.ts (1)
  • APPLICATION_FORM (1-26)
🔇 Additional comments (1)
frontend/src/components/application/QuestionTitle/QuestionTitle.styles.ts (1)

35-44: textarea 전환으로 입력 이벤트/상태 동기화 문제 해결 — 방향 좋습니다

contentEditable div 대신 textarea로 바꾼 선택이 문제의 근본 원인(onInput 미적용)을 제거합니다. 제어 컴포넌트 패턴과의 궁합도 좋습니다.

Comment on lines +45 to +48
field-sizing: content;
white-space: pre-wrap;
overflow-wrap: break-word;
overflow: hidden;
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

field-sizing: content + overflow: hidden 조합은 비지원 브라우저에서 내용이 잘릴 수 있음

field-sizing: content는 아직 브라우저 지원이 고르지 않습니다. 해당 속성이 무시되는 환경에서 overflow: hidden이 유지되면 textarea 높이가 늘지 않아 입력 내용이 가려질 수 있습니다.

권장 대응:

  • 최소 안전망: overflow를 auto로 바꿔 스크롤이라도 노출되게 합니다.
  • 더 나은 UX: 자동 리사이즈(JS 기반) 또는 react-textarea-autosize 도입.

해당 라인에 대한 최소 수정안:

-  overflow: hidden;
+  /* Fallback: ensure content is still accessible when field-sizing is unsupported */
+  overflow: auto;

추가로 TSX에서 rows={1}를 부여하면 초기 높이를 줄이면서도 스크롤이 필요 시 나타납니다(아래 TSX 코멘트에 함께 제안).
Safari/Firefox에서 실제 입력 시 줄바꿈이 여러 줄일 때 내용이 보이는지 확인 부탁드립니다.


overflow:hidden 사용 시 field-sizing 미지원 브라우저에서 내용 가려짐
field-sizing: content가 아직 주요 브라우저에서 일관되게 지원되지 않아, 해당 속성이 무시되면 overflow: hidden으로 인해 textarea 높이가 늘어나지 않아 입력 내용이 잘려 보일 수 있습니다.

권장 대응:

  • 최소 안전망: overflow: auto로 변경해 스크롤이 나타나도록 합니다.
  • UX 개선: JS 기반 자동 리사이징 로직 또는 react-textarea-autosize 도입을 검토합니다.
  • 초기 높이를 조절하려면 TSX에서 <textarea rows={1} /> 속성 추가도 고려해 주세요.

수정 예시 (frontend/src/components/application/QuestionTitle/QuestionTitle.styles.ts:45–48):

-  overflow: hidden;
+  /* field-sizing 미지원 환경 대비: 컨텐츠 접근성 보장 */
+  overflow: auto;

Safari/Firefox 등 실제 브라우저에서 여러 줄 입력 시 정상 동작하는지 반드시 확인 부탁드립니다.

📝 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
field-sizing: content;
white-space: pre-wrap;
overflow-wrap: break-word;
overflow: hidden;
field-sizing: content;
white-space: pre-wrap;
overflow-wrap: break-word;
/* field-sizing 미지원 환경 대비: 컨텐츠 접근성 보장 */
overflow: auto;
🤖 Prompt for AI Agents
In frontend/src/components/application/QuestionTitle/QuestionTitle.styles.ts
around lines 45–48, the stylesheet uses "field-sizing: content" with "overflow:
hidden", which causes textarea content to be clipped in browsers that ignore
field-sizing; change "overflow: hidden" to "overflow: auto" as a minimum fix so
scrollbars appear when content exceeds size, and as a follow-up either implement
JS-based auto-resizing or integrate react-textarea-autosize and set an initial
rows={1} on the textarea element in the TSX to improve UX; after changes verify
multi-line input behavior in Safari and Firefox.

Comment on lines +29 to 38
readOnly={mode === 'answer'}
suppressContentEditableWarning={true}
onChange={(e) => {
const value = e.currentTarget.textContent || '';
const value = e.target.value || '';
if (value.length <= APPLICATION_FORM.QUESTION_TITLE.maxLength) {
onTitleChange?.(value);
}
}}
value={title}
data-placeholder={title ? '' : APPLICATION_FORM.QUESTION_TITLE.placeholder}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

contentEditable 잔여 prop 제거, placeholder/maxLength/rows 추가 제안

  • suppressContentEditableWarning은 textarea에서 불필요합니다(잔존 코드로 보임).
  • placeholder는 data-placeholder가 아닌 표준 placeholder 속성 사용이 맞습니다(현 스타일 전환과 부합).
  • maxLength를 속성으로도 지정하면 네이티브 차단/보조 기술 호환성이 좋아집니다.
  • rows={1}로 초기 높이를 낮추되, 스타일의 overflow fallback과 함께 사용 시 안전합니다.

적용 diff:

         <Styled.QuestionTitleText
-          readOnly={mode === 'answer'}
-          suppressContentEditableWarning={true}
+          readOnly={mode === 'answer'}
+          rows={1}
+          maxLength={APPLICATION_FORM.QUESTION_TITLE.maxLength}
           onChange={(e) => {
             const value = e.target.value || '';
             if (value.length <= APPLICATION_FORM.QUESTION_TITLE.maxLength) {
               onTitleChange?.(value);
             }
           }}
           value={title}
-          data-placeholder={title ? '' : APPLICATION_FORM.QUESTION_TITLE.placeholder}
+          placeholder={APPLICATION_FORM.QUESTION_TITLE.placeholder}
         >

원하시면 자동 리사이즈 훅/컴포넌트(useAutosizeTextarea 또는 react-textarea-autosize 도입)도 추가해드리겠습니다.

🤖 Prompt for AI Agents
In frontend/src/components/application/QuestionTitle/QuestionTitle.tsx around
lines 29 to 38, remove the leftover suppressContentEditableWarning prop (it's
for contentEditable, not textarea), replace data-placeholder with the standard
placeholder prop, add a native maxLength attribute set to
APPLICATION_FORM.QUESTION_TITLE.maxLength, and add rows={1} to set initial
height (keeping existing overflow/resize styling); leave readOnly logic as-is
and keep the onChange handler but let the browser enforce maxLength while still
guarding value length in the handler.

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

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

textarea로 수정 좋습니다

Copy link
Contributor

@lepitaaar lepitaaar left a comment

Choose a reason for hiding this comment

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

수고하셧습니다!ㅜ 나머지 오류 고쳐보죠

@Zepelown Zepelown merged commit ecba609 into main Aug 19, 2025
4 checks passed
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.

3 participants