From 50eabd6f8bd5a9d83273e84506d60d2e3fe6a58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=8B=9C=EC=9A=B0?= <266720604+dltldn1234@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:20:35 +0900 Subject: [PATCH] fix: [#390] shorten home weather status --- Tests/UI/HomeWeatherLayoutTests.swift | 6 ++++-- .../Core/Dashboard/HGDashboardService.swift | 4 ++-- .../Presentation/Features/Home/HomeView.swift | 14 ++++++++------ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Tests/UI/HomeWeatherLayoutTests.swift b/Tests/UI/HomeWeatherLayoutTests.swift index c6ed4bd..228ad3f 100644 --- a/Tests/UI/HomeWeatherLayoutTests.swift +++ b/Tests/UI/HomeWeatherLayoutTests.swift @@ -13,10 +13,12 @@ final class HomeWeatherLayoutTests: XCTestCase { } func testWeatherAvailabilityDistinguishesServerStatesAndUsesSunnyFallback() { - XCTAssertEqual(weather(delta: nil, availability: "UNAVAILABLE", skyStatus: nil).weatherStatusText, "기상 정보 없음") + XCTAssertEqual(weather(delta: nil, availability: "UNAVAILABLE", skyStatus: nil).weatherStatusText, "정보 없음") XCTAssertEqual(weather(delta: nil, availability: "CACHED", skyStatus: nil).weatherStatusText, "이전 정보") - XCTAssertEqual(weather(delta: nil, availability: "AVAILABLE", skyStatus: nil).weatherStatusText, "날씨 확인 중") + XCTAssertEqual(weather(delta: nil, availability: "AVAILABLE", skyStatus: nil).weatherStatusText, "확인 중") XCTAssertEqual(weather(delta: nil, availability: nil, skyStatus: nil).weatherStatusText, "정보 없음") + XCTAssertEqual(weather(delta: nil, skyStatus: "CLEAR").weatherStatusText, "맑음") + XCTAssertEqual(weather(delta: nil, skyStatus: "CLOUDY").weatherStatusText, "흐림") XCTAssertEqual(weather(delta: nil, availability: nil, skyStatus: nil).skyIllustrationAssetName, "WeatherSunny") } diff --git a/heatguard-iOS/Core/Dashboard/HGDashboardService.swift b/heatguard-iOS/Core/Dashboard/HGDashboardService.swift index 26435ef..8ecef67 100644 --- a/heatguard-iOS/Core/Dashboard/HGDashboardService.swift +++ b/heatguard-iOS/Core/Dashboard/HGDashboardService.swift @@ -202,9 +202,9 @@ struct HomeWeather: Equatable { case "SNOW": "눈" default: switch availability { - case "UNAVAILABLE": "기상 정보 없음" + case "UNAVAILABLE": "정보 없음" case "CACHED": "이전 정보" - case "AVAILABLE": "날씨 확인 중" + case "AVAILABLE": "확인 중" default: "정보 없음" } } diff --git a/heatguard-iOS/Presentation/Features/Home/HomeView.swift b/heatguard-iOS/Presentation/Features/Home/HomeView.swift index 141b244..6b717f7 100644 --- a/heatguard-iOS/Presentation/Features/Home/HomeView.swift +++ b/heatguard-iOS/Presentation/Features/Home/HomeView.swift @@ -330,7 +330,7 @@ struct HomeView: View { HomeMetric( symbol: dashboard.weather.skySymbol, symbolColor: weatherSymbolColor(for: dashboard.weather.skyStatus), - title: "날씨", + title: nil, value: dashboard.weather.weatherStatusText ) } @@ -876,14 +876,14 @@ private struct HomeMetric: View { var icon: String? var symbol: String? var symbolColor: Color? - let title: String + let title: String? let value: String init( icon: String? = nil, symbol: String? = nil, symbolColor: Color? = nil, - title: String, + title: String?, value: String ) { self.icon = icon @@ -912,9 +912,11 @@ private struct HomeMetric: View { .background(HGColor.homeMetricIconBackground, in: Circle()) VStack(alignment: .leading, spacing: 2) { - Text(title) - .font(HGFont.regular(10, relativeTo: .caption2)) - .foregroundStyle(HGColor.secondaryText) + if let title { + Text(title) + .font(HGFont.regular(10, relativeTo: .caption2)) + .foregroundStyle(HGColor.secondaryText) + } Text(value) .font(HGFont.bold(14, relativeTo: .caption))