Skip to content

title, memo 글자수 표시#453

Open
Bangdayeon wants to merge 1 commit intomainfrom
design/#452-show-text-length-in-title-and-memo
Open

title, memo 글자수 표시#453
Bangdayeon wants to merge 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

Warning

Rate limit exceeded

@Bangdayeon has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 23 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f237c5cb-0715-4f8d-a9e5-d8cdeb6e4970

📥 Commits

Reviewing files that changed from the base of the PR and between 6141d04 and 9b908cb.

📒 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

Walkthrough

이 변경은 링크 상세 패널의 제목 및 메모 편집 인터페이스를 통합합니다. 기존의 TitleTextAreaMemoTextArea 래퍼 컴포넌트를 제거하고 공유 TextArea 컴포넌트로 통합하며, 제목과 메모 입력 시 글자 수 표시(showMax)를 추가합니다. 메모의 최대 길이를 600에서 500으로 단축하고, 메모 섹션의 UI를 뷰/편집 모드로 재구성하며, 요약 텍스트 잘림 처리를 CSS 클래스에서 인라인 스타일로 변경합니다.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive PR 설명이 제공된 템플릿 구조에 맞춰져 있으나, '관련 이슈' 섹션과 'PR 설명' 섹션 모두 내용이 거의 없습니다. 'PR 설명' 섹션의 내용이 'eom'만 있어 불충분합니다. PR 설명 섹션에 변경사항의 세부 내용, 구현 방식, 또는 주요 변경점에 대한 설명을 추가하여 검토자가 변경사항을 쉽게 이해할 수 있도록 작성해주세요.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 PR의 주요 변경사항을 명확하게 설명합니다. 제목 및 메모 필드에 글자수 표시 기능을 추가하는 것이 이번 PR의 핵심입니다.
Linked Issues check ✅ Passed PR의 코드 변경사항들이 이슈 #452의 요구사항인 '제목 및 메모 작성 시 현재 글자 수 노출'을 충족합니다. TextArea에 showMax 속성 추가, MAX_MEMO_LENGTH 상수 변경, 관련 UI 컴포넌트 수정이 모두 글자수 표시 기능 구현을 지원합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 글자수 표시 기능 구현과 관련되어 있습니다. TitleTextArea와 MemoTextArea 컴포넌트 제거는 TextArea 컴포넌트로 통합하는 리팩토링이며, SummarySection의 line-clamp 처리 변경도 일관된 UI 개선의 일부입니다.

✏️ 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

@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

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