Skip to content

Refactor: modify card list grid (#350)#351

Open
Bangdayeon wants to merge 1 commit intomainfrom
refactor/#350-modify-card-list-grid
Open

Refactor: modify card list grid (#350)#351
Bangdayeon wants to merge 1 commit intomainfrom
refactor/#350-modify-card-list-grid

Conversation

@Bangdayeon
Copy link
Member

@Bangdayeon Bangdayeon commented Feb 4, 2026

관련 이슈

PR 설명

  • card list grid 화면 크기 변경시에 레이아웃 깨지지 않도록 수정

@Bangdayeon Bangdayeon self-assigned this Feb 4, 2026
@Bangdayeon Bangdayeon linked an issue Feb 4, 2026 that may be closed by this pull request
@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

요약

이 풀 요청은 카드 리스트 컴포넌트의 반응형 레이아웃 개선과 스크립트 실행 방식의 간소화를 포함합니다. CardList 컴포넌트는 고정된 4열 그리드에서 기본 2열, 중간 화면 이상에서 4열로 반응하는 그리드로 변경되었습니다. LinkCard 컴포넌트는 고정 크기 클래스에서 종횡비 기반의 반응형 클래스로 전환되었습니다. 또한 pre-commit 훅과 package.json의 lint 스크립트에서 exec 래퍼가 제거되어 명령어 실행이 단순화되었습니다.

Walkthrough

pre-commit 훅과 package.json의 lint 스크립트에서 exec 래퍼를 제거하여 명령어 실행이 단순화됨. CardList 컴포넌트의 그리드 레이아웃이 기본 2열에서 md 이상 4열로 변경되고 스크롤바 숨김 클래스가 적용됨. LinkCard 컴포넌트는 고정 치수에서 종횡비 기반의 반응형 클래스로 전환됨. globals.css에 WebKit용 no-scrollbar 규칙(.no-scrollbar::-webkit-scrollbar { display: none; }) 추가.

Possibly related PRs

  • Team-SoFa/linkiving PR 98 — 동일 파일(src/components/basics/CardList/CardList.tsx)에 대한 변경을 포함해 CardList 관련 코드 추가/수정이 이루어져 있어 코드 수준의 직접적 연관성이 있음.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경 사항을 명확하게 설명합니다. 카드 리스트 그리드 수정이라는 핵심 내용을 직접적으로 나타냅니다.
Description check ✅ Passed PR 설명이 저장소의 템플릿을 따르고 관련 이슈와 변경 사항을 적절히 기술했습니다.
Linked Issues check ✅ Passed 코드 변경 사항이 이슈 #350의 요구사항을 충족합니다. 반응형 그리드 적용으로 화면 크기 변화에도 레이아웃이 안정적으로 유지됩니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항이 카드 리스트 레이아웃 수정 목표와 관련이 있습니다. 패키지 관리 스크립트 간소화도 코드 정리의 일부로 범위 내입니다.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#350-modify-card-list-grid

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

@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

🤖 Fix all issues with AI agents
In `@src/components/basics/LinkCard/LinkCard.tsx`:
- Line 30: In LinkCard.tsx update the className on the root element: replace the
erroneous Tailwind token "flexs" with "flex" so the flex layout and "flex-col"
take effect; locate the className string in the LinkCard component and make that
single-token change.
- Around line 45-53: The Tailwind utilities used in LinkCard.tsx (aspect-94/47,
aspect-94/69, aspect-47/58, max-w-94) are not defined in the theme; update the
className strings in the LinkCard component to use Tailwind arbitrary-value
syntax (e.g., aspect-[94/47], aspect-[94/69], aspect-[47/58], max-w-[94px]) so
the aspect-ratio and max-width resolve correctly, keeping the same class
ordering and other classes (e.g., replace in the divs that currently use
aspect-94/47, aspect-94/69 and max-w-94).

@Bangdayeon Bangdayeon force-pushed the refactor/#350-modify-card-list-grid branch from 936b11b to 35b65a4 Compare February 22, 2026 15:38
@Bangdayeon Bangdayeon force-pushed the refactor/#350-modify-card-list-grid branch from 35b65a4 to 801bb4e Compare February 22, 2026 15:39
@Bangdayeon Bangdayeon changed the title [WIP] Refactor: modify card list grid (#350) Refactor: modify card list grid (#350) Feb 22, 2026
@Seong-Myeong
Copy link
Contributor

현 PR에서 머지 후 테스트 필요한게 어떤게 있을까요 @Bangdayeon

@Bangdayeon
Copy link
Member Author

현 PR에서 머지 후 테스트 필요한게 어떤게 있을까요 @Bangdayeon

본문 수정을 못했네요. 수정했습니다.

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

Caution

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

⚠️ Outside diff range comments (1)
src/app/(route)/all-link/AllLink.tsx (1)

58-69: ⚠️ Potential issue | 🟡 Minor

CardListno-scrollbar 클래스가 현재 구조에서 불필요합니다.

CardListoverflow 속성 없이 순수 그리드 컨테이너(grid grid-cols-2 gap-4 md:grid-cols-4)로 렌더링됩니다. 스크롤은 부모 div(Line 49, overflow-y-auto)에서 처리되므로, CardListno-scrollbar 클래스는 스크롤바를 숨길 대상이 없어 효과가 없습니다.

CardList.tsx에서 하드코딩된 no-scrollbar 클래스는 제거하거나, 향후 CardList 자체가 overflow 컨테이너가 되는 경우를 대비해 조건부 적용 가능하도록 prop이나 variant로 변경하는 것을 권장합니다.

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

In `@src/app/`(route)/all-link/AllLink.tsx around lines 58 - 69, The CardList
component is currently emitting a hardcoded "no-scrollbar" class which is
ineffective here because scrolling is handled by the parent; open CardList.tsx
and remove the hardcoded "no-scrollbar" class (or replace it with a conditional
prop/variant such as hideScrollbar:boolean or variant="no-scrollbar" that
toggles the class) so callers like AllLink.tsx (where CardList wraps LinkCard
items) don't receive an unnecessary class; if you add a prop, update usages
accordingly (e.g., remove any prop usage in AllLink.tsx) and ensure the default
behavior is unchanged when the prop is omitted.
🤖 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/basics/LinkCard/LinkCard.tsx`:
- Line 53: In LinkCard (the div with className "flex aspect-94/69 w-full flex-1
flex-col justify-between p-3") there is a conflict between flex-1 and
aspect-94/69 that can break height calculation; update that element in
LinkCard.tsx to use only one sizing approach—either remove "flex-1" if you want
the fixed aspect ratio ("aspect-94/69") to control height, or remove
"aspect-94/69" if you want the flex layout to allocate remaining height—then
ensure the remaining classes ("flex", "w-full", "flex-col", "justify-between",
"p-3") remain intact.

---

Outside diff comments:
In `@src/app/`(route)/all-link/AllLink.tsx:
- Around line 58-69: The CardList component is currently emitting a hardcoded
"no-scrollbar" class which is ineffective here because scrolling is handled by
the parent; open CardList.tsx and remove the hardcoded "no-scrollbar" class (or
replace it with a conditional prop/variant such as hideScrollbar:boolean or
variant="no-scrollbar" that toggles the class) so callers like AllLink.tsx
(where CardList wraps LinkCard items) don't receive an unnecessary class; if you
add a prop, update usages accordingly (e.g., remove any prop usage in
AllLink.tsx) and ensure the default behavior is unchanged when the prop is
omitted.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 936b11b and 45f21c0.

📒 Files selected for processing (6)
  • .husky/pre-commit
  • package.json
  • src/app/(route)/all-link/AllLink.tsx
  • src/components/basics/CardList/CardList.tsx
  • src/components/basics/LinkCard/LinkCard.tsx
  • src/styles/globals.css
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/components/basics/CardList/CardList.tsx
  • package.json
  • .husky/pre-commit

/>
</div>
<div className="flex flex-1 flex-col justify-between p-3">
<div className="flex aspect-94/69 w-full flex-1 flex-col justify-between p-3">
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# 파일 존재 여부 및 라인 53 확인
cat -n src/components/basics/LinkCard/LinkCard.tsx | sed -n '45,60p'

Repository: Team-SoFa/linkiving

Length of output: 865


🏁 Script executed:

# 제안된 검증: flex-1과 aspect-* 유틸리티가 함께 쓰인 클래스 문자열 탐색
rg -n 'flex-1.*aspect-|aspect-.*flex-1' --type tsx --type ts --type jsx

Repository: Team-SoFa/linkiving

Length of output: 90


🏁 Script executed:

# 추가 확인: aspect-94/69의 정의 또는 사용 패턴 확인
rg -n 'aspect-94/69' --type tsx --type ts --type jsx

Repository: Team-SoFa/linkiving

Length of output: 90


🏁 Script executed:

# flex-1과 aspect-* 조합 찾기 (파일 확장자 기반)
rg 'flex-1.*aspect-|aspect-.*flex-1' '.' -g '*.tsx' -g '*.ts' -g '*.jsx' -g '*.js'

Repository: Team-SoFa/linkiving

Length of output: 193


🌐 Web query:

flex-1 aspect-ratio conflict tailwind css flexbox height priority

💡 Result:

In CSS/Tailwind, flex-1 and aspect-* can “fight” because they each try to determine the item’s used size:

  • flex-1 in Tailwind sets the flex item to flex: 1 1 0% (i.e., it forces the main-axis size to be space-distributed starting from a 0 basis). In flexbox, the used flex-basis drives the item’s main-size calculation; flex-basis:auto would instead use the item’s width/height if set. (This is why changing basis changes sizing behavior.) [3][4]
  • aspect-ratio only constrains size when one dimension is “auto” (e.g., width is resolved, then height can be derived, or vice‑versa). If flexbox (or stretching) makes the “other” dimension definite, the ratio may appear ignored. [2]
  • A very common gotcha: flex containers default to align-items: stretch, so items get a stretched cross-size. When that happens, the “tallest” item can effectively dictate the row height, and other items won’t present their intended aspect ratio. Switching away from stretch (e.g. items-start) lets the item’s height be auto again so the aspect ratio can apply. [1]

Practical Tailwind fixes (pick the intent)

  1. You want the item to keep its ratio (don’t stretch its height):
<div class="flex items-start">
  <div class="flex-1 aspect-video bg-gray-200"></div>
</div>

items-start (or self-start) is the key. [1]

  1. You want flex growth, but also want width/height you set to matter more:
  • Prefer basis-auto (or don’t use flex-1) so the basis comes from w-*/h-* instead of 0%. This aligns with how flex-basis:auto uses the main-size property. [3][4]
  1. You want it to fill available height, and compute width from ratio:
  • Make height definite on the flex item/parent (h-full / h-screen / etc.), keep width auto, and use aspect-* so width derives from height. (This follows how aspect-ratio participates in sizing when a dimension is definite and the other is auto.) [2]

Sources:
[1] https://www.quirksmode.org/blog/archives/2021/05/aspectratio.html
[2] https://css-tricks.com/almanac/properties/a/aspect-ratio/
[3] https://developer.mozilla.org/docs/Web/CSS/CSS_flexible_box_layout/Controlling_ratios_of_flex_items_along_the_main_axis
[4] https://www.w3.org/TR/css-flexbox-1/


flex-1aspect-94/69가 동일 요소에 공존하여 레이아웃 충돌 가능성이 있습니다.

부모가 flex-col이고 카드 전체 높이는 aspect-47/58로 고정된 상태에서, 이 요소에 flex-1(남은 공간을 채우도록 높이 결정)과 aspect-94/69(너비 기반으로 높이 결정)가 동시에 적용되면 두 속성이 높이(main axis)를 각각 다르게 지정하려 합니다. Flexbox에서 flex-1flex-basis: 0%로 작동하여 높이 분배를 우선하고, 이로 인해 aspect-ratio가 의도한 대로 적용되지 않을 가능성이 있습니다.

aspect-94/69가 실제 레이아웃에 필요하다면 flex-1 제거를 검토하거나, flex-1으로 충분히 높이를 채우는 구조라면 aspect-94/69 제거를 확인하세요.

🔍 확인을 위한 제안 (flex-1만 사용하는 경우)
-      <div className="flex aspect-94/69 w-full flex-1 flex-col justify-between p-3">
+      <div className="flex w-full flex-1 flex-col justify-between p-3">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/basics/LinkCard/LinkCard.tsx` at line 53, In LinkCard (the div
with className "flex aspect-94/69 w-full flex-1 flex-col justify-between p-3")
there is a conflict between flex-1 and aspect-94/69 that can break height
calculation; update that element in LinkCard.tsx to use only one sizing
approach—either remove "flex-1" if you want the fixed aspect ratio
("aspect-94/69") to control height, or remove "aspect-94/69" if you want the
flex layout to allocate remaining height—then ensure the remaining classes
("flex", "w-full", "flex-col", "justify-between", "p-3") remain intact.

@Seong-Myeong
Copy link
Contributor

코드래빗 리뷰 확인부탁드립니다 @Bangdayeon

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.

[Refactor] 카드 리스트 수정

2 participants