Skip to content

fix: 커뮤니티 기본 썸네일 숨김#557

Open
manNomi wants to merge 1 commit into
mainfrom
fix/community-list-hide-empty-thumbnail
Open

fix: 커뮤니티 기본 썸네일 숨김#557
manNomi wants to merge 1 commit into
mainfrom
fix/community-list-hide-empty-thumbnail

Conversation

@manNomi

@manNomi manNomi commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

  • resolves: #이슈 번호

작업 내용

  • 커뮤니티 리스트에서 게시글에 실제 첨부 이미지가 있을 때만 오른쪽 썸네일을 표시하도록 수정했습니다.
  • 사진이 없는 게시글은 솔커 로고/기본 이미지 placeholder 썸네일 영역을 렌더링하지 않습니다.
  • 서버가 기본 썸네일 경로(/images/article-thumb.png, /images/site-thumbnail.png, placeholder svg 등)를 내려주는 경우도 실제 게시글 이미지가 아닌 것으로 보고 숨기도록 방어했습니다.
  • 썸네일 영역이 사라지는 경우 본문 영역이 자연스럽게 남은 너비를 사용하도록 min-w-0 flex-1을 적용했습니다.

특이 사항

  • 실제 첨부 이미지 URL이 있는 게시글의 썸네일 렌더링과 fallback 동작은 유지했습니다.
  • 로컬 Node 버전이 repo 권장 22.x와 달라 Unsupported engine 경고가 출력되지만 검증은 통과했습니다.

리뷰 요구사항 (선택)

  • 기본 썸네일 URL을 숨기는 조건이 서버 응답 형태와 맞는지 확인 부탁드립니다.
  • 사진 없는 게시글에서 오른쪽 여백/썸네일 박스가 사라지는 UI가 의도와 맞는지 봐주세요.

검증

  • pnpm --filter @solid-connect/web lint:check
  • pnpm --filter @solid-connect/web typecheck:ci
  • pre-commit CI parity checks 통과
  • pre-push CI parity checks 및 @solid-connect/web build 통과

@manNomi manNomi requested review from enunsnv and wibaek as code owners June 17, 2026 02:37
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
solid-connect-university-web Ready Ready Preview, Comment Jun 17, 2026 2:39am
solid-connection-web Ready Ready Preview, Comment Jun 17, 2026 2:39am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connect-web-admin Skipped Skipped Jun 17, 2026 2:39am

@github-actions github-actions Bot added the web label Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 679dd5a3-e696-4559-8604-bc8da9931825

📥 Commits

Reviewing files that changed from the base of the PR and between 430af70 and 650a46c.

📒 Files selected for processing (1)
  • apps/web/src/app/community/[boardCode]/PostCards.tsx

Walkthrough

  1. 불필요한 import 제거

    • IconSolidConnentionLogo import가 PostCards.tsx에서 삭제됨.
  2. getPostThumbnailSrc 유틸 신규 추가

    • DEFAULT_THUMBNAIL_PATHS 집합을 정의하여 기본 썸네일 경로 목록을 관리함.
    • try/catch 기반 URL 파싱으로 pathname을 추출하고, 기본 경로·SVG placeholder·파싱 실패 시 null을 반환함.
  3. PostCard 렌더링 로직 변경

    • 기존의 postThumbnailUrl 존재 여부 분기(이미지 vs 기본 아이콘) 대신, getPostThumbnailSrc 결과(thumbnailSrc)가 유효할 때만 썸네일 영역을 렌더링하도록 변경됨.
    • priorityImage에 따른 Imageloading 처리는 기존과 동일하게 유지됨.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목 'fix: 커뮤니티 기본 썸네일 숨김'은 PR의 주요 변경사항을 명확하게 요약하고 있으며, 커뮤니티 리스트에서 기본 썸네일을 숨기는 핵심 목적을 정확히 전달합니다.
Description check ✅ Passed PR 설명이 템플릿의 필수 섹션을 모두 포함하고 있으며, 작업 내용, 특이 사항, 리뷰 요구사항이 구체적이고 상세하게 작성되어 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/community-list-hide-empty-thumbnail

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.

@manNomi

manNomi commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@codex review getPostThumbnailSrc

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 650a46c96f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@manNomi

manNomi commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai getPostThumbnailSrc로 동작이 달라질수 있습니까 ?

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
fd "PostCards.tsx" --exec cat {}

Length of output: 4820


🏁 Script executed:

#!/bin/bash
fd "cdnUrl" --exec cat {}

Length of output: 10427



@manNomi 네! 코드를 전부 분석했습니다. getPostThumbnailSrc달라질 수 있는 케이스를 아래에 정리했습니다.


✅ 정상적으로 필터링되는 케이스

  1. 상대 경로로 오는 경우

    • 입력: /images/article-thumb.png
    • normalizeImageUrlToUploadCdn → 그대로 /images/article-thumb.png 반환
    • pathname 추출 → /images/article-thumb.pngDEFAULT_THUMBNAIL_PATHS에 매칭 → null 반환
  2. default CDN URL로 오는 경우

    • 입력: https://cdn.default.solid-connection.com/images/article-thumb.png
    • normalizeImageUrlToUploadCdn → upload CDN으로 변환, pathname은 동일하게 유지
    • DEFAULT_THUMBNAIL_PATHS에 매칭 → null 반환
  3. 쿼리스트링이 붙은 경우

    • 입력: https://cdn.upload.solid-connection.com/images/article-thumb.png?v=1
    • URL.pathname은 쿼리를 제외하므로 pathname = /images/article-thumb.pngnull 반환
  4. SVG placeholder 경로

    • /svgs/placeholders/... 패턴 → null 반환

⚠️ 동작이 달라질 수 있는 에지 케이스

  1. 대소문자 불일치 (케이스 센시티브 이슈)

    • 서버가 /Images/article-thumb.png (대문자 I)처럼 내려주면
    • DEFAULT_THUMBNAIL_PATHS는 소문자 기준이라 매칭 실패 → 기본 썸네일이 그대로 노출될 수 있음
    • 현재 서버 응답 포맷이 항상 소문자라면 문제없지만, 방어적으로 처리하려면 아래처럼 비교할 수 있습니다:
      DEFAULT_THUMBNAIL_PATHS.has(thumbnailPathname.toLowerCase())
  2. 외부 도메인 URL의 과도한 필터링

    • 만약 외부 서버가 우연히 /images/article-thumb.png 경로를 사용하면
    • normalizeImageUrlToUploadCdn는 외부 도메인을 그대로 반환하지만
    • pathname이 일치하여 의도치 않게 필터링될 수 있음
    • 실제 서비스에서 발생 가능성은 낮지만, 논리적으로 존재하는 케이스입니다
  3. /article-thumb.png (prefix 없는 형태)

    • 입력: article-thumb.png (슬래시 없는 상대 key)
    • normalizeImageUrlToUploadCdn → upload CDN URL로 변환 → pathname = /article-thumb.png
    • DEFAULT_THUMBNAIL_PATHS/article-thumb.png 포함 → null 반환 ✓ (이미 대응됨)

요약

케이스 동작
일반 CDN 이미지 URL ✅ 정상 표시
/images/article-thumb.png 계열 ✅ 정상 필터링
/svgs/placeholders/ 계열 ✅ 정상 필터링
대소문자 다른 경로 ⚠️ 필터링 누락 가능
외부 도메인 + 동일 path ⚠️ 과도한 필터링 가능

가장 주의할 점은 대소문자 처리입니다. 서버 응답이 항상 소문자라면 현재 코드로 충분하지만, 확실히 하려면 thumbnailPathname.toLowerCase()로 비교하는 것을 권장드립니다! 🐇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant