Skip to content

title, memo 글자수 표시#453

Merged
Bangdayeon merged 1 commit intomainfrom
design/#452-show-text-length-in-title-and-memo
Mar 31, 2026
Merged

title, memo 글자수 표시#453
Bangdayeon merged 1 commit intomainfrom
design/#452-show-text-length-in-title-and-memo

Conversation

@Bangdayeon
Copy link
Copy Markdown
Member

@github-actions
Copy link
Copy Markdown

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

링크 상세 패널의 제목·메모 편집 UI를 통합·정리했습니다. 로컬 래퍼 컴포넌트(TitleTextArea, MemoTextArea)를 제거하고 공유 TextArea를 사용하도록 변경했으며, 제목과 메모 입력에 showMax를 추가해 글자 수 표시를 활성화했습니다. 메모 최대 길이는 상수 MAX_MEMO_LENGTH로 통일하고 값은 600에서 500으로 변경했습니다. 메모는 뷰/편집 모드로 분리되어 편집 시에만 TextArea가 렌더링되고, 요약 텍스트의 잘림 처리는 CSS 클래스 기반에서 인라인 스타일 기반으로 전환되었습니다.

Possibly related PRs

  • PR 223: 기존에 MemoTextArea 컴포넌트를 추가한 PR로, 본 PR이 해당 모듈을 제거하고 공유 TextArea로 대체하므로 직접적인 코드적 연관이 있습니다.
  • PR 275: LinkCardDetailPanel 및 관련 섹션(제목/메모)을 동시에 수정한 PR로, 스타일·섹션 구조 변경이 겹치므로 관련성이 높습니다.
  • PR 219: TitleTextArea 래퍼를 도입하는 변경을 포함한 PR로, 본 PR이 TitleTextArea를 제거하고 공유 TextArea로 전환한 점에서 직접 관련됩니다.
🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive PR 설명이 템플릿 구조는 따르나, '이슈 설명'이 실질적으로 비어있습니다. 관련 이슈 참조만 있고 변경사항에 대한 설명이 부족합니다. PR 설명에 변경사항의 세부 내용을 추가해주세요. 텍스트 영역 업데이트, TextArea 컴포넌트 통합, 스타일 변경 등의 주요 변경사항을 간단히라도 기술해주세요.
Out of Scope Changes check ❓ Inconclusive 일부 변경사항이 요구사항 범위를 벗어나 있습니다. 메모의 라인 클램프 제거, SummarySection의 오버플로우 로직 변경, MemoTextArea와 TitleTextArea 컴포넌트 삭제 등 UI/스타일 리팩토링이 포함되어 있습니다. 메모 UI 모드 전환(뷰/편집), 라인 클램프 제거, 컴포넌트 삭제 등 추가 변경사항이 이슈 #452와의 연관성을 명확히 설명하거나, 별도 이슈로 분리하는 것을 권장합니다.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경사항을 명확하게 반영하고 있습니다. 제목과 메모의 글자수 표시 기능 추가가 변경의 핵심이며, 제목은 이를 정확히 나타냅니다.
Linked Issues check ✅ Passed PR이 이슈 #452의 요구사항을 충족합니다. 제목과 메모 입력 시 현재 글자 수를 표시하기 위해 TextArea 컴포넌트에 showMax 속성을 추가하고 MAX_TITLE_LENGTH, MAX_MEMO_LENGTH 상수를 적용했습니다.

✏️ 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 design/#452-show-text-length-in-title-and-memo

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.

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

🧹 Nitpick comments (3)
src/components/wrappers/LinkCardDetailPanel/Sections/SummarySection.tsx (1)

134-140: 잘림 구현과 overflow 측정 기준을 같이 정리해 주세요.

Line 134-140에서 잘림은 inline maxHeight로 옮겼는데, overflow 측정은 아직 line-clamp-5를 제거/복원하는 흐름을 유지하고 있습니다. 지금은 scrollHeight 덕분에 동작하더라도 구현이 둘로 갈라져 있어서 다음 수정 때 헷갈리기 쉽습니다. 측정 로직도 현재 방식에 맞춰 같이 정리해 두는 편이 좋겠습니다.

♻️ 정리 예시
-      const wasClamped = element.classList.contains('line-clamp-5');
-      if (wasClamped) element.classList.remove('line-clamp-5');
-
       const fullHeight = element.scrollHeight;
-
-      if (wasClamped) element.classList.add('line-clamp-5');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/wrappers/LinkCardDetailPanel/Sections/SummarySection.tsx`
around lines 134 - 140, 요약 영역의 잘림 스타일과 overflow 측정 로직이 분리되어 혼란을 초래하므로 한 가지 방식으로
통일하세요: inline maxHeight 스타일 (현재 조건부로 적용되는 maxHeight: `calc(1.6em * 5)` /
overflow: 'hidden' 사용)로 잘림을 유지하고, 더 이상 class 토글(line-clamp-5 제거/복원) 흐름을 사용하지 않도록
정리합니다; 측정 로직은 SummarySection에서의 요소 참조를 이용해 기존 scrollHeight 비교 대신 maxHeight 값(또는
lineHeight * 5 계산 결과)과 clientHeight를 비교해 isExpandable/overflow 판단을 하도록 바꾸고,
isExpanded 토글 동작은 이 통일된 판단 결과를 기반으로만 작동하게 수정하세요 (참조 식별자: isExpanded,
line-clamp-5, maxHeight, scrollHeight, clientHeight).
src/components/layout/SideNavigation/components/MenuSection/AddLink/LinkThumbnailTitleSection.tsx (1)

55-63: 제목 제한값은 상수로 맞춰 두는 편이 안전합니다.

상세 패널 쪽은 이미 MAX_TITLE_LENGTH를 쓰고 있어서, 여기만 100을 직접 두면 카운터와 실제 제한값이 나중에 쉽게 어긋날 수 있습니다.

♻️ 제안
 import Skeleton from '@/components/basics/Skeleton/Skeleton';
 import Spinner from '@/components/basics/Spinner/Spinner';
 import TextArea from '@/components/basics/TextArea/TextArea';
+import { MAX_TITLE_LENGTH } from '@/lib/constants/link';
 import Image from 'next/image';
 import { Control, Controller, FieldErrors } from 'react-hook-form';
@@
-              maxLength={100}
+              maxLength={MAX_TITLE_LENGTH}
               showMax
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/layout/SideNavigation/components/MenuSection/AddLink/LinkThumbnailTitleSection.tsx`
around lines 55 - 63, The TextArea in LinkThumbnailTitleSection is using a
hardcoded maxLength of 100 which can drift from the shared MAX_TITLE_LENGTH
constant used elsewhere; replace the literal 100 with the existing
MAX_TITLE_LENGTH constant (import it if needed) and ensure the showMax/count UI
still reads from MAX_TITLE_LENGTH so the input maxLength and displayed counter
remain consistent (refer to TextArea component props and the MAX_TITLE_LENGTH
symbol).
src/components/layout/SideNavigation/components/MenuSection/AddLink/index.tsx (1)

203-211: 메모 제한값은 공용 상수를 재사용해 주세요.

여기서 500을 직접 두면 src/lib/constants/link.ts와 다시 어긋날 수 있습니다. showMax까지 붙은 만큼 카운터와 maxlength는 같은 소스를 바라보는 편이 안전합니다.

♻️ 제안
 import Modal from '@/components/basics/Modal/Modal';
 import TextArea from '@/components/basics/TextArea/TextArea';
 import { usePostLinks } from '@/hooks/usePostLinks';
+import { MAX_MEMO_LENGTH } from '@/lib/constants/link';
 import { useLinkStore } from '@/stores/linkStore';
@@
-                    maxLength={500}
+                    maxLength={MAX_MEMO_LENGTH}
                     showMax
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/layout/SideNavigation/components/MenuSection/AddLink/index.tsx`
around lines 203 - 211, Replace the hardcoded 500 used in the TextArea props
(maxLength on the TextArea with id "memo-input") with the shared constant
exported from src/lib/constants/link.ts (import the constant, e.g.
MEMO_MAX_LENGTH or the project’s equivalent) and use that single constant for
both the maxLength prop and the showMax counter so the memo limit in the AddLink
TextArea remains synchronized with the shared link constants.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/wrappers/LinkCardDetailPanel/Sections/MemoSection.tsx`:
- Around line 80-95: The div with className memoCard() currently enters edit
mode on focus which breaks keyboard navigation; remove the onFocus handler so
editing only starts on click or the onKeyDown Enter/Space handlers (leave
role="button", tabIndex={0} and the onKeyDown logic intact) — update the JSX for
the div (the element that sets role="button", tabIndex, onClick, onFocus,
onKeyDown) to drop onFocus={() => setIsEditing(true)}.

In `@src/components/wrappers/LinkCardDetailPanel/Sections/TitleSection.tsx`:
- Around line 68-74: TextArea is currently rendered without a
placeholder/aria-label so the shared TextArea falls back to the default
screen-reader string ("무엇이든 물어보세요"); update the TitleSection's TextArea usage
(the component rendering internalTitle, ref titleAreaRef, and MAX_TITLE_LENGTH)
to pass an explicit accessible label—either set aria-label="Link title" (or a
localized equivalent) or provide a meaningful placeholder prop that doubles as
the aria-label—so screen readers announce an appropriate label for the title
field.

In `@src/lib/constants/link.ts`:
- Line 2: The PR lowered MAX_MEMO_LENGTH to 500 which changes UX for existing
memos; restore the original MAX_MEMO_LENGTH constant (keep the prior larger
value) in src/lib/constants/link.ts and do not change memo validation limit, and
instead add a frontend character counter tied to MAX_MEMO_LENGTH (use the same
constant) so the UI shows currentLength / MAX_MEMO_LENGTH without enforcing a
stricter server-side limit; refer to MAX_MEMO_LENGTH when wiring the counter and
validation logic so behavior stays consistent.

---

Nitpick comments:
In
`@src/components/layout/SideNavigation/components/MenuSection/AddLink/index.tsx`:
- Around line 203-211: Replace the hardcoded 500 used in the TextArea props
(maxLength on the TextArea with id "memo-input") with the shared constant
exported from src/lib/constants/link.ts (import the constant, e.g.
MEMO_MAX_LENGTH or the project’s equivalent) and use that single constant for
both the maxLength prop and the showMax counter so the memo limit in the AddLink
TextArea remains synchronized with the shared link constants.

In
`@src/components/layout/SideNavigation/components/MenuSection/AddLink/LinkThumbnailTitleSection.tsx`:
- Around line 55-63: The TextArea in LinkThumbnailTitleSection is using a
hardcoded maxLength of 100 which can drift from the shared MAX_TITLE_LENGTH
constant used elsewhere; replace the literal 100 with the existing
MAX_TITLE_LENGTH constant (import it if needed) and ensure the showMax/count UI
still reads from MAX_TITLE_LENGTH so the input maxLength and displayed counter
remain consistent (refer to TextArea component props and the MAX_TITLE_LENGTH
symbol).

In `@src/components/wrappers/LinkCardDetailPanel/Sections/SummarySection.tsx`:
- Around line 134-140: 요약 영역의 잘림 스타일과 overflow 측정 로직이 분리되어 혼란을 초래하므로 한 가지 방식으로
통일하세요: inline maxHeight 스타일 (현재 조건부로 적용되는 maxHeight: `calc(1.6em * 5)` /
overflow: 'hidden' 사용)로 잘림을 유지하고, 더 이상 class 토글(line-clamp-5 제거/복원) 흐름을 사용하지 않도록
정리합니다; 측정 로직은 SummarySection에서의 요소 참조를 이용해 기존 scrollHeight 비교 대신 maxHeight 값(또는
lineHeight * 5 계산 결과)과 clientHeight를 비교해 isExpandable/overflow 판단을 하도록 바꾸고,
isExpanded 토글 동작은 이 통일된 판단 결과를 기반으로만 작동하게 수정하세요 (참조 식별자: isExpanded,
line-clamp-5, maxHeight, scrollHeight, clientHeight).
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2930d5c9-59b2-4fd8-bc45-89ba45bdf017

📥 Commits

Reviewing files that changed from the base of the PR and between 488e088 and 6141d04.

📒 Files selected for processing (10)
  • src/components/layout/SideNavigation/components/MenuSection/AddLink/LinkThumbnailTitleSection.tsx
  • src/components/layout/SideNavigation/components/MenuSection/AddLink/index.tsx
  • src/components/wrappers/LinkCardDetailPanel/LinkCardDetailPanel.style.ts
  • src/components/wrappers/LinkCardDetailPanel/Sections/MemoSection.tsx
  • src/components/wrappers/LinkCardDetailPanel/Sections/SummarySection.tsx
  • src/components/wrappers/LinkCardDetailPanel/Sections/TitleSection.tsx
  • src/components/wrappers/LinkCardDetailPanel/TitleTextArea.tsx
  • src/components/wrappers/MemoTextArea/MemoTextArea.tsx
  • src/lib/constants/link.ts
  • src/stories/MemoTextArea.stories.tsx
💤 Files with no reviewable changes (3)
  • src/components/wrappers/LinkCardDetailPanel/TitleTextArea.tsx
  • src/components/wrappers/MemoTextArea/MemoTextArea.tsx
  • src/stories/MemoTextArea.stories.tsx

Comment thread src/lib/constants/link.ts
@Bangdayeon Bangdayeon force-pushed the design/#452-show-text-length-in-title-and-memo branch from 6141d04 to 9b908cb Compare March 26, 2026 11:41
@github-actions
Copy link
Copy Markdown

@Bangdayeon Bangdayeon force-pushed the design/#452-show-text-length-in-title-and-memo branch from 9b908cb to a7cb1f4 Compare March 31, 2026 11:33
@github-actions
Copy link
Copy Markdown

@Bangdayeon Bangdayeon merged commit 57c10eb into main Mar 31, 2026
4 of 5 checks passed
@Bangdayeon Bangdayeon deleted the design/#452-show-text-length-in-title-and-memo branch March 31, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

제목 및 메모 작성 시 현재 작성 중인 글자 수 노출

2 participants