@@ -168,13 +168,23 @@ public struct WMFActivityTabView: View {
168168 }
169169
170170 private func totalEditsView( amount: Int ) -> some View {
171- WMFActivityTabInfoCardView (
171+
172+ let formattedAmount = amountAccessibilityLabel ( for: amount)
173+
174+ return WMFActivityTabInfoCardView (
172175 icon: WMFSFSymbolIcon . for ( symbol: . globeAmericas, font: WMFFont . boldCaption1) ,
173176 title: viewModel. localizedStrings. totalEdits,
174177 dateText: nil ,
175- amount : amount ,
178+ additionalAccessibilityLabel : formattedAmount ,
176179 onTapModule: {
177180 viewModel. onTapGlobalEdits ? ( )
181+ } , content: {
182+ HStack ( alignment: . bottom) {
183+ Text ( " \( amount) " )
184+ . foregroundStyle ( Color ( theme. text) )
185+ . font ( Font ( WMFFont . for ( . boldTitle1) ) )
186+ Spacer ( )
187+ }
178188 }
179189 )
180190 // .padding(.top, 20)
@@ -282,45 +292,60 @@ public struct WMFActivityTabView: View {
282292 }
283293
284294 private func articlesReadModule( proxy: ScrollViewProxy ) -> some View {
285- WMFActivityTabInfoCardView (
295+
296+ let formattedAmount = amountAccessibilityLabel ( for: viewModel. articlesReadViewModel. totalArticlesRead)
297+
298+ return WMFActivityTabInfoCardView (
286299 icon: WMFSFSymbolIcon . for ( symbol: . bookPages, font: WMFFont . boldCaption1) ,
287300 title: viewModel. localizedStrings. totalArticlesRead,
288301 dateText: viewModel. articlesReadViewModel. dateTimeLastRead,
289- amount : viewModel . articlesReadViewModel . totalArticlesRead ,
302+ additionalAccessibilityLabel : formattedAmount ,
290303 onTapModule: {
291304 withAnimation ( . easeInOut) {
292305 proxy. scrollTo ( " timelineSection " , anchor: . top)
293306 }
294307 } ,
295308 content: {
296- articlesReadGraph ( weeklyReads: viewModel. articlesReadViewModel. weeklyReads)
309+ HStack ( alignment: . bottom) {
310+ Text ( " \( viewModel. articlesReadViewModel. totalArticlesRead) " )
311+ . foregroundStyle ( Color ( theme. text) )
312+ . font ( Font ( WMFFont . for ( . boldTitle1) ) )
313+ Spacer ( )
314+ articlesReadGraph ( weeklyReads: viewModel. articlesReadViewModel. weeklyReads)
315+ }
316+
297317 }
298318 )
299319 }
300320
301321 private var savedArticlesModule : some View {
302322
303- Group {
304- let thumbURLs = viewModel. articlesSavedViewModel. articlesSavedThumbURLs
305- let displayCount = min ( thumbURLs. count, 3 )
306- let remaining = viewModel. articlesSavedViewModel. articlesSavedAmount - displayCount
307-
308- WMFActivityTabInfoCardView (
309- icon: WMFSFSymbolIcon . for ( symbol: . bookmark, font: WMFFont . boldCaption1) ,
310- title: viewModel. localizedStrings. articlesSavedTitle,
311- dateText: viewModel. articlesSavedViewModel. dateTimeLastSaved,
312- amount: viewModel. articlesSavedViewModel. articlesSavedAmount,
313- onTapModule: {
314- viewModel. articlesSavedViewModel. onTapSaved ? ( )
315- } ,
316- content: {
323+ let thumbURLs = viewModel. articlesSavedViewModel. articlesSavedThumbURLs
324+ let displayCount = min ( thumbURLs. count, 3 )
325+ let remaining = viewModel. articlesSavedViewModel. articlesSavedAmount - displayCount
317326
327+ let formattedAmount = amountAccessibilityLabel ( for: viewModel. articlesSavedViewModel. articlesSavedAmount)
328+
329+ return WMFActivityTabInfoCardView (
330+ icon: WMFSFSymbolIcon . for ( symbol: . bookmark, font: WMFFont . boldCaption1) ,
331+ title: viewModel. localizedStrings. articlesSavedTitle,
332+ dateText: viewModel. articlesSavedViewModel. dateTimeLastSaved,
333+ additionalAccessibilityLabel: formattedAmount,
334+ onTapModule: {
335+ viewModel. articlesSavedViewModel. onTapSaved ? ( )
336+ } ,
337+ content: {
338+ HStack ( alignment: . bottom) {
339+ Text ( " \( viewModel. articlesSavedViewModel. articlesSavedAmount) " )
340+ . foregroundStyle ( Color ( theme. text) )
341+ . font ( Font ( WMFFont . for ( . boldTitle1) ) )
342+ Spacer ( )
318343 if !thumbURLs. isEmpty {
319344 savedArticlesImages ( thumbURLs: thumbURLs, totalSavedCount: viewModel. articlesSavedViewModel. articlesSavedAmount, remaining: remaining)
320345 }
321346 }
322- )
323- }
347+ }
348+ )
324349 }
325350
326351 private func showPlus( displayCount: Int , totalSavedCount: Int ) -> Bool {
@@ -389,46 +414,45 @@ public struct WMFActivityTabView: View {
389414 }
390415
391416 private func topCategoriesModule( categories: [ String ] ) -> some View {
392- VStack ( alignment: . leading, spacing: 24 ) {
393- HStack {
394- if let icon = WMFSFSymbolIcon . for ( symbol: . rectangle3) {
395- Image ( uiImage: icon)
396- }
397- Text ( viewModel. localizedStrings. topCategories)
398- . foregroundStyle ( Color ( theme. text) )
399- . font ( Font ( WMFFont . for ( . boldCaption1) ) )
400- }
401- . frame ( maxWidth: . infinity, alignment: . leading)
402-
403- ForEach ( categories. indices, id: \. self) { index in
404- let category = categories [ index]
417+
418+ WMFActivityTabInfoCardView (
419+ icon: WMFSFSymbolIcon . for ( symbol: . rectangle3, font: WMFFont . boldCaption1) ,
420+ title: viewModel. localizedStrings. topCategories,
421+ dateText: nil ,
422+ additionalAccessibilityLabel: nil ,
423+ onTapModule: nil ,
424+ content: {
405425 VStack ( alignment: . leading, spacing: 16 ) {
406- Text ( category)
407- . foregroundStyle ( Color ( theme. text) )
408- . font ( Font ( WMFFont . for ( . callout) ) )
409- . lineLimit ( 2 )
410-
411- if index < categories. count - 1 {
412- Divider ( )
413- . frame ( height: 1 )
414- . overlay (
415- Rectangle ( )
416- . fill ( Color ( uiColor: theme. baseBackground) )
417- . frame ( height: 1 )
418- )
419- . padding ( 0 )
426+ ForEach ( categories. indices, id: \. self) { index in
427+ let category = categories [ index]
428+ Text ( category)
429+ . foregroundStyle ( Color ( theme. text) )
430+ . font ( Font ( WMFFont . for ( . callout) ) )
431+ . frame ( maxWidth: . infinity, alignment: . leading)
432+ . lineLimit ( 2 )
433+
434+ if index < categories. count - 1 {
435+ Divider ( )
436+ . frame ( height: 1 )
437+ . overlay (
438+ Rectangle ( )
439+ . fill ( Color ( uiColor: theme. baseBackground) )
440+ . frame ( height: 1 )
441+ )
442+ . padding ( 0 )
443+ }
420444 }
421445 }
422446 }
423- }
424- . padding ( 16 )
425- . background ( Color ( theme. paperBackground) )
426- . cornerRadius ( 10 )
427- . overlay (
428- RoundedRectangle ( cornerRadius: 10 )
429- . stroke ( Color ( theme. baseBackground) , lineWidth: 0.5 )
430447 )
431448 }
449+
450+ private func amountAccessibilityLabel( for amount: Int ) -> String {
451+ let numberFormatter = NumberFormatter ( )
452+ numberFormatter. numberStyle = . decimal
453+
454+ return numberFormatter. string ( from: NSNumber ( value: amount) ) ?? " \( amount) "
455+ }
432456}
433457
434458struct TimelineSectionView : View {
0 commit comments