Skip to content

Conversation

@uson1004
Copy link
Member

@uson1004 uson1004 commented May 7, 2025

개요

image
image

3반, 4반 모두 이미지가 동일하여 생략합니다

작업 내용

  • gradle "DSL_SCOPE_VIOLATION" 어노테이션을 추가했습니다
  • 요구사항에 맞게 회사이름이 보여지도록 구현하였습니다
  • viewmodel 호출 시점을 고려하여 화면에 값을 출력하였습니다
  • 그래프와 전체 통계가 보여지도록 타입을 변경하였습니다

할 말

없음

Summary by CodeRabbit

  • Refactor
    • 취업 통계 관련 데이터 타입이 일부 Long에서 Float 또는 String으로 변경되어, 소수점 비율 및 문자열 형식의 학생 수/합격자 수가 표시됩니다.
    • 회사 카드 UI가 세로 정렬로 개선되어, 이미지와 회사명이 시각적으로 더 보기 좋게 배치됩니다.
  • Style
    • 회사 카드의 그림자 및 배경 스타일이 조정되어 더욱 세련된 시각 효과를 제공합니다.
  • Chores
    • 빌드 스크립트에서 DSL_SCOPE_VIOLATION 경고를 임시로 억제하는 설정이 추가되었습니다.

@uson1004 uson1004 self-assigned this May 7, 2025
@uson1004 uson1004 requested a review from a team as a code owner May 7, 2025 06:20
@uson1004 uson1004 added the 리팩토링 코드를 리팩토링 합니다. label May 7, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 7, 2025

Walkthrough

이 변경사항은 employment 모듈의 빌드 스크립트에 DSL_SCOPE_VIOLATION 경고 억제 주석을 추가하고, 고용 통계 관련 데이터 타입을 Long에서 Float 또는 String으로 변경하며, UI에서 회사 카드의 레이아웃 및 스타일을 개선합니다. 또한 EmploymentViewModel과 상태 클래스의 필드 타입과 기본값도 이에 맞게 수정되었습니다.

Changes

파일/경로 변경 요약
feature/employment/build.gradle.kts DSL_SCOPE_VIOLATION 경고 억제 주석 및 TODO 추가.
feature/employment/src/main/java/team/retum/employment/ui/EmploymentDetailScreen.kt CompanyCard 컴포저블의 레이아웃 및 스타일을 Box에서 Column 기반으로 리팩토링, 회사명 텍스트 추가 및 중앙 정렬.
feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt 고용 통계 관련 rate를 Long에서 Float로, totalStudentCount 및 passCount를 Long에서 String으로 타입 변경 및 반영.
feature/employment/src/main/java/team/retum/employment/viewmodel/EmploymentViewModel.kt EmploymentState의 필드 타입을 Long에서 Float/String으로 변경, 기본값 및 파싱 로직 수정.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EmploymentScreen
    participant EmploymentViewModel

    User->>EmploymentScreen: 화면 진입
    EmploymentScreen->>EmploymentViewModel: 상태(state) 관찰
    EmploymentViewModel-->>EmploymentScreen: rate(Float), totalStudentCount(String), passCount(String) 전달
    EmploymentScreen->>EmploymentScreen: EmploymentRate, CircleProgress 등에서 새로운 타입 사용
    EmploymentScreen-->>User: UI에 통계 및 회사 카드 표시
Loading

Suggested labels

퍼블리싱

Suggested reviewers

  • parkuiery

Poem

🐇
타입이 바뀌었어요, Long은 안녕!
Float와 String이 통계를 더 잘 표현해요.
회사 카드도 세련되게 변신했죠,
빌드 경고도 잠시 억제했어요.
봄바람 타고,
JOBIS에 새로움이 찾아왔네요!
🌱

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69b3868 and ca93019.

📒 Files selected for processing (2)
  • feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt (4 hunks)
  • feature/employment/src/main/java/team/retum/employment/viewmodel/EmploymentViewModel.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • feature/employment/src/main/java/team/retum/employment/viewmodel/EmploymentViewModel.kt
  • feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: lint_and_build (build)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@uson1004 uson1004 changed the title Feature/463 각 반별 페이지 타이틀 수정 🔗 :: (#460) 각 반별 페이지 타이틀 수정 May 7, 2025
@uson1004 uson1004 changed the title 🔗 :: (#460) 각 반별 페이지 타이틀 수정 🔗 :: (#463) 각 반별 페이지 타이틀 수정 May 7, 2025
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
feature/employment/src/main/java/team/retum/employment/ui/EmploymentDetailScreen.kt (1)

133-158: CompanyCard UI가 개선되었습니다.

CompanyCard 컴포저블이 다음과 같이 개선되었습니다:

  1. Box에서 Column으로 변경되어 수직 배치 구조가 명확해졌습니다
  2. 회사 이미지가 Box로 래핑되어 그림자, 클리핑, 배경 효과가 적용되었습니다
  3. 이미지와 회사명 사이에 적절한 간격이 추가되었습니다
  4. 회사명 텍스트의 스타일과 정렬이 개선되었습니다

이러한 변경은 PR 목표인 "각 반별 페이지 타이틀 수정"에 부합하는 UI 개선입니다.

한 가지 제안: 그림자 값을 18.dp에서 좀 더 낮은 값으로 조정하는 것이 모바일 UI 디자인 가이드라인에 더 적합할 수 있습니다. 일반적으로 Material Design에서는 1dp에서 12dp 사이의 그림자 값을 권장합니다.

-                .shadow(elevation = 18.dp)
+                .shadow(elevation = 8.dp)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97d7f36 and 46ca9f9.

📒 Files selected for processing (3)
  • feature/employment/build.gradle.kts (1 hunks)
  • feature/employment/src/main/java/team/retum/employment/ui/EmploymentDetailScreen.kt (3 hunks)
  • feature/interests/src/main/java/team/retum/jobis/interests/ui/InterestsScreen.kt (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: lint_and_build (build)
  • GitHub Check: lint_and_build (lint)
🔇 Additional comments (3)
feature/interests/src/main/java/team/retum/jobis/interests/ui/InterestsScreen.kt (1)

22-22:

✅ Verification successful

패키지 경로가 변경되었습니다.

import 경로가 team.retum.jobis.interests.R에서 team.retum.interests.R로 변경되었습니다. 이는 프로젝트 구조 조정의 일부로 보이며, 문자열 리소스의 소스 위치가 변경되었습니다. 이 변경이 기존 기능에 영향을 주지 않는지 확인하세요.

다음 스크립트를 실행하여 R 리소스 참조가 올바르게 작동하는지 확인하세요:


🏁 Script executed:

#!/bin/bash
# Check if the new package exists and contains the required string resources
fd -t d "interests" --exec echo "Directory found: {}"
fd -t f "strings.xml" -p "interests" --exec grep -l "set_interests\|hint_keyword" {}

Length of output: 350


다음 스크립트를 실행하여 strings.xml의 위치 및 리소스 키(set_interests, hint_keyword) 존재 여부, 그리고 AndroidManifest의 패키지 선언을 확인해주세요.


🏁 Script executed:

#!/bin/bash
# 1) feature/interests 모듈에서 strings.xml 파일 찾기
echo "=== strings.xml 파일 위치 ==="
fd -t f strings.xml feature/interests

# 2) 해당 strings.xml에서 키 검색
echo "=== set_interests, hint_keyword 키 검색 결과 ==="
grep -R --color=auto "set_interests\|hint_keyword" -n feature/interests/src/main/res

# 3) AndroidManifest.xml의 패키지 선언 확인
echo "=== AndroidManifest.xml 패키지 선언 ==="
grep -R '<manifest.*package' -n feature/interests/src/main/AndroidManifest.xml

Length of output: 780


R 리소스 import 경로 변경 검증 완료

  • feature/interests/src/main/res/values/strings.xml에서 set_interestshint_keyword 키가 정상적으로 존재함을 확인했습니다.
  • import team.retum.interests.R로 변경된 경로가 올바르게 적용되어 리소스 참조에 문제가 없습니다.

추가 검증이나 수정이 필요하지 않습니다.

feature/employment/build.gradle.kts (1)

1-1: 경고 억제 어노테이션이 추가되었습니다.

DSL_SCOPE_VIOLATION 경고를 억제하는 어노테이션이 추가되었습니다. 이는 KTIJ-19369 이슈가 해결될 때까지 임시적인 조치입니다. 해당 이슈가 해결되면 TODO 코멘트에 따라 제거해야 합니다.

feature/employment/src/main/java/team/retum/employment/ui/EmploymentDetailScreen.kt (1)

9-9: UI 개선을 위한 임포트가 추가되었습니다.

CompanyCard 컴포저블의 UI 개선을 위해 필요한 Spacer와 TextAlign 임포트가 추가되었습니다. 이는 레이아웃 및 텍스트 정렬을 위한 적절한 변경사항입니다.

Also applies to: 27-27

Comment on lines +143 to +149
AsyncImage(
modifier = Modifier
.align(Alignment.Center),
model = imageUrl,
contentDescription = companyName,
contentScale = ContentScale.Crop,
)
Copy link
Member

Choose a reason for hiding this comment

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

Box로 감싸지 말고 여기에 Modifier로 적용하면 안되나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

시도해보겠습니다

Copy link
Member Author

Choose a reason for hiding this comment

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

빈 이미지일 경우 화면을 Box가 대체하고 있어 안되는 거 같습니다

@@ -1,3 +1,4 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
Copy link
Member

Choose a reason for hiding this comment

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

이거는 왜 추가된건가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

다른 모듈에도 추가되어있어 확인해보니 libs를 접근할 때 IDE가 안전하지 않다고 판단되어 사용하는 것을 알고 넣게 되었습니다

Copy link
Member Author

Choose a reason for hiding this comment

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

image

@uson1004 uson1004 requested a review from parkuiery May 8, 2025 10:26
@github-project-automation github-project-automation bot moved this from Todo to In review in return 3기 backlog May 9, 2025
Copy link
Contributor

@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: 0

🔭 Outside diff range comments (1)
feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt (1)

342-342: 💡 Verification agent

🧩 Analysis chain

오류: ClassEmploymentButton의 onClick 함수가 항상 4를 전달합니다.

이 함수는 매개변수로 전달된 onClassClick 핸들러를 사용하지만, 항상 4를 인자로 전달하고 있어 UI에서 어떤 클래스를 선택하든 항상 4반으로 이동하게 됩니다. PR 목적 중 하나가 "각 반별 페이지 타이틀 수정"이므로 이 문제를 해결하는 것이 중요합니다.

-        onClick = { onClassClick(4) },
+        onClick = { onClassClick(0) },

그리고 올바른 수정 방법은 항상 4를 전달하는 게 아니라 함수 파라미터로 전달받은 값을 사용하는 것입니다:


🏁 Script executed:

#!/bin/bash
# 각 버튼 클릭 시 onClassClick 함수가 어떤 값을 전달해야 하는지 확인
rg -A 3 "ClassEmploymentButton" feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt

Length of output: 934


🏁 Script executed:

#!/bin/bash
sed -n '330,380p' feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt

Length of output: 1921


ClassEmploymentButton의 onClick이 항상 4를 전달하고 있습니다

현재 ClassEmploymentButton 내부에서는 다음과 같이 고정된 값 4를 넘기고 있어, 호출부에서 어떤 클래스를 전달하더라도 항상 4반으로 동작합니다.

Surface(
    modifier = modifier,
    onClick = { onClassClick(4) },  // ❌ 고정된 값
    …
)

해결 방안

  • Composable 파라미터로 받은 클릭 핸들러를 그대로 사용하거나
  • 필요한 경우 “클래스 번호”를 별도 파라미터로 받아 전달하도록 시그니처를 변경

예시) 핸들러 타입을 () -> Unit으로 변경하고 호출부에서 원하는 값을 캡처하도록 수정

@Composable
private fun ClassEmploymentButton(
    modifier: Modifier = Modifier,
    onClick: () -> Unit,            // (Int) -> Unit → () -> Unit
    image: Int,
    description: String = "",
    text: String,
) {
    Surface(
        modifier = modifier,
        onClick = onClick,           // 전달받은 핸들러 그대로 사용
        color = JobisTheme.colors.inverseSurface,
        shape = RoundedCornerShape(8.dp),
    ) {
        …
    }
}

호출부:

ClassEmploymentButton(
    modifier = Modifier.weight(1f),
    onClick = { onClassClick(2) },  // 각 버튼마다 다른 클래스 번호를 캡처
    image = R.drawable.xxx,
    text = "2반",
)

– 파일: feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt
– 라인: ~338–344 (ClassEmploymentButton 정의부)
위와 같이 수정하여, 버튼 클릭 시 의도한 클래스 번호가 정확히 전달되도록 변경해주세요.

🧹 Nitpick comments (3)
feature/employment/src/main/java/team/retum/employment/viewmodel/EmploymentViewModel.kt (1)

3-3: 사용되지 않는 import 제거 필요

android.util.Log import가 추가되었지만, 해당 파일 내에서 사용되지 않고 있습니다. 불필요한 import는 제거하는 것이 좋습니다.

-import android.util.Log
feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt (2)

3-3: 사용되지 않는 import 제거 필요

android.util.Log import가 추가되었지만, 해당 파일 내에서 사용되지 않고 있습니다. 불필요한 import는 제거하는 것이 좋습니다.

-import android.util.Log

59-59: 타입 변환 로직 최적화

state.rate가 이미 Float 타입이므로 .toFloat()는 불필요합니다.

-    val animatedValue = remember { Animatable(state.rate.toFloat()) }
+    val animatedValue = remember { Animatable(state.rate) }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46ca9f9 and 69b3868.

📒 Files selected for processing (3)
  • feature/employment/src/main/java/team/retum/employment/ui/EmploymentDetailScreen.kt (2 hunks)
  • feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt (5 hunks)
  • feature/employment/src/main/java/team/retum/employment/viewmodel/EmploymentViewModel.kt (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • feature/employment/src/main/java/team/retum/employment/ui/EmploymentDetailScreen.kt
🔇 Additional comments (7)
feature/employment/src/main/java/team/retum/employment/viewmodel/EmploymentViewModel.kt (3)

28-31: 데이터 타입 변경 및 포맷팅 로직 적용이 적절합니다.

Long에서 Float와 String으로 데이터 타입을 변경한 것은 UI 표시에 적합합니다. 특히 소수점 이하 자리를 가질 수 있는 비율(rate)을 Float로 처리하고, DecimalFormat을 사용하여 포맷팅하는 방식이 좋습니다.


42-44: 데이터 타입 변경이 적절합니다.

EmploymentState 클래스의 필드 타입 변경이 UI 요구사항과 잘 맞습니다:

  • rate: Long → Float (소수점 표시 가능)
  • totalStudentCount, passCount: Long → String (텍스트 표시에 적합)

48-50: 기본값 변경이 타입 변경과 일관성 있게 적용되었습니다.

데이터 타입 변경에 맞춰 기본값도 적절하게 변경되었습니다:

  • rate: 0F (Float 타입)
  • totalStudentCount, passCount: "" (빈 문자열)
feature/employment/src/main/java/team/retum/employment/ui/EmploymentScreen.kt (4)

65-65: 자료형 변경에 따른 애니메이션 타겟값 설정이 적절합니다.

이전에는 Long에서 Float으로 변환했지만, 이제 state.rate가 Float 타입이므로 직접 사용하는 것이 맞습니다.


83-85: 매개변수 타입 변경이 적절합니다.

ViewModel의 상태 타입 변경에 맞추어 UI 컴포넌트의 매개변수 타입도 일관성 있게 변경되었습니다:

  • rate: Long → Float
  • totalStudentCount, passCount: Long → String

176-178: EmploymentRate 컴포넌트의 매개변수 타입 변경이 적절합니다.

상위 컴포넌트와 일관성 있게 타입이 변경되었습니다.


283-283: 애니메이션 초기값 설정이 적절합니다.

CircleProgress 컴포넌트에서도 percentage 매개변수가 Float으로 변경되어 일관성 있게 적용되었습니다.

@uson1004 uson1004 merged commit 4dd3854 into develop May 9, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in return 3기 backlog May 9, 2025
@uson1004 uson1004 deleted the feature/463-각-반별-페이지-타이틀-수정 branch June 1, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

리팩토링 코드를 리팩토링 합니다.

Projects

Development

Successfully merging this pull request may close these issues.

3 participants