Skip to content

채팅 입력창 멀티라인 입력 시 UI 개선#743

Open
Cassiiopeia wants to merge 1 commit intomainfrom
20260327_#716_채팅_입력창_멀티라인_입력_시_UI_개선

Hidden character warning

The head ref may contain hidden characters: "20260327_#716_\ucc44\ud305_\uc785\ub825\ucc3d_\uba40\ud2f0\ub77c\uc778_\uc785\ub825_\uc2dc_UI_\uac1c\uc120"
Open

채팅 입력창 멀티라인 입력 시 UI 개선#743
Cassiiopeia wants to merge 1 commit intomainfrom
20260327_#716_채팅_입력창_멀티라인_입력_시_UI_개선

Conversation

@Cassiiopeia
Copy link
Copy Markdown
Member

@Cassiiopeia Cassiiopeia commented Apr 1, 2026

Summary by CodeRabbit

Bug Fixes

  • 채팅 입력 필드의 높이 계산이 개선되어 여러 줄 입력 시 더 부드러운 확장 동작을 제공합니다.
  • 전송 버튼의 위치가 조정되어 입력 필드와 더 나은 레이아웃을 이룹니다.
  • 입력 필드의 모서리 곡선이 높이 변화에 따라 동적으로 조정됩니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Walkthrough

채팅 입력 필드의 높이 계산 로직을 개선하고 입력 바 UI를 리팩토링했습니다. 동적 높이/테두리 반경 계산을 추가하고, 전송 버튼을 suffixIcon에서 독립적인 위젯으로 분리하여 구조를 개선했습니다.

Changes

Cohort / File(s) Summary
Input Field Height Computation
lib/screens/chat_room_screen.dart, lib/widgets/chat_input_bar.dart
높이 계산을 줄 수(1~5줄로 제한)에 따라 동적으로 계산하도록 변경. 높이 경계값 유지(40.h ~ 70.h) 및 선형 보간을 이용한 테두리 반경 동적 조정 추가
Send Button Refactoring
lib/widgets/chat_input_bar.dart
전송 버튼을 TextFieldsuffixIcon에서 독립적인 InkWell 위젯(40.w x 40.w)으로 분리. 행 정렬을 center에서 end로 변경

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • SeoHyun1024
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 목표를 명확하게 설명하고 있습니다. 채팅 입력창의 멀티라인 입력 시 UI 개선이라는 내용은 두 파일의 변경사항(높이 조정, 라운드값 동적 전환, 버튼 위치 변경)과 직접적으로 일치합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 20260327_#716_채팅_입력창_멀티라인_입력_시_UI_개선

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

✅ 프로젝트 빌드 성공

APK 빌드가 완료되었습니다.

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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/widgets/chat_input_bar.dart (1)

81-146: ⚠️ Potential issue | 🟠 Major

Colors.transparentAppColors.transparent로 교체해주세요 (라인 120)

AppColors 전용 정책을 지키기 위해 직접 Flutter 색상 코드 대신 AppColors.transparent를 사용해야 합니다.

iPad 높이 스케일링 조합 위반 (라인 84, 107)

height: clampedHeight(.h 스케일링) + contentPadding.vertical: 8.h(.h 스케일링) 조합은 iPad에서 오버플로우를 유발합니다. 세로 패딩을 고정 픽셀값(예: 8.0)으로 변경하세요.

전송 버튼 분리로 인한 포커스 손실

버튼을 TextField 바깥으로 분리하면서 포커스 복구 경로가 차단되었습니다. lib/screens/chat_room_screen.dart_sendMessage()가 텍스트만 비우고 포커스를 복구하지 않아, 버튼 탭 후 키보드가 닫히면 연속 입력 UX가 끊깁니다. TextFieldTapRegion으로 묶거나 FocusNode를 전달해 onSend 콜백 뒤 requestFocus()를 보장해주고, 실기기에서 버튼 탭 후 키보드 유지 여부도 확인해주세요.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/widgets/chat_input_bar.dart` around lines 81 - 146, Replace direct
Flutter color usage and fix iPad scaling and focus loss: change
Colors.transparent to AppColors.transparent in the Material widget (around the
InkWell/Material containing the send button), change the TextField's
InputDecoration contentPadding vertical from using 8.h to a fixed pixel value
like 8.0 to avoid iPad overflow when clampedHeight already uses .h, and restore
focus after sending by wiring a FocusNode or wrapping both TextField and the
send button in a TextFieldTapRegion so that the onSend callback (e.g., the
onSend passed into this widget and the chat screen's _sendMessage in
lib/screens/chat_room_screen.dart) calls requestFocus(focusNode) after clearing
the controller; ensure sendDisabled gating remains unchanged and test on-device
to confirm keyboard stays up after tapping the separated button.
🧹 Nitpick comments (2)
lib/widgets/chat_input_bar.dart (2)

84-107: 고정 높이와 vertical: .h 패딩 조합은 iPad에서 입력 영역을 더 빨리 잠식합니다.

height: clampedHeightcontentPadding.vertical: 8.h가 같이 스케일돼서 큰 화면일수록 실제 텍스트 공간이 예상보다 빨리 줄어듭니다. vertical padding은 고정 px로 두거나 높이 고정을 없애는 쪽이 안전합니다. As per coding guidelines, Never combine height: N.h with padding: vertical: N.h as both scale on iPad causing overflow. Use fixed pixel padding instead.

가능한 수정 방향
-                  contentPadding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.h),
+                  contentPadding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/widgets/chat_input_bar.dart` around lines 84 - 107, The TextField's fixed
height (clampedHeight) is combined with vertical EdgeInsets using scaled units
(8.h), causing the input area to shrink on large screens; update the widget so
you do NOT use a scaled vertical padding with a scaled height: either remove the
explicit height (clampedHeight) and rely on minLines/maxLines in the TextField,
or change contentPadding's vertical value to a fixed pixel value (e.g., 8.0)
instead of 8.h; locate the TextField block (controller, enabled,
minLines/maxLines, cursor..., decoration) and adjust the height vs
contentPadding accordingly to avoid combining N.h for both clampedHeight and
vertical padding.

119-120: Colors.transparentAppColors로 통일해 주세요.

Line 120에서 직접 색 상수를 다시 도입해서 이 파일의 색상 관리가 여기만 예외가 됩니다. 투명 색도 AppColors를 통해 참조하는 편이 일관됩니다. As per coding guidelines, Use AppColors for color values in Flutter (direct Color code definition prohibited).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/widgets/chat_input_bar.dart` around lines 119 - 120,
chat_input_bar.dart에서 Material 위젯에 직접 Colors.transparent를 사용하고 있어 색상 관리 규칙을
위반합니다; Material의 color 속성에 직접 Colors.transparent 대신 프로젝트의 중앙 색상 정의인 AppColors의
투명 색상 멤버(예: AppColors.transparent)로 교체하고 필요한 AppColors import가 없으면 추가하세요; 참조 멤버
이름이 다르다면 AppColors에 투명 색상 멤버를 추가하거나 기존 멤버명에 맞춰 사용하고, 변경 후 위젯(예: the Material
instance inside ChatInputBar) 동작이 동일한지 간단히 확인하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/screens/chat_room_screen.dart`:
- Around line 134-138: 현재 _updateInputFieldHeight에서 줄 수를 '\n'만으로 계산해 자동 줄바꿈된 시각적
라인 수를 반영하지 않습니다; _messageController.text 대신 TextPainter(또는 RenderParagraph)를 사용해
실제 렌더링된 텍스트의 line metrics를 계산하거나 TextField의 minLines/maxLines/expands 동작에 맡겨 높이를
결정하도록 변경하세요. 구체적으로는 _updateInputFieldHeight에서 TextStyle과 MediaQuery 또는 컨테이너의 가용
너비를 사용해 TextPainter를 생성하고 layout 후 computeLineMetrics()로 라인 수를 구해 clampedLines를
계산해 _inputFieldHeight를 설정하거나, 더 간단하게는 TextField의 minLines/maxLines 속성과
onChanged에서 setState로 높이 제어를 제거해 자연 높이에 맡기세요. Ensure you reference
_messageController, _updateInputFieldHeight and _inputFieldHeight when making
the change.

---

Outside diff comments:
In `@lib/widgets/chat_input_bar.dart`:
- Around line 81-146: Replace direct Flutter color usage and fix iPad scaling
and focus loss: change Colors.transparent to AppColors.transparent in the
Material widget (around the InkWell/Material containing the send button), change
the TextField's InputDecoration contentPadding vertical from using 8.h to a
fixed pixel value like 8.0 to avoid iPad overflow when clampedHeight already
uses .h, and restore focus after sending by wiring a FocusNode or wrapping both
TextField and the send button in a TextFieldTapRegion so that the onSend
callback (e.g., the onSend passed into this widget and the chat screen's
_sendMessage in lib/screens/chat_room_screen.dart) calls requestFocus(focusNode)
after clearing the controller; ensure sendDisabled gating remains unchanged and
test on-device to confirm keyboard stays up after tapping the separated button.

---

Nitpick comments:
In `@lib/widgets/chat_input_bar.dart`:
- Around line 84-107: The TextField's fixed height (clampedHeight) is combined
with vertical EdgeInsets using scaled units (8.h), causing the input area to
shrink on large screens; update the widget so you do NOT use a scaled vertical
padding with a scaled height: either remove the explicit height (clampedHeight)
and rely on minLines/maxLines in the TextField, or change contentPadding's
vertical value to a fixed pixel value (e.g., 8.0) instead of 8.h; locate the
TextField block (controller, enabled, minLines/maxLines, cursor..., decoration)
and adjust the height vs contentPadding accordingly to avoid combining N.h for
both clampedHeight and vertical padding.
- Around line 119-120: chat_input_bar.dart에서 Material 위젯에 직접 Colors.transparent를
사용하고 있어 색상 관리 규칙을 위반합니다; Material의 color 속성에 직접 Colors.transparent 대신 프로젝트의 중앙
색상 정의인 AppColors의 투명 색상 멤버(예: AppColors.transparent)로 교체하고 필요한 AppColors import가
없으면 추가하세요; 참조 멤버 이름이 다르다면 AppColors에 투명 색상 멤버를 추가하거나 기존 멤버명에 맞춰 사용하고, 변경 후 위젯(예:
the Material instance inside ChatInputBar) 동작이 동일한지 간단히 확인하세요.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f3b68cce-b95a-4f97-849c-fbabda135427

📥 Commits

Reviewing files that changed from the base of the PR and between dfbe492 and 22f72ef.

📒 Files selected for processing (2)
  • lib/screens/chat_room_screen.dart
  • lib/widgets/chat_input_bar.dart

Comment on lines 134 to 138
void _updateInputFieldHeight() {
final lineCount = '\n'.allMatches(_messageController.text).length + 1;
double newHeight = 40.h + ((lineCount - 1) * 14.h);
final clampedLines = lineCount.clamp(1, 5);
double newHeight = 40.h + ((clampedLines - 1) * 7.5.h);
newHeight = newHeight.clamp(40.h, 70.h);
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 | 🟠 Major

자동 줄바꿈된 줄 수는 아직 높이 계산에 반영되지 않습니다.

지금은 \n 개수만 세기 때문에, 사용자가 긴 한 줄을 입력해 TextField가 시각적으로 여러 줄로 감겨도 _inputFieldHeight는 1줄 높이로 유지됩니다. 이번 PR의 핵심 시나리오가 자동 줄바꿈이라면, 렌더링된 line metrics 기준으로 계산하거나 TextField의 자연 높이(minLines/maxLines)에 맡기는 쪽이 안전합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/screens/chat_room_screen.dart` around lines 134 - 138, 현재
_updateInputFieldHeight에서 줄 수를 '\n'만으로 계산해 자동 줄바꿈된 시각적 라인 수를 반영하지 않습니다;
_messageController.text 대신 TextPainter(또는 RenderParagraph)를 사용해 실제 렌더링된 텍스트의
line metrics를 계산하거나 TextField의 minLines/maxLines/expands 동작에 맡겨 높이를 결정하도록 변경하세요.
구체적으로는 _updateInputFieldHeight에서 TextStyle과 MediaQuery 또는 컨테이너의 가용 너비를 사용해
TextPainter를 생성하고 layout 후 computeLineMetrics()로 라인 수를 구해 clampedLines를 계산해
_inputFieldHeight를 설정하거나, 더 간단하게는 TextField의 minLines/maxLines 속성과 onChanged에서
setState로 높이 제어를 제거해 자연 높이에 맡기세요. Ensure you reference _messageController,
_updateInputFieldHeight and _inputFieldHeight when making the change.

Copy link
Copy Markdown
Collaborator

@SeoHyun1024 SeoHyun1024 left a comment

Choose a reason for hiding this comment

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

토끼 리뷰만 체크부탁드립니다 줄바꿈하지 않으면 textField 높이가 그대로네요
@Cassiiopeia

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.

2 participants