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
5 changes: 4 additions & 1 deletion DevLog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 2640;
LastUpgradeCheck = 2600;
LastUpgradeCheck = 2640;
TargetAttributes = {
DF3416442E45F67C00F9312B = {
CreatedOnToolsVersion = 16.3;
Expand All @@ -295,6 +295,7 @@
knownRegions = (
ko,
en,
Base,
);
mainGroup = DFD48AF72DC4D6E2005905C5;
minimizedProjectReferenceProxies = 1;
Expand Down Expand Up @@ -603,6 +604,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
Expand Down Expand Up @@ -671,6 +673,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
Expand Down
2 changes: 1 addition & 1 deletion DevLog.xcodeproj/xcshareddata/xcschemes/DevLog.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2600"
LastUpgradeVersion = "2640"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,26 @@
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2"
queueDebuggingEnableBacktraceRecording = "Yes">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.springboard">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DFD3A96F2F8E89DD001DA7CD"
BuildableName = "DevLogWidgetExtension.appex"
BlueprintName = "DevLogWidgetExtension"
ReferencedContainer = "container:DevLog.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DFD48AFF2DC4D6E2005905C5"
BuildableName = "DevLog.app"
BlueprintName = "DevLog"
ReferencedContainer = "container:DevLog.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "_XCWidgetKind"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2600"
LastUpgradeVersion = "2640"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion DevLogWidget/Heatmap/HeatmapWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct HeatmapWidget: Widget {
.widgetURL(WidgetDeepLink.heatmapURL)
}
.configurationDisplayName("Heatmap")
Comment thread
opficdev marked this conversation as resolved.
.description("활동 히트맵을 표시합니다.")
.description("widget_heatmap_description")
.supportedFamilies([.systemSmall, .systemMedium])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ import WidgetKit

struct HeatmapWidgetConfigurationIntent: WidgetConfigurationIntent {
static var title: LocalizedStringResource = "Heatmap"
Comment thread
opficdev marked this conversation as resolved.
static var description = IntentDescription("활동 히트맵을 표시합니다.")
static var description = IntentDescription("widget_heatmap_description")
}
10 changes: 5 additions & 5 deletions DevLogWidget/Heatmap/HeatmapWidgetEntryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct HeatmapWidgetEntryView: View {
switch widgetFamily {
case .systemSmall:
VStack(alignment: .leading, spacing: 4) {
header(title: "이번 달 히트맵")
header(title: "widget_heatmap_current_month_title")
WidgetHeatmapGrid(
months: currentMonths(from: snapshot),
selectedActivityKindRawValues: snapshot.selectedActivityKindRawValues,
Expand All @@ -38,7 +38,7 @@ struct HeatmapWidgetEntryView: View {
}
case .systemMedium:
VStack(alignment: .leading, spacing: 8) {
header(title: "이번 분기 히트맵")
header(title: "widget_heatmap_current_quarter_title")
WidgetHeatmapGrid(
months: snapshot.months,
selectedActivityKindRawValues: snapshot.selectedActivityKindRawValues,
Expand All @@ -58,15 +58,15 @@ struct HeatmapWidgetEntryView: View {
switch widgetFamily {
case .systemSmall:
VStack(alignment: .leading, spacing: 8) {
header(title: "이번 달 히트맵")
header(title: "widget_heatmap_current_month_title")
WidgetHeatmapPlaceholderGrid(
months: shape.currentMonths,
showsMonthTitles: false
)
}
case .systemMedium:
VStack(alignment: .leading, spacing: 8) {
header(title: "이번 분기 히트맵")
header(title: "widget_heatmap_current_quarter_title")
WidgetHeatmapPlaceholderGrid(
months: shape.quarterMonths,
showsMonthTitles: true
Expand All @@ -77,7 +77,7 @@ struct HeatmapWidgetEntryView: View {
}
}

private func header(title: String) -> some View {
private func header(title: LocalizedStringKey) -> some View {
HStack(alignment: .firstTextBaseline, spacing: 6) {
Text(title)
.font(.headline)
Expand Down
61 changes: 9 additions & 52 deletions DevLogWidget/Heatmap/WidgetHeatmapGrid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@ struct WidgetHeatmapGrid: View {
showsMonthTitles: showsMonthTitles
)

HStack(alignment: .top, spacing: layout.weekdayLabelSpacing) {
WidgetHeatmapWeekdayLabels(layout: layout)

HStack(alignment: .top, spacing: layout.monthSpacing) {
ForEach(months, id: \.monthStart) { month in
WidgetHeatmapMonthGrid(
month: month,
layout: layout,
selectedActivityKindRawValues: selectedActivityKindRawValues,
maxCount: maxCount,
showsMonthTitle: showsMonthTitles
)
}
HStack(alignment: .top, spacing: layout.monthSpacing) {
ForEach(months, id: \.monthStart) { month in
WidgetHeatmapMonthGrid(
month: month,
layout: layout,
selectedActivityKindRawValues: selectedActivityKindRawValues,
maxCount: maxCount,
showsMonthTitle: showsMonthTitles
)
}
}
Comment thread
opficdev marked this conversation as resolved.
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
Expand Down Expand Up @@ -71,45 +67,6 @@ struct WidgetHeatmapPlaceholderGrid: View {
}
}

private struct WidgetHeatmapWeekdayLabels: View {
let layout: WidgetHeatmapLayout
private let orderedWeekdays = Array(1...7)
private let weekdayLabels = [
2: "월",
4: "수",
6: "금"
]

var body: some View {
VStack(alignment: .leading, spacing: layout.cellSpacing) {
ForEach(orderedWeekdays, id: \.self) { weekday in
weekdayLabel(for: weekday)
}
}
.padding(.top, layout.weekdayTopPadding)
}

@ViewBuilder
private func weekdayLabel(for weekday: Int) -> some View {
if let label = weekdayLabels[weekday] {
Text(label)
.font(.caption2)
.foregroundStyle(.secondary)
.frame(
width: layout.weekdayLabelWidth,
height: layout.cellSize,
alignment: .leading
)
} else {
Color.clear
.frame(
width: layout.weekdayLabelWidth,
height: layout.cellSize
)
}
}
}

private struct WidgetHeatmapMonthGrid: View {
let month: WidgetHeatmapMonthSnapshot
let layout: WidgetHeatmapLayout
Expand Down
14 changes: 2 additions & 12 deletions DevLogWidget/Heatmap/WidgetHeatmapLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ struct WidgetHeatmapLayout {
let cellSpacing: CGFloat
let monthSpacing: CGFloat
let monthTitleSpacing: CGFloat
let weekdayLabelSpacing: CGFloat = Self.baseWeekdayLabelSpacing
let weekdayLabelWidth: CGFloat = Self.baseWeekdayLabelWidth
let showsMonthTitles: Bool

init(
Expand All @@ -37,10 +35,6 @@ struct WidgetHeatmapLayout {
)
}

var weekdayTopPadding: CGFloat {
showsMonthTitles ? cellSize + monthTitleSpacing : 0
}

var cellCornerRadius: CGFloat {
max(2, cellSize * 0.2)
}
Expand All @@ -49,8 +43,6 @@ struct WidgetHeatmapLayout {
private static let baseMonthSpacing: CGFloat = 10
private static let maxMonthSpacing: CGFloat = 26
private static let baseMonthTitleSpacing: CGFloat = 4
private static let baseWeekdayLabelSpacing: CGFloat = 5
private static let baseWeekdayLabelWidth: CGFloat = 14

private static func resolvedMonthTitleSpacing(showsMonthTitles: Bool) -> CGFloat {
// 월 제목을 표시하는 Medium에서만 제목과 셀 사이 간격을 확보한다.
Expand Down Expand Up @@ -99,10 +91,8 @@ struct WidgetHeatmapLayout {
) -> CGFloat {
// 셀 크기는 높이 기준으로 고정하고, 남는 가로폭만 월 간격 계산에 사용한다.
let sanitizedWeekCounts = sanitizedWeekCounts(weekCounts)
// 요일 라벨 영역, 전체 셀 컬럼, 월 내부 주차 spacing을 더해 기본 너비를 구한다.
let contentWidth = baseWeekdayLabelWidth
+ baseWeekdayLabelSpacing
+ cellSize * CGFloat(totalColumns(in: sanitizedWeekCounts))
// 전체 셀 컬럼과 월 내부 주차 spacing을 더해 기본 너비를 구한다.
let contentWidth = cellSize * CGFloat(totalColumns(in: sanitizedWeekCounts))
+ baseCellSpacing * CGFloat(totalColumnSpacings(in: sanitizedWeekCounts))
Comment thread
opficdev marked this conversation as resolved.
// 기본 너비보다 위젯이 넓을 때만 월 간격에 분배할 여유 폭이 생긴다.
return max(0, availableWidth - contentWidth)
Expand Down
103 changes: 103 additions & 0 deletions DevLogWidget/Resource/Localizable.xcstrings
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"sourceLanguage" : "ko",
"strings" : {
"#%lld" : {

},
"%lld" : {

},
"Heatmap" : {

},
"Today" : {

},
Comment thread
opficdev marked this conversation as resolved.
"widget_heatmap_current_month_title" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "This Month"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "이번 달 히트맵"
}
}
}
},
"widget_heatmap_current_quarter_title" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "This Quarter"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "이번 분기 히트맵"
}
}
}
},
"widget_heatmap_description" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Shows your activity heatmap."
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "활동 히트맵을 표시합니다."
}
}
}
},
"widget_today_description" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Shows today's Todo list."
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "오늘 기준 Todo 목록을 표시합니다."
}
}
}
},
"widget_today_empty_message" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "No tasks for today.\nTake a short break!"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "오늘은 할 일이 없어요.\n잠시 휴식을 취해보세요!"
}
}
}
}
},
"version" : "1.0"
}
2 changes: 1 addition & 1 deletion DevLogWidget/Today/TodayTodoWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct TodayTodoWidget: Widget {
.containerBackground(.fill.tertiary, for: .widget)
.widgetURL(WidgetDeepLink.todayTodoURL)
}
.description("오늘 기준 Todo 목록을 표시합니다.")
.description("widget_today_description")
.configurationDisplayName("Today")
Comment thread
opficdev marked this conversation as resolved.
.supportedFamilies([.systemSmall, .systemMedium])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ import WidgetKit

struct TodayTodoWidgetConfigurationIntent: WidgetConfigurationIntent {
static var title: LocalizedStringResource = "Today"
Comment thread
opficdev marked this conversation as resolved.
static var description = IntentDescription("오늘 기준 Todo 목록을 표시합니다.")
static var description = IntentDescription("widget_today_description")
}
4 changes: 2 additions & 2 deletions DevLogWidget/Today/TodayTodoWidgetEntryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct TodayTodoWidgetEntryView: View {
if let item = displayedItems(from: snapshot).first {
todoRow(item)
} else {
Text("오늘은 할 일이 없어요.\n잠시 휴식을 취해보세요!")
Text("widget_today_empty_message")
.font(.caption)
.foregroundStyle(.secondary)
.lineLimit(2)
Expand All @@ -51,7 +51,7 @@ struct TodayTodoWidgetEntryView: View {
let items = displayedItems(from: snapshot)
VStack(alignment: .leading, spacing: 6) {
if items.isEmpty {
Text("오늘은 할 일이 없어요.\n잠시 휴식을 취해보세요!")
Text("widget_today_empty_message")
.multilineTextAlignment(.center)
.font(.caption)
.foregroundStyle(.secondary)
Expand Down