Skip to content

Refactor(apps): 현장 상황 뷰 혼잡도 이미지 교체#342

Merged
jisooooooooooo merged 12 commits intodevelopfrom
refactor/replace-image/#309
Mar 20, 2026
Merged

Refactor(apps): 현장 상황 뷰 혼잡도 이미지 교체#342
jisooooooooooo merged 12 commits intodevelopfrom
refactor/replace-image/#309

Conversation

@jisooooooooooo
Copy link
Copy Markdown
Contributor

📌 Summary

#309

📚 Tasks

  • 혼잡도 이미지 교체 및 칩 컴포넌트 분리

🔍 Describe

혼잡도 칩 분리

  • 기존에 이미지로 한 번에 처리하고 있던 혼잡도 이미지와 칩 컴포넌트를 분리했어요.
  • 추가적으로 필요한 컬러 토큰도 추가해 적용했어요.

혼잡도 이미지 변경

  • 현장 상황 뷰와 현장 상황 입력 바텀시트에 들어가는 이미지를 변경했어요.

👀 To Reviewer

  • 잘못 들어간 부분 있는지 확인 부탁드려요 !!

📸 Screenshot

스크린샷 2026-03-19 오후 5 34 25

@jisooooooooooo jisooooooooooo requested a review from a team as a code owner March 19, 2026 08:37
@jisooooooooooo jisooooooooooo linked an issue Mar 19, 2026 that may be closed by this pull request
2 tasks
@github-actions github-actions bot added ♻️ Refactor 코드 리팩토링 🐵 지수 labels Mar 19, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f3a69399-cd60-4427-ae77-872821845b86

📥 Commits

Reviewing files that changed from the base of the PR and between bd365cb and aabd1d0.

📒 Files selected for processing (1)
  • packages/ads-ui/src/components/button/live-button/live-button.tsx

📝 Walkthrough

Summary by CodeRabbit

  • 새로운 기능
    • LiveButton에 썸네일 위에 혼잡도 칩을 선택적으로 표시하도록 업데이트 — 혼잡도에 따라 라벨과 상태가 보입니다.
    • 혼잡도 상태(원활, 보통, 혼잡, 없음)에 따른 칩 텍스트·색상 적용으로 시각적 구분 향상.
    • 혼잡도 전용 색상 토큰과 칩 스타일 추가로 디자인 일관성 확보.

Walkthrough

LiveButton에 혼잡도(congestion) 표시가 추가되었습니다. Chip 컴포넌트에 congestion 변형과 상태별 스타일이 추가되었고, 관련 색상 토큰 6개가 신규 등록되었습니다. 컴포지션에서 item.congestionLevel을 prop으로 전달하도록 연결했습니다.

Changes

Cohort / File(s) Summary
LiveButton 관련
packages/ads-ui/src/components/button/live-button/live-button.tsx, packages/ads-ui/src/components/button/live-button/live-button.css.ts
LiveButton에 선택적 congestionLevel?: string prop 추가, 내부 파싱 로직(타입 매핑) 도입 및 썸네일을 imageContainer로 래핑하여 인식 가능한 혼잡도일 때만 Chip(variant='congestion', status, 레이블) 조건부 렌더링. 스타일에 imageContainer, statusChip 추가.
Chip 컴포넌트 변경
packages/ads-ui/src/components/chip/chip.tsx, packages/ads-ui/src/components/chip/chip.css.ts
variant: 'congestion'ChipCongestionProps 타입 추가 및 ChipProps 확장. CSS 레시피에 congestion variant와 상태별(smooth,normal,crowded,none) 스타일(배경/텍스트 컬러, 크기, borderRadius 등) 추가.
스타일 토큰
packages/ads-ui/src/styles/tokens/color.ts
혼잡도 칩용 색상 토큰 6개(congestion_red_dark, congestion_red_light, congestion_green_dark, congestion_green_light, congestion_blue_dark, congestion_blue_light) 추가.
컴포지션 연결부
packages/compositions/src/live-button-container/live-button-container.tsx
item.congestionLevelLiveButtoncongestionLevel prop으로 전달하도록 변경하고 관련 TODO 주석 제거.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested labels

🎨 Design

Suggested reviewers

  • jin-evergreen
  • eunkr82
  • Sohyunnnn
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 [type] 형식을 따르고 34자 이내로 50자 제한을 충분히 만족하며, 혼잡도 이미지 교체라는 변경사항을 명확히 요약하고 있어요.
Description check ✅ Passed PR 설명이 혼잡도 칩 분리와 이미지 교체라는 변경사항을 구체적으로 설명하고 있어 전체 변경사항과 관련성이 높아요.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

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

Caution

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

⚠️ Outside diff range comments (1)
packages/compositions/src/live-button-container/live-button-container.tsx (1)

12-12: 🧹 Nitpick | 🔵 Trivial

Suggest: congestionLevel 타입을 더 엄격하게 정의하면 좋겠어요.

현재 congestionLevel: string으로 정의되어 있지만, 실제로 허용되는 값은 'SMOOTH' | 'NORMAL' | 'CROWDED' | 'NONE'이에요. StatusSheetValue 타입을 재사용하면 타입 안전성이 높아지고, Line 36의 as StatusSheetValue 캐스팅도 불필요해져요.

♻️ 타입 개선 제안
 interface LiveButtonContainerProps {
   items: {
     stageId: number;
     title: string;
     location?: string | null;
-    congestionLevel: string;
+    congestionLevel: StatusSheetValue;
   }[];
   showIcon?: boolean;
   isDisabled?: boolean;
   onClick?: (id: number) => void;
 }

Line 36도 캐스팅 없이 사용할 수 있어요:

-        const statusImageUrl =
-          STATUS_IMAGES[item.congestionLevel as StatusSheetValue];
+        const statusImageUrl = STATUS_IMAGES[item.congestionLevel];
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/compositions/src/live-button-container/live-button-container.tsx` at
line 12, Change the congestionLevel prop from a plain string to the stricter
union type by using the existing StatusSheetValue type (replace
"congestionLevel: string" with "congestionLevel: StatusSheetValue"), then remove
the unnecessary "as StatusSheetValue" cast where congestionLevel is used (the
cast near the LiveButtonContainer usage). This reuses StatusSheetValue for type
safety and eliminates the manual casting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ads-ui/src/components/button/live-button/live-button.tsx`:
- Around line 8-9: Extract the shared union type into a common exported type and
reuse it instead of duplicating: create a new exported type (e.g., export type
CongestionLevel = 'SMOOTH' | 'NORMAL' | 'CROWDED' | 'NONE' or export type
StatusSheetValue = ...) in a shared types/constants module, update
live-button.tsx to import and use that exported type for CongestionLevel and
derive CongestionChipStatus from it (or export both from the shared module), and
update the StatusSheetValue consumer to import the same shared type so all
components (including functions/components referencing CongestionLevel,
CongestionChipStatus, and StatusSheetValue) use the single source of truth.
- Around line 11-19: Replace the LiveButtonProps type alias with an interface:
convert "type LiveButtonProps = { ... }" to "interface LiveButtonProps { ... }"
preserving all property names, optional markers (subText?, showIcon?,
congestionLevel?), types (string, boolean, () => void) and the onClick
signature; update any local references if necessary (the identifier
LiveButtonProps remains the same so no runtime changes) to comply with the
coding guideline preferring interface for object shapes used by the LiveButton
component.

---

Outside diff comments:
In `@packages/compositions/src/live-button-container/live-button-container.tsx`:
- Line 12: Change the congestionLevel prop from a plain string to the stricter
union type by using the existing StatusSheetValue type (replace
"congestionLevel: string" with "congestionLevel: StatusSheetValue"), then remove
the unnecessary "as StatusSheetValue" cast where congestionLevel is used (the
cast near the LiveButtonContainer usage). This reuses StatusSheetValue for type
safety and eliminates the manual casting.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: e605ca67-eaf3-4cca-af59-333bbf44170e

📥 Commits

Reviewing files that changed from the base of the PR and between 9ebec41 and e5c0204.

⛔ Files ignored due to path filters (7)
  • packages/ads-ui/src/assets/congestion-crowded-btn.webp is excluded by !**/*.webp and included by packages/**/src/**
  • packages/ads-ui/src/assets/congestion-normal-btn.webp is excluded by !**/*.webp and included by packages/**/src/**
  • packages/ads-ui/src/assets/congestion-smooth-btn.webp is excluded by !**/*.webp and included by packages/**/src/**
  • packages/compositions/src/assets/crowded.webp is excluded by !**/*.webp and included by packages/**/src/**
  • packages/compositions/src/assets/none.webp is excluded by !**/*.webp and included by packages/**/src/**
  • packages/compositions/src/assets/normal.webp is excluded by !**/*.webp and included by packages/**/src/**
  • packages/compositions/src/assets/smooth.webp is excluded by !**/*.webp and included by packages/**/src/**
📒 Files selected for processing (6)
  • packages/ads-ui/src/components/button/live-button/live-button.css.ts
  • packages/ads-ui/src/components/button/live-button/live-button.tsx
  • packages/ads-ui/src/components/chip/chip.css.ts
  • packages/ads-ui/src/components/chip/chip.tsx
  • packages/ads-ui/src/styles/tokens/color.ts
  • packages/compositions/src/live-button-container/live-button-container.tsx

Comment on lines +8 to +9
type CongestionLevel = 'SMOOTH' | 'NORMAL' | 'CROWDED' | 'NONE';
type CongestionChipStatus = 'smooth' | 'normal' | 'crowded' | 'none';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Suggest: CongestionLevel 타입을 공용으로 추출하면 좋겠어요.

CongestionLevelCongestionChipStatus 타입이 live-button.tsx 내부에만 정의되어 있는데, StatusSheetValue(packages/ads-ui/src/components/bottom-sheet/status-sheet/status-sheet.constants.ts)와 동일한 값을 가지고 있어요. 타입 일관성을 위해 공용 타입을 재사용하거나, 이 타입들을 별도 파일로 추출하는 것을 고려해 주세요.

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

In `@packages/ads-ui/src/components/button/live-button/live-button.tsx` around
lines 8 - 9, Extract the shared union type into a common exported type and reuse
it instead of duplicating: create a new exported type (e.g., export type
CongestionLevel = 'SMOOTH' | 'NORMAL' | 'CROWDED' | 'NONE' or export type
StatusSheetValue = ...) in a shared types/constants module, update
live-button.tsx to import and use that exported type for CongestionLevel and
derive CongestionChipStatus from it (or export both from the shared module), and
update the StatusSheetValue consumer to import the same shared type so all
components (including functions/components referencing CongestionLevel,
CongestionChipStatus, and StatusSheetValue) use the single source of truth.

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ads-ui/src/components/button/live-button/live-button.tsx`:
- Around line 35-46: The function toCongestionLevel currently returns
CongestionLevel | null but should be a TypeScript type guard for clearer
inference — change its signature to a type guard (e.g., function
toCongestionLevel(value?: string): value is CongestionLevel) and keep the same
string checks ('SMOOTH' | 'NORMAL' | 'CROWDED' | 'NONE') returning true for
matches and false otherwise; update all call sites that rely on its return to
use the guard (no null checks needed). If you prefer to keep the current
runtime-returning behaviour instead of a guard, simply rename the function to
parseCongestionLevel to match verb+noun naming (toCongestionLevel ->
parseCongestionLevel) and leave logic as-is.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: c822a7bf-8f0e-404b-8250-2e13f059c85f

📥 Commits

Reviewing files that changed from the base of the PR and between e5c0204 and bd365cb.

📒 Files selected for processing (1)
  • packages/ads-ui/src/components/button/live-button/live-button.tsx

Copy link
Copy Markdown
Contributor

@Sohyunnnn Sohyunnnn left a comment

Choose a reason for hiding this comment

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

수고하셨습니다 !! 👍

Copy link
Copy Markdown
Member

@jin-evergreen jin-evergreen left a comment

Choose a reason for hiding this comment

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

다 잘 보이는 것 같아요! 고생 많으셨습니다~!!👍👍

@jisooooooooooo jisooooooooooo merged commit e388bd4 into develop Mar 20, 2026
2 checks passed
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.

[Refactor] 현장상황 이미지 교체

3 participants