mycode/myApp/HaruDanim/IOS/Views/WhatsNewView.swift
songyc macbook 9929e6631e feat(1.5-p4): 신기능 소개 팝업 + 도움말 전면 자연화·신규 주제 3개 + l10n 전량 완역
- WhatsNewView(버전당 1회·신규 설치 시드·온보딩 우선·全기기 업데이트 안내·-showWhatsNew)
- HelpView: 전 주제 ko 자연화(오타 '남긴 하지만'·번역투·'완료 보관함'→'완료된 목표' 정정,
  1.1 맥 일기 반영), 신규 주제 3개(행동 컴플리케이션·건강 보기·건강 다짐), 건강 그룹은
  지원 기기에서만 노출
- l10n: 4개 카탈로그 sync·en/ja 신규 208건+본문 재번역·용어 통일(Action/アクション·
  Quest/クエスト·Home/ホーム)·stale 43 청소 → 전 카탈로그 missing/stale 0,
  InfoPlist에 NSHealthShareUsageDescription 3언어
- 검증: Debug/Store/워치 빌드, 자가 검증 61·20·27·10 ALL PASS, ja 도움말 실렌더 확인

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtZwRRjbtM9pZJDM4FkTq6
2026-08-22 06:28:11 +09:00

132 lines
6.0 KiB
Swift

//
// WhatsNewView.swift
// Haru_Danim
//
// (1.5 Docs/plan-1.5.md §11)
// - 1.
// ( ). .
// - " " ( plan §10 R16)
// - contentVersion
//
import SwiftData
import SwiftUI
struct WhatsNewView: View {
@Environment(\.dismiss) private var dismiss
/// (standard defaults )
static let lastShownKey = "whatsnew.lastShownVersion"
///
static let contentVersion = "1.5"
static var appVersion: String {
Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? ""
}
/// ( )
@MainActor
static func markSeededIfFreshInstall(context: ModelContext) {
guard UserDefaults.standard.string(forKey: lastShownKey) == nil else { return }
let isFresh = !UserDefaults.standard.bool(forKey: OnboardingView.doneKey)
&& ((try? context.fetchCount(FetchDescriptor<Action>())) ?? 0) == 0
if isFresh {
UserDefaults.standard.set(appVersion, forKey: lastShownKey)
}
}
/// : +
static var shouldShow: Bool {
appVersion == contentVersion
&& UserDefaults.standard.string(forKey: lastShownKey) != appVersion
}
static func markShown() {
UserDefaults.standard.set(appVersion, forKey: lastShownKey)
}
var body: some View {
VStack(spacing: 0) {
ScrollView {
VStack(alignment: .leading, spacing: 22) {
VStack(alignment: .leading, spacing: 4) {
Text("새로워진 하루 다님")
.font(.title.bold())
Text("버전 1.5에서 이런 것들이 더해졌어요.")
.font(.subheadline)
.foregroundStyle(.secondary)
}
.padding(.top, 28)
feature(
symbol: "applewatch",
tint: AppTheme.green,
title: String(localized: "워치 페이스에서 행동 기록 보기"),
body: String(localized: "'행동 기록' 컴플리케이션이 새로 생겼어요. 행동 편집에서 켜면 워치 페이스에서 누적 기록을 바로 보고, 눌러서 바로 실행할 수 있어요.")
)
feature(
symbol: "heart.fill",
tint: .pink,
title: String(localized: "모음 탭에서 건강 데이터 보기"),
body: String(localized: "걸음·운동·수면 같은 애플 건강 앱의 오늘 데이터를 모음 탭 타일로 볼 수 있어요. 값은 기기 밖으로 나가지 않아요.")
)
feature(
symbol: "figure.run",
tint: .pink,
title: String(localized: "건강 데이터로 다짐 만들기"),
body: String(localized: "'매일 8,000보', '수면 8시간', '달리기 30분'처럼 건강 데이터를 목표로 삼는 다짐을 만들 수 있어요. 운동은 종목별로도 돼요. (프리미엄)")
)
feature(
symbol: "questionmark.circle.fill",
tint: AppTheme.yellow,
title: String(localized: "도움말 새 단장"),
body: String(localized: "도움말 전체 문구를 더 자연스럽게 다듬고, 새 기능 사용법을 더했어요.")
)
Label {
Text("아이폰·아이패드·맥을 함께 쓰신다면 모든 기기에서 하루 다님을 업데이트해 주세요. 버전이 섞이면 새 기능이 일부 기기에서 다르게 보일 수 있어요.")
.font(.footnote)
.foregroundStyle(.secondary)
} icon: {
Image(systemName: "arrow.triangle.2.circlepath")
.foregroundStyle(AppTheme.green)
}
.padding(.top, 2)
}
.padding(.horizontal, 24)
.padding(.bottom, 16)
}
Button {
dismiss()
} label: {
Text("시작하기")
.font(.headline)
.frame(maxWidth: .infinity)
.padding(.vertical, 14)
}
.buttonStyle(.borderedProminent)
.tint(AppTheme.green)
.padding(.horizontal, 24)
.padding(.bottom, 20)
}
.background(AppTheme.background)
}
private func feature(symbol: String, tint: Color, title: String, body text: String) -> some View {
HStack(alignment: .top, spacing: 14) {
Image(systemName: symbol)
.font(.title2)
.foregroundStyle(tint)
.frame(width: 34)
VStack(alignment: .leading, spacing: 3) {
Text(title)
.font(.subheadline.weight(.semibold))
Text(text)
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
}
}
}