Skip to content

[Refactor/#144] 캠페인 상세 및 광고 리스트 UX/UI 리팩토링 - #148

Merged
YermIm merged 7 commits into
developfrom
refactor/#144
Mar 28, 2026
Merged

YermIm merged 7 commits into
developfrom
refactor/#144

Conversation

@YermIm

@YermIm YermIm commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

🚨 관련 이슈

close #144

✨ 변경사항

  • 🐞 BugFix Something isn't working
  • 💻 CrossBrowsing Browser compatibility
  • 🌏 Deploy Deploy
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (storybook, jest, etc.)

✏️ 작업 내용

Tracking URL O
스크린샷 2026-03-27 오후 10 56 01
스크린샷 2026-03-27 오후 11 12 14
Tracking.URL.X.mov

캠페인 상세 헤더 및 반응형 레이아웃 개선

  • 뒤로가기 버튼 생성
  • 카드 컴포넌트 제거 및 상세 정보 배치
  • 태블릿 모드 시 등록날짜 세로 배치로 전환

광고 리스트 AdRow UI 최적화

  • 광고 리스트 행 구조를 [상태] - [플랫폼] - [광고명] 으로 변경하여 더 직관적으로 인지할 수 있도록 개선

광고 상세 정보 AdDetailContent 및 트래킹 로직 리팩토링

  • 레이아웃 가로 확장
  • 트래킹 링크 발급 프로세스 개선
    • 서비스 내 중단이 불가능하여 트래킹 중단 버튼 제거
    • 트래킹 링크 있을 시 링크 복사하기, 없을 시 링크 발급하기 버튼으로 변경
  • controlBox 크기 축소

😅 미완성 작업

N/A

📢 논의 사항 및 참고 사항

현재 워크스페이스 1의 캠페인 1에 대한 데이터가 없어서, 작업 시 MainLayout.tsx에서 캠페인 ID를 2로 고정하여 진행했습니다.

💬 리뷰어 가이드 (P-Rules)
P1: 필수 반영 (Critical) - 버그 가능성, 컨벤션 위반. 해결 전 머지 불가.
P2: 적극 권장 (Recommended) - 더 나은 대안 제시. 가급적 반영 권장.
P3: 제안 (Suggestion) - 아이디어 공유. 반영 여부는 드라이버 자율.
P4: 단순 확인/칭찬 (Nit) - 사소한 오타, 칭찬 등 피드백.

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 캠페인 상세 페이지에 뒤로가기 버튼 추가
    • 추적 링크 발급 및 복사 흐름 추가(발급 모달·복사 동작)
  • UI/스타일 개선

    • 캠페인 헤더 레이아웃 재구성(이름·상태·등록일·예산·설명 표시)
    • 광고 상세 섹션에 섹션 헤더·간격·배지·링크 스타일 업데이트
    • 광고 목록 행 레이아웃 최적화(타이틀·플랫폼·버튼 정렬)
    • 모달 버튼의 커서 스타일 개선
  • 버그 수정

    • 추적 링크 발급 시 랜딩 URL 누락에 대한 오류 처리 및 토스트 알림 추가

@YermIm
YermIm requested review from Seojegyeong and jjjsun March 27, 2026 14:57
@YermIm YermIm self-assigned this Mar 27, 2026
@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b5415945-39eb-4214-abce-128686f188f0

📥 Commits

Reviewing files that changed from the base of the PR and between 9562c5b and 4a14f33.

📒 Files selected for processing (1)
  • src/pages/ads/list/CampaignDetail.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pages/ads/list/CampaignDetail.tsx

📝 Walkthrough

Walkthrough

캠페인 상세 페이지 UI와 광고 상세의 트래킹 제어 흐름을 리팩토링했습니다. 트래킹 링크 발급 흐름으로 제어 로직을 단순화하고, 캠페인 헤더와 광고 행 레이아웃을 재구성했으며 모달 버튼 스타일을 소폭 조정했습니다.

Changes

Cohort / File(s) Summary
Tracking control / Ad detail
src/components/ads/AdDetailContent.tsx
기존의 "stop tracking" 제어를 제거하고 단일 "트래킹 링크 발급(trackControl)" 흐름으로 전환. 버튼 텍스트를 ad.trackingUrl 유무에 따라 "링크 발급하기"/"링크 복사하기"로 변경하고, 발급 모달에서 ad.landingUrl 유효성 검사 및 에러 토스트 처리 추가. 레이아웃에 섹션 헤더("광고 소재", "타겟", "랜딩 URL") 추가 및 배지/링크 스타일(class) 업데이트.
Ad list row layout
src/components/ads/AdRow.tsx
고정 폭 컬럼에서 flex 기반 레이아웃으로 전환(flex-1 min-w-0 등). 플랫폼/타이틀/상태 배치와 마진·정렬 조정으로 버튼/chevron 위치 재배치.
Modal content style
src/components/common/modal/ModalContent.tsx
모달 내부 Button에 cursor-pointer 클래스 추가(스타일 속성 변경만).
Campaign detail page
src/pages/ads/list/CampaignDetail.tsx
useNavigate() 도입 및 뒤로가기 버튼 추가. 헤더를 스택형으로 재구성(캠페인명 + 상태 배지, 등록일, 예산 요약, 설명). CampaignInfoCard/PlatformCard 제거하고 LogoMap으로 플랫폼 아이콘을 인라인 렌더링하도록 변경. 페이지 패딩 조정(py-15 px-25py-10 px-20).

Sequence Diagram

sequenceDiagram
    participant 사용자 as User
    participant AdDetail as AdDetailContent
    participant Modal as ModalContent
    participant 클립보드 as Clipboard

    User->>AdDetail: "링크 발급하기" 클릭
    activate AdDetail
    AdDetail->>Modal: 발급 모달 오픈
    deactivate AdDetail

    activate Modal
    User->>Modal: "발급하기" 클릭
    Modal->>AdDetail: landingUrl 검증 요청

    alt landingUrl 없음
        AdDetail->>User: 에러 토스트("랜딩 URL 필요") 표시
    else landingUrl 존재
        AdDetail->>클립보드: 트래킹 링크 복사 시도
        클립보드->>User: 복사 성공/실패 응답
        Modal->>Modal: 모달 닫기
    end
    deactivate Modal
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #83: 같은 컴포넌트(AdDetailContent.tsx, AdRow.tsx, CampaignDetail.tsx)를 건드린 변경으로, 트래킹 ControlBox/발급 흐름과 레이아웃 변경의 직접적 연관성이 큽니다.
  • PR #92: 트래킹 제어 흐름을 수정한 PR로, 발급 vs. 중단 로직 전환과 Modal 동작 관련 코드가 겹칩니다.
  • PR #71: ControlBox 컴포넌트를 도입한 PR로, 이번 변경에서 ControlBox 사용/동작 방식(트래킹 버튼 텍스트/액션)이 영향을 받습니다.

Suggested reviewers

  • jjjsun
  • Seojegyeong
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 PR의 주요 변경사항을 명확히 요약하고 있으며, 캠페인 상세 페이지와 광고 리스트의 UX/UI 리팩토링이라는 핵심 내용을 잘 나타냄.
Description check ✅ Passed PR 설명이 템플릿의 대부분 섹션을 포함하고 있으며, 관련 이슈, 변경사항 체크, 상세한 작업 내용, 스크린샷과 함께 충분한 컨텍스트를 제공함.
Linked Issues check ✅ Passed 모든 PR 변경사항이 #144 이슈의 체크리스트 항목들(캠페인 상세 정보 UI, 광고 목록 UI, 트래킹 controlBox)을 충족하며, 요구된 리팩토링 목표를 달성함.
Out of Scope Changes check ✅ Passed ModalContent.tsx의 cursor-pointer 클래스 추가 외 모든 변경사항이 #144 이슈의 캠페인 상세 페이지 및 광고 리스트 리팩토링 범위 내에 있음.

✏️ 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 refactor/#144

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

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown

📚 Storybook 배포 완료

항목 링크
📖 Storybook https://69a147b60a56365d9e2185ef-ylqxiiisdb.chromatic.com/
🔍 Chromatic https://www.chromatic.com/build?appId=69a147b60a56365d9e2185ef&number=166

@YermIm YermIm added ✨ Feature 기능 개발 🔨 Refactor 코드 리팩토링 labels Mar 27, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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/components/ads/AdDetailContent.tsx (1)

106-123: ⚠️ Potential issue | 🟡 Minor

landingUrl가 없을 때의 상태 처리가 아직 일관되지 않습니다.

landingUrl가 optional인데 지금 구현은 값이 없어도 랜딩 URL 복사 아이콘이 활성 상태로 보이고, 링크 발급하기도 모달까지 들어간 다음에야 실패를 알게 됩니다. 게다가 confirm 분기에서 toast.errorthrow까지 해서 useControlModal의 generic 실패 토스트가 한 번 더 붙습니다. placeholder/disabled 상태를 upfront로 주고, 검증은 handleConfirm 호출 전에 끝내는 쪽이 UX가 더 안정적입니다. 아이콘-only 버튼에는 aria-label도 같이 넣어 주세요.

🔧 제안 코드
           <div className="flex items-center justify-between w-full h-9 px-4 py-2 bg-white border border-bg-disabled rounded-component-sm group-hover:border-primary-light transition-all">
             <span className="font-body2 text-text-auth-sub truncate pr-10 select-all">
-              {ad.landingUrl}
+              {ad.landingUrl ?? "등록된 랜딩 URL이 없습니다."}
             </span>
             <button
+              type="button"
+              disabled={!ad.landingUrl}
+              aria-label={ad.landingUrl ? "랜딩 URL 복사" : "등록된 랜딩 URL 없음"}
               onClick={(e) => {
                 e.stopPropagation();
-                ad.landingUrl && handleCopy(ad.landingUrl);
+                if (!ad.landingUrl) return;
+                handleCopy(ad.landingUrl);
               }}
               className="shrink-0 text-text-placeholder hover:text-primary-main transition-colors p-1"
               title="링크 복사"
             >
               <LinkIcon className="w-5 h-5" />
             </button>
           </div>
@@
-            buttonDisabled={false}
+            buttonDisabled={!isTrackingActive && !ad.landingUrl}
@@
-          onConfirm={() =>
-            trackControl.handleConfirm(async () => {
-              if (!ad.landingUrl) {
-                toast.error(
-                  "광고에 등록된 랜딩 URL이 없어 발급이 불가능합니다.",
-                );
-                throw new Error("랜딩 URL이 없습니다.");
-              }
-              await createTrackingUrl(Number(orgId), ad.id, ad.landingUrl);
-            })
-          }
+          onConfirm={() => {
+            if (!ad.landingUrl) {
+              toast.error("광고에 등록된 랜딩 URL이 없어 발급이 불가능합니다.");
+              return;
+            }
+
+            trackControl.handleConfirm(async () => {
+              await createTrackingUrl(Number(orgId), ad.id, ad.landingUrl);
+            });
+          }}

As per coding guidelines, src/**: 다음 핵심 영역에 집중하여 리뷰한다. 6. 에러 처리: API 실패 대응 및 사용자 피드백 적절성 검토. 에러 바운더리 사용 확인. 7. 접근성: 시맨틱 HTML, ARIA 속성 사용 확인.

Also applies to: 130-145, 207-216

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

In `@src/components/ads/AdDetailContent.tsx` around lines 106 - 123, The
landingUrl handling is inconsistent: ensure the UI shows a placeholder and
disables the copy/action affordances when ad.landingUrl is falsy, add an
aria-label to the icon-only button (e.g., aria-label="링크 복사"), and make
handleCopy only callable when ad.landingUrl exists (guard in the onClick and
disable the button visually and via disabled attribute); likewise validate
ad.landingUrl before invoking handleConfirm/useControlModal so the modal isn't
opened for missing URLs, move toast.error into that pre-check (do not throw
after showing the toast to avoid duplicate generic failure toasts from
useControlModal), and update references in this component (ad.landingUrl,
handleCopy, handleConfirm, useControlModal, LinkIcon) accordingly so the UX and
accessibility are fixed.
🧹 Nitpick comments (1)
src/pages/ads/list/CampaignDetail.tsx (1)

23-27: 플랫폼 아이콘 매핑은 공용으로 빼두는 편이 좋겠습니다.

여기서 새로 만든 LogoMapsrc/components/ads/AdRow.tsx의 매핑과 사실상 동일하고, 사용 시점에는 provider.toLowerCase() as TPlatform으로 API 값을 UI 타입에 강제 캐스팅하고 있습니다. 플랫폼이 추가되거나 네이밍이 바뀌면 한쪽만 수정돼도 헤더 아이콘이 조용히 빠질 수 있어서, 공용 PlatformIcon 컴포넌트나 상수로 묶어 두는 쪽이 유지보수에 더 안전합니다.

As per coding guidelines, src/**: 다음 핵심 영역에 집중하여 리뷰한다. 2. 구조와 책임 분리: 페이지에 비즈니스 로직이 과도하지 않은지 확인. 커스텀 훅으로의 분리 여부 검토.

Also applies to: 117-125

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

In `@src/pages/ads/list/CampaignDetail.tsx` around lines 23 - 27, The LogoMap
object defined in CampaignDetail (LogoMap) duplicates the same platform-to-icon
mapping in src/components/ads/AdRow.tsx and risks drift when platform names
change; extract this mapping into a shared constant or a new PlatformIcon
component and replace both usages with that shared symbol. Update CampaignDetail
to stop using provider.toLowerCase() as TPlatform casting and instead pass the
raw provider value into the shared PlatformIcon API (or normalize centrally
inside the shared utility), and update AdRow to import and use the same
PlatformIcon/PLATFORM_ICON_MAP so both components reference a single source of
truth (symbols to change: LogoMap, TPlatform usages, provider.toLowerCase() as
TPlatform, and the mapping in AdRow).
🤖 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/pages/ads/list/CampaignDetail.tsx`:
- Around line 85-91: Replace the back navigation that uses navigate(-1) with an
explicit route using the orgId from useParams so the button always returns to
the ads list; in CampaignDetail change the onClick handler on the back button
(the element rendering LeftChevronIcon) to call navigate(`/ads/${orgId}`)
instead of navigate(-1), ensuring orgId is read from useParams and available in
the component before using it.

---

Outside diff comments:
In `@src/components/ads/AdDetailContent.tsx`:
- Around line 106-123: The landingUrl handling is inconsistent: ensure the UI
shows a placeholder and disables the copy/action affordances when ad.landingUrl
is falsy, add an aria-label to the icon-only button (e.g., aria-label="링크 복사"),
and make handleCopy only callable when ad.landingUrl exists (guard in the
onClick and disable the button visually and via disabled attribute); likewise
validate ad.landingUrl before invoking handleConfirm/useControlModal so the
modal isn't opened for missing URLs, move toast.error into that pre-check (do
not throw after showing the toast to avoid duplicate generic failure toasts from
useControlModal), and update references in this component (ad.landingUrl,
handleCopy, handleConfirm, useControlModal, LinkIcon) accordingly so the UX and
accessibility are fixed.

---

Nitpick comments:
In `@src/pages/ads/list/CampaignDetail.tsx`:
- Around line 23-27: The LogoMap object defined in CampaignDetail (LogoMap)
duplicates the same platform-to-icon mapping in src/components/ads/AdRow.tsx and
risks drift when platform names change; extract this mapping into a shared
constant or a new PlatformIcon component and replace both usages with that
shared symbol. Update CampaignDetail to stop using provider.toLowerCase() as
TPlatform casting and instead pass the raw provider value into the shared
PlatformIcon API (or normalize centrally inside the shared utility), and update
AdRow to import and use the same PlatformIcon/PLATFORM_ICON_MAP so both
components reference a single source of truth (symbols to change: LogoMap,
TPlatform usages, provider.toLowerCase() as TPlatform, and the mapping in
AdRow).
🪄 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: 5e0a2e33-af12-49dc-8df6-53794090ad19

📥 Commits

Reviewing files that changed from the base of the PR and between 8d3ff55 and 9562c5b.

⛔ Files ignored due to path filters (1)
  • src/assets/icon/chevron/chervon-left.svg is excluded by !**/*.svg and included by src/**
📒 Files selected for processing (4)
  • src/components/ads/AdDetailContent.tsx
  • src/components/ads/AdRow.tsx
  • src/components/common/modal/ModalContent.tsx
  • src/pages/ads/list/CampaignDetail.tsx

Comment thread src/pages/ads/list/CampaignDetail.tsx

@jjjsun jjjsun left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P4: 확인했습니다! 고생하셨어요!

Comment thread src/pages/ads/list/CampaignDetail.tsx

@Seojegyeong Seojegyeong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P4: 확인했습니다! 수고하셨습니다:)

@YermIm
YermIm merged commit 9d2233b into develop Mar 28, 2026
3 checks passed
@YermIm
YermIm deleted the refactor/#144 branch March 28, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

♻️ [Refactor] 캠페인 상세 페이지 리팩토링

3 participants