Skip to content
Open
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
2 changes: 1 addition & 1 deletion Modules/Sources/JetpackStats/Cards/ChartCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ struct ChartCardHeaderView: View {
}
}
if viewModel.showComparison {
Text("\(viewModel.trend.formattedChange) \(viewModel.trend.iconSign) \(viewModel.trend.formattedPercentage)")
Text(verbatim: "\(viewModel.trend.formattedChange) \(viewModel.trend.iconSign) \(viewModel.trend.formattedPercentage)")
.font(.caption.weight(.semibold))
.foregroundColor(viewModel.trend.sentiment.foregroundColor)
.contentTransition(.numericText())
Expand Down
2 changes: 1 addition & 1 deletion Modules/Sources/JetpackStats/Charts/PieChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct PieChartView: View {
.cornerRadius(5)
.annotation(position: .overlay) {
if shouldShowAnnotation(for: segment) {
Text("\(segment.name.capitalized) \((segment.percentage / 100).formatted(.percent.precision(.fractionLength(1))))")
Text(verbatim: "\(segment.name.capitalized) \((segment.percentage / 100).formatted(.percent.precision(.fractionLength(1))))")
.font(.caption2)
.fontWeight(.medium)
.foregroundStyle(.white)
Expand Down
2 changes: 1 addition & 1 deletion Modules/Sources/JetpackStats/Screens/PostStatsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ private struct PostLikesStripView: View {

// Show additional count if there are more users
if likes.totalCount > maxVisibleAvatars {
Text("+\((likes.totalCount - maxVisibleAvatars).formatted(.number.notation(.compactName)))")
Text(verbatim: "+\((likes.totalCount - maxVisibleAvatars).formatted(.number.notation(.compactName)))")
.font(.caption2.weight(.medium))
.foregroundColor(.primary.opacity(0.8))
.padding(.horizontal, 4)
Expand Down
4 changes: 2 additions & 2 deletions Modules/Sources/JetpackStats/Views/StatsCardTitleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct StatsCardTitleView: View {
if showChevron {
// Note: had to do that to fix the animation issuse with Menu
// hiding the image.
title + Text(" ") + Text(Image(systemName: "chevron.up.chevron.down"))
title + Text(verbatim: " ") + Text(Image(systemName: "chevron.up.chevron.down"))
.font(.caption2.weight(.semibold))
.foregroundColor(.secondary)
.baselineOffset(1)
Expand Down Expand Up @@ -59,7 +59,7 @@ struct InlineValuePickerTitle: View {

// Note: had to do that to fix the animation issuse with Menu
// hiding the image.
title + Text(" ") + Text(Image(systemName: "chevron.up.chevron.down"))
title + Text(verbatim: " ") + Text(Image(systemName: "chevron.up.chevron.down"))
.font(.caption2.weight(.semibold))
.foregroundColor(.secondary)
.baselineOffset(1)
Expand Down
2 changes: 1 addition & 1 deletion Modules/Sources/JetpackStats/Views/TimezoneInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct TimezoneInfoView: View {
.font(.headline)
.foregroundStyle(.primary)

Text("\(formattedTimeZone) (\(context.formatters.date.formattedTimeOffset))")
Text(verbatim: "\(formattedTimeZone) (\(context.formatters.date.formattedTimeOffset))")
.font(.footnote)
.foregroundColor(.secondary)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ struct TopListVideoRowView: View {

var body: some View {
VStack(alignment: .leading, spacing: 2) {
(Text(Image(systemName: "play.circle")).font(.footnote) + Text(" ") + Text(item.title))
(Text(Image(systemName: "play.circle")).font(.footnote) + Text(verbatim: " ") + Text(item.title))
.font(.callout)
.foregroundColor(.primary)
.lineLimit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct TopListItemView: View {
var content: some View {
HStack(alignment: .center, spacing: 0) {
if let index {
Text("\(index + 1)")
Text(index + 1, format: .number)
.font(.system(.subheadline, design: .rounded, weight: .medium))
.frame(width: 22, alignment: .center)
.lineLimit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct TopListMetricsView: View {
}
if let trend {
HStack(spacing: 3) {
Text("\(trend.iconSign) \(trend.formattedPercentage)")
Text(verbatim: "\(trend.iconSign) \(trend.formattedPercentage)")
.font(.system(.caption2, design: .rounded, weight: .semibold)).tracking(-0.25)
.foregroundColor(trend.sentiment.foregroundColor)
.contentTransition(.numericText())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct ConversationBotIntro: View {
.font(.title2)
.fontWeight(.semibold)

Text("👋")
Text(verbatim: "👋")
.font(.title2)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public struct ConversationView: View {

switchToHumanSupport

Text("").padding(.bottom, 4)
Text(verbatim: "").padding(.bottom, 4)
.listRowInsets(.zero)
.listRowBackground(Color.clear)
.listRowSpacing(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public struct ApplicationTokenListItemView: View {
.multilineTextAlignment(.leading)
.lineLimit(2)
.truncationMode(.middle)
Text("\(createdDateText) • \(lastUsedText)")
Text(verbatim: "\(createdDateText) • \(lastUsedText)")
.font(.footnote)
.foregroundStyle(.secondary)
.lineLimit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct DeleteUserConfirmationSheet: View {
Section {
Picker(Strings.attributeContentToUserLabel, selection: $deleteUserViewModel.selectedUser) {
ForEach(deleteUserViewModel.otherUsers) { user in
Text("\(user.displayName) (\(user.username))").tag(user)
Text(verbatim: "\(user.displayName) (\(user.username))").tag(user)
}
}
} header: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private struct ActivityHeaderView: View {
)
.fixedSize(horizontal: false, vertical: true)
} else {
Text("—")
Text(verbatim: "—")
.font(.body)
.foregroundColor(.secondary)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct ActivityLogRowView: View {
.font(.footnote)
.foregroundColor(.secondary)
if let subtitle = viewModel.actorSubtitle {
Text("·")
Text(verbatim: "·")
.font(.footnote)
.foregroundColor(.secondary)
Text(subtitle)
Expand All @@ -55,7 +55,7 @@ struct ActivityLogRowView: View {
}

if let metadata = viewModel.actorMetadata {
Text("·")
Text(verbatim: "·")
.font(.footnote)
.foregroundColor(.secondary)
Text(metadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct ActivityLogsFiltersMenu: View {
} label: {
Text(Strings.activityTypes)
if !viewModel.parameters.activityTypes.isEmpty {
Text("\(viewModel.parameters.activityTypes.count)")
Text(viewModel.parameters.activityTypes.count, format: .number)
}
Image(systemName: "list.bullet")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private struct ActivityTypeRow: View {
HStack {
Text(group.name)
Spacer()
Text("\(group.count)")
Text(group.count, format: .number)
.foregroundColor(.secondary)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private struct BackupInProgressView: View {
.progressViewStyle(.linear)
.tint(.accentColor)

Text("\(progress)%")
Text(Double(progress) / 100, format: .percent)
.font(.caption)
.foregroundStyle(.secondary)
.monospacedDigit()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ struct WebServerLogsView: View {
Picker("", selection: $searchCriteria.status) {
let cases = [200, 301, 302, 400, 401, 403, 404, 500]
ForEach(cases, id: \.self) {
Text("\($0)").tag(Optional.some($0))
Text(verbatim: "\($0)").tag(Optional.some($0))
}
}.pickerStyle(.inline)
} label: {
Text("\($0)")
Text(verbatim: "\($0)")
}
.contentPresentationStyle(.menu)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct SubscriberDetailsView: View {
Text(plan.title)
.font(.headline)
if plan.isGift {
Text("– \(Strings.gift)")
Text(verbatim: "– \(Strings.gift)")
.foregroundStyle(.secondary)
Spacer()
Image(systemName: "gift")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct SubscribersFiltersMenu: View {
filterByPaymenetType
}
if let response = viewModel.response, let count = viewModel.makeFormattedSubscribersCount(for: response) {
Text("\(Strings.subscribers) \(count)")
Text(verbatim: "\(Strings.subscribers) \(count)")
}
} label: {
Image(systemName: "line.3.horizontal.decrease")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct StoreSandboxSecretScreen: View {
var body: some View {
NavigationView {
VStack(alignment: .leading) {
Text("Enter the Store Sandbox Cookie Secret:")
Text(verbatim: "Enter the Store Sandbox Cookie Secret:")
TextField("Secret", text: $secret)
.padding(EdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16))
.border(Color.black)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct WeeklyRoundupDebugScreen: View {
VStack(alignment: .center) {
if errorScheduling {
Group {
Text("Error scheduling Weekly Roundup!")
Text(verbatim: "Error scheduling Weekly Roundup!")
.foregroundColor(.red)
}

Expand Down Expand Up @@ -130,7 +130,7 @@ struct WeeklyRoundupDebugScreen: View {
.frame(height: settings.spacerHeight)
}

Text("The values represent when the dynamic notification is scheduled at the earliest. It can take a lot more time to be sent since iOS basically decides when to deliver it.")
Text(verbatim: "The values represent when the dynamic notification is scheduled at the earliest. It can take a lot more time to be sent since iOS basically decides when to deliver it.")
.fixedSize(horizontal: false, vertical: true)
.padding(settings.defaultPadding)

Expand All @@ -153,18 +153,18 @@ struct WeeklyRoundupDebugScreen: View {

func scheduleDetailsView() -> some View {
guard !running else {
return AnyView(Text("Running..."))
return AnyView(Text(verbatim: "Running..."))
}

if let scheduledDate = self.scheduledDate {
return AnyView(HStack {
Text("Earliest begin date:")
Text(verbatim: "Earliest begin date:")
Spacer()
Text("\(scheduledDate.shortStringWithTime())")
Text(verbatim: "\(scheduledDate.shortStringWithTime())")
})
} else {
return AnyView(HStack {
Text("Not scheduled.")
Text(verbatim: "Not scheduled.")
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ struct DebugFeatureFlagsView: View {
.navigationBarTitleDisplayMode(.inline)
.toolbarTitleMenu {
Picker("Filter", selection: $viewModel.filter) {
Text("Feature Flags (All)").tag(DebugFeatureFlagFilter.all)
Text("Remote Feature Flags").tag(DebugFeatureFlagFilter.remote)
Text("Local Feature Flags").tag(DebugFeatureFlagFilter.local)
Text("Overriden Feature Flags").tag(DebugFeatureFlagFilter.overriden)
Text(verbatim: "Feature Flags (All)").tag(DebugFeatureFlagFilter.all)
Text(verbatim: "Remote Feature Flags").tag(DebugFeatureFlagFilter.remote)
Text(verbatim: "Local Feature Flags").tag(DebugFeatureFlagFilter.local)
Text(verbatim: "Overriden Feature Flags").tag(DebugFeatureFlagFilter.overriden)
}.pickerStyle(.inline)
}
.toolbar {
Expand Down Expand Up @@ -59,7 +59,7 @@ struct DebugFeatureFlagsView: View {
VStack(alignment: .leading) {
Text(title)
if isOverriden {
Text("Overriden")
Text(verbatim: "Overriden")
.font(.subheadline)
.foregroundColor(.secondary)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extension Text {
return
}

var text = Text("")
var text = Text(verbatim: "")

parts.enumerated().forEach { index, part in
let partText = Text(part)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct PostDiscussionSettingsView: View {
.accessibilityIdentifier("post_discussion_allow_pings_toggle")
} footer: {
Link(destination: Strings.pingbacksLearnMoreURL) {
(Text(Strings.learnMorePingbacksText) + Text(" ") + Text(Image(systemName: "link")))
(Text(Strings.learnMorePingbacksText) + Text(verbatim: " ") + Text(Image(systemName: "link")))
.font(.footnote)
}
.accessibilityIdentifier("post_discussion_pingbacks_learn_more_button")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ private struct PostSettingsAuthorRow: View {
.foregroundColor(.secondary)
.textSelection(.enabled)
} else {
Text("—")
Text(verbatim: "—")
.foregroundColor(.secondary)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct PostSlugEditorView: View {
.foregroundColor(.secondary)

Link(destination: URL(string: "https://wordpress.com/support/permalinks-and-slugs/")!) {
(Text(Strings.learnMore) + Text(" ") + Text(Image(systemName: "arrow.up.right.square")))
(Text(Strings.learnMore) + Text(verbatim: " ") + Text(Image(systemName: "arrow.up.right.square")))
.font(.subheadline)
.foregroundColor(.accentColor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private struct ItemView: View {
.font(.subheadline)
.foregroundColor(.secondary)
if remainingCount > 0 {
Text("(+\(remainingCount))")
Text(verbatim: "(+\(remainingCount.formatted()))")
.font(.system(.subheadline, design: .monospaced))
.foregroundColor(.secondary)
.tracking(-0.5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ struct PostSettingsPasswordRow: View {
HStack {
Text(Strings.passwordLabel)
Spacer()
Text("••••••••••••")
Text(verbatim: "••••••••••••")
.font(.footnote.monospaced())
.foregroundStyle(.secondary)
Image(systemName: "chevron.forward")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private struct AuthorRow: View {
.font(.callout.weight(.medium))

if let username = author.username {
Text("@\(username)")
Text(verbatim: "@\(username)")
.font(.footnote)
.foregroundColor(.secondary)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct ResolveConflictView: View {
Section {
VStack(alignment: .leading, spacing: 12) {
let title = post.latest().titleForDisplay()
Text("\"\(title)\"")
Text(verbatim: "\"\(title)\"")
.font(.headline)
.lineLimit(2)
Text(Strings.description)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ struct ReaderDetailHeaderView: View {
.font(Font(viewModel.displaySetting.font(with: .footnote, weight: .semibold)))
.foregroundStyle(Color(primaryTextColor))
if !viewModel.authorName.isEmpty {
Text(" • ")
Text(verbatim: " • ")
.font(Font(viewModel.displaySetting.font(with: .footnote)))
.foregroundColor(Color(viewModel.displaySetting.color.secondaryForeground))
.layoutPriority(1)
Expand All @@ -282,7 +282,7 @@ struct ReaderDetailHeaderView: View {
.font(Font(viewModel.displaySetting.font(with: .footnote)))
.foregroundStyle(Color(primaryTextColor))
if !viewModel.isFollowingSite || !viewModel.isFollowButtonInteractive {
Text(" • ")
Text(verbatim: " • ")
.font(Font(viewModel.displaySetting.font(with: .footnote)))
.foregroundColor(Color(viewModel.displaySetting.color.secondaryForeground))
.layoutPriority(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ private struct ReaderSiteHeader: View {
let countsString = String(format: Constants.countsFormat, viewModel.postCount, viewModel.followerCount)
let stringItems = countsString.components(separatedBy: " ")

return stringItems.reduce(Text(""), {
return stringItems.reduce(Text(verbatim: ""), {
var text = Text($1)
if $1 == viewModel.postCount || $1 == viewModel.followerCount {
text = text.font(.subheadline)
} else {
text = text.font(.subheadline).foregroundColor(.secondary)
}
return $0 + text + Text(" ")
return $0 + text + Text(verbatim: " ")
})
}

Expand Down
Loading