Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class ReportHistoryEmptyView: UIView {

labelStackView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.height.equalTo(Layout.stackViewHeight)
make.height.equalTo(Layout.stackViewHeight).priority(.medium)
make.width.equalTo(Layout.stackViewWidth)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ final class ReportHistoryTableViewCell: UITableViewCell {
photoImageView.layer.cornerRadius = 9.25
photoImageView.layer.masksToBounds = true

titleLabel.numberOfLines = 2
titleLabel.textColor = BitnagilColor.gray10
titleLabel.font = BitnagilFont.init(style: .body2, weight: .semiBold).font
titleLabel.textAlignment = .left
Expand Down Expand Up @@ -93,9 +94,14 @@ final class ReportHistoryTableViewCell: UITableViewCell {
}

photoImageView.snp.makeConstraints { make in
make.verticalEdges
make.top
.equalToSuperview()
.inset(Layout.verticalSpacing)

make.bottom
.equalToSuperview()
.inset(Layout.verticalSpacing)
.priority(.low)

make.trailing
.equalToSuperview()
Expand Down Expand Up @@ -130,6 +136,7 @@ final class ReportHistoryTableViewCell: UITableViewCell {
make.bottom
.equalToSuperview()
.offset(-Layout.verticalSpacing)
.priority(.medium)

make.width
.equalTo(Layout.categoryLabelWidth)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class ReportDetailViewController: BaseViewController<ReportDetailViewModel> {
titleLabel.text = reportDetailContentType.title
titleLabel.font = BitnagilFont(style: .body2, weight: .semiBold).font
titleLabel.textColor = BitnagilColor.gray10
titleLabel.numberOfLines = 2
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

numberOfLines = 2가 잘못된 레이블에 설정되어 있습니다.

titleLabel은 섹션 헤더("제목", "카테고리" 등)를 표시하는 로컬 변수입니다. 제보 제목 내용을 표시하는 titleContentLabelnumberOfLines = 2를 설정해야 합니다.

현재 titleContentLabel은 기본값 numberOfLines = 1이므로, 긴 제목이 잘릴 수 있습니다.

🐛 수정 제안

Line 155에서 titleLabel.numberOfLines = 2를 제거하고, .title 케이스의 descriptionLabel에 설정:

-        titleLabel.numberOfLines = 2
 
         var descriptionLabel: UILabel
         switch reportDetailContentType {
         case .title:
             descriptionLabel = titleContentLabel
+            descriptionLabel.numberOfLines = 2
         case .category:
🤖 Prompt for AI Agents
In `@Projects/Presentation/Sources/Report/View/ReportDetailViewController.swift`
at line 155, Remove the incorrect numberOfLines assignment on titleLabel and
instead set the content label to allow wrapping: delete the line setting
titleLabel.numberOfLines = 2, and in the .title section use the content label
(titleContentLabel or the local descriptionLabel used for the .title case) to
set numberOfLines = 2 so long titles wrap across two lines.


backgroudView.layer.masksToBounds = true
backgroudView.layer.cornerRadius = 12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
static let registerButtonHeight: CGFloat = 54
static let categoryBottomSheetHeight: CGFloat = 362
static let cameraBottomSheetHeight: CGFloat = 174
static let contentCountLabelTopSpacing: CGFloat = 6
static let contentCountLabelHeight: CGFloat = 18
static let countLabelTopSpacing: CGFloat = 6
static let countLabelHeight: CGFloat = 18
}

private typealias Section = ReportRegistrationViewController.CollectionViewSection
Expand All @@ -62,12 +62,16 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
private let cameraButton = ReportCameraButton(frame: .zero)
private let photoCollectionView = UICollectionView(frame: .zero, collectionViewLayout: .init())
private let categoryTextView = ReportTextView(type: .combo, placeholder: "카테고리 선택")
private let reportTitleTextView = ReportTextView(type: .editable, placeholder: "제보 제목을 작성해주세요.")
private let reportTitleTextView = ReportTextView(
type: .editable,
placeholder: "제보 제목을 작성해주세요."
,maxLength: 50)
private let reportContentTextView = ReportTextView(
type: .editable,
placeholder: "어떤 위험인지 간단히 설명해주세요.",
maxLength: 150)
private let locationTextView = ReportTextView(type: .nonEditable, placeholder: "현재 위치 검색")
private let titleCountLabel = UILabel()
private let contentTextCountLabel = UILabel()
private let locationButton = LocationButton()
private let registerButton = PrimaryButton(buttonState: .disabled, buttonTitle: "제출하기")
Expand Down Expand Up @@ -127,6 +131,9 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
},
for: .touchUpInside)

titleCountLabel.font = BitnagilFont.init(style: .caption1, weight: .medium).font
titleCountLabel.textColor = BitnagilColor.gray80

contentTextCountLabel.font = BitnagilFont.init(style: .caption1, weight: .medium).font
contentTextCountLabel.textColor = BitnagilColor.gray80

Expand All @@ -148,6 +155,7 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
scrollContentView.addSubview(collectionViewTitleLabel)
scrollContentView.addSubview(categoryTitleLabel)
scrollContentView.addSubview(nameTitleLabel)
scrollContentView.addSubview(titleCountLabel)
scrollContentView.addSubview(contentTitleLabel)
scrollContentView.addSubview(locationTitleLabel)
scrollContentView.addSubview(cameraButton)
Expand Down Expand Up @@ -238,9 +246,20 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
.equalTo(Layout.textViewHeight)
}

categoryTitleLabel.snp.makeConstraints { make in
titleCountLabel.snp.makeConstraints { make in
make.top
.equalTo(reportTitleTextView.snp.bottom)
.offset(Layout.countLabelTopSpacing)

make.height
.equalTo(Layout.countLabelHeight)

make.trailing.equalTo(reportTitleTextView)
}

categoryTitleLabel.snp.makeConstraints { make in
make.top
.equalTo(titleCountLabel.snp.bottom)
.offset(Layout.titleLabelTopSpacing)

make.leading
Expand Down Expand Up @@ -294,13 +313,13 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
contentTextCountLabel.snp.makeConstraints { make in
make.top
.equalTo(reportContentTextView.snp.bottom)
.offset(Layout.contentCountLabelTopSpacing)
.offset(Layout.countLabelTopSpacing)

make.trailing
.equalToSuperview()
.offset(-Layout.horizontalInset)

make.height.equalTo(Layout.contentCountLabelHeight)
make.height.equalTo(Layout.countLabelHeight)
}

locationTitleLabel.snp.makeConstraints { make in
Expand Down Expand Up @@ -374,17 +393,22 @@ final class ReportRegistrationViewController: BaseViewController<ReportRegistrat
viewModel.output.titlePublisher
.receive(on: DispatchQueue.main)
.sink { [weak self] title in
self?.reportTitleTextView.configure(text: title ?? "")
guard let self else { return }

self.reportTitleTextView.configure(text: title ?? "")
let title = title ?? ""
self.titleCountLabel.text = "\(title.count) / \(viewModel.output.maxTitleLength)"
}
.store(in: &cancellables)

viewModel.output.contentPublisher
.receive(on: DispatchQueue.main)
.sink { [weak self] content in
self?.reportContentTextView.configure(text: content ?? "")
guard let self else { return }
self.reportContentTextView.configure(text: content ?? "")

let content = content ?? ""
self?.contentTextCountLabel.text = "\(content.count) / 150"
self.contentTextCountLabel.text = "\(content.count) / \(viewModel.output.maxContentLength)"
}
.store(in: &cancellables)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ final class ReportRegistrationViewModel: ViewModel {
let exceptionPublisher: AnyPublisher<String, Never>
let reportRegistrationCompletePublisher: AnyPublisher<Int?, Never>
let maxPhotoCount: Int
let maxContentLength: Int
let maxTitleLength: Int
}

private(set) var output: Output
Expand All @@ -46,6 +48,8 @@ final class ReportRegistrationViewModel: ViewModel {
private let reportRegistrationCompleteSubject = PassthroughSubject<Int?, Never>()
private let exceptionSubject = PassthroughSubject<String, Never>()
private let maxPhotoCount = 3
private let maxContentLength = 150
private let maxTitleLength = 50
private var location: LocationEntity? = nil
private(set) var selectedReportType: ReportType?
var selectedPhotoCount: Int {
Expand All @@ -65,7 +69,9 @@ final class ReportRegistrationViewModel: ViewModel {
isReportValid: reportVerificationSubject.eraseToAnyPublisher(),
exceptionPublisher: exceptionSubject.eraseToAnyPublisher(),
reportRegistrationCompletePublisher: reportRegistrationCompleteSubject.eraseToAnyPublisher(),
maxPhotoCount: maxPhotoCount)
maxPhotoCount: maxPhotoCount,
maxContentLength: maxContentLength,
maxTitleLength: maxTitleLength)
}

func action(input: Input) {
Expand Down