Skip to content

Commit a95b395

Browse files
authored
Fix screenshot generation (#24918)
1 parent 2c94fbe commit a95b395

29 files changed

Lines changed: 3668 additions & 177 deletions

File tree

API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/reader/read_feed_28523_posts.json

Lines changed: 2997 additions & 0 deletions
Large diffs are not rendered by default.

API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/reader/rest_v11_read_following_mine.json

Lines changed: 288 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,296 @@
77
"status": 200,
88
"jsonBody": {
99
"subscriptions": [
10-
10+
{
11+
"ID": "788578957",
12+
"blog_ID": "182890486",
13+
"feed_ID": "143967848",
14+
"URL": "http://automattic.design",
15+
"date_subscribed": "2024-11-13T13:27:45+00:00",
16+
"delivery_methods": {
17+
"notification": {
18+
"send_posts": false
19+
}
20+
},
21+
"name": "Automattic Design",
22+
"organization_id": 0,
23+
"unseen_count": 0,
24+
"last_updated": "2025-09-22T15:28:55+00:00",
25+
"site_icon": "https://a8cdesignsimple.wordpress.com/wp-content/uploads/2024/09/a8c-design-site-icon-2024.png?w=96",
26+
"is_owner": false,
27+
"meta": {
28+
"links": {
29+
"site": "https://public-api.wordpress.com/rest/v1.2/read/sites/182890486",
30+
"feed": "https://public-api.wordpress.com/rest/v1.1/read/feed/143967848"
31+
},
32+
"data": {
33+
"site": {
34+
"ID": 182890486,
35+
"name": "Automattic Design",
36+
"description": "Designing a better web",
37+
"URL": "http://automattic.design",
38+
"jetpack": false,
39+
"jetpack_connection": false,
40+
"post_count": 541,
41+
"subscribers_count": 6978,
42+
"lang": "en",
43+
"icon": {
44+
"img": "https://a8cdesignsimple.wordpress.com/wp-content/uploads/2024/09/a8c-design-site-icon-2024.png?w=96",
45+
"ico": "https://a8cdesignsimple.wordpress.com/wp-content/uploads/2024/09/a8c-design-site-icon-2024.png?w=96"
46+
},
47+
"logo": {
48+
"id": "25306",
49+
"sizes": [],
50+
"url": "https://a8cdesignsimple.wordpress.com/wp-content/uploads/2025/06/automattic-logo.svg"
51+
},
52+
"visible": true,
53+
"is_private": false,
54+
"is_coming_soon": false,
55+
"is_following": true,
56+
"organization_id": 0,
57+
"meta": {
58+
"links": {
59+
"self": "https://public-api.wordpress.com/rest/v1.2/sites/182890486",
60+
"help": "https://public-api.wordpress.com/rest/v1.2/sites/182890486/help",
61+
"posts": "https://public-api.wordpress.com/rest/v1.2/sites/182890486/posts/",
62+
"comments": "https://public-api.wordpress.com/rest/v1.1/sites/182890486/comments/",
63+
"xmlrpc": "https://a8cdesignsimple.wordpress.com/xmlrpc.php"
64+
}
65+
},
66+
"launch_status": "launched",
67+
"site_migration": {
68+
"is_complete": false,
69+
"in_progress": false
70+
},
71+
"is_fse_active": false,
72+
"is_fse_eligible": false,
73+
"is_core_site_editor_enabled": true,
74+
"is_wpcom_atomic": false,
75+
"is_wpcom_staging_site": false,
76+
"is_deleted": false,
77+
"is_a4a_client": false,
78+
"is_a4a_dev_site": false,
79+
"capabilities": {
80+
"edit_pages": false,
81+
"edit_posts": false,
82+
"edit_others_posts": false,
83+
"edit_theme_options": false,
84+
"list_users": false,
85+
"manage_categories": false,
86+
"manage_options": false,
87+
"publish_posts": false,
88+
"upload_files": false,
89+
"view_stats": false
90+
},
91+
"is_multi_author": true,
92+
"feed_ID": 143967848,
93+
"feed_URL": "http://automattic.design",
94+
"header_image": false,
95+
"owner": {
96+
"ID": 26957695,
97+
"login": "a8cuser",
98+
"name": "a8cuser",
99+
"first_name": "",
100+
"last_name": "",
101+
"nice_name": "a8cuser",
102+
"URL": "",
103+
"avatar_URL": "https://1.gravatar.com/avatar/48e997e4a437d5002ae4c1eff741b37c2f4e1cad14d45f173ae78c25a0c41a38?s=96&d=identicon&r=G",
104+
"profile_URL": "https://gravatar.com/a8cuser",
105+
"ip_address": false,
106+
"site_visible": false,
107+
"has_avatar": true
108+
},
109+
"subscription": {
110+
"delivery_methods": {
111+
"email": null,
112+
"notification": {
113+
"send_posts": false
114+
}
115+
}
116+
},
117+
"is_blocked": false,
118+
"unseen_count": 0
119+
},
120+
"feed": {
121+
"blog_ID": "182890486",
122+
"feed_ID": "143967848",
123+
"blog_owner": {
124+
"ID": 26957695,
125+
"name": "a8cuser"
126+
},
127+
"name": "Automattic Design",
128+
"URL": "http://automattic.design/",
129+
"feed_URL": "http://automattic.design",
130+
"subscribers_count": 6978,
131+
"is_following": true,
132+
"last_update": "2025-09-22T15:28:55+00:00",
133+
"last_checked": "2025-09-22T15:29:01+00:00",
134+
"marked_for_refresh": false,
135+
"next_refresh_time": null,
136+
"organization_id": 0,
137+
"subscription_id": "788578957",
138+
"unseen_count": 0,
139+
"meta": {
140+
"links": {
141+
"self": "https://public-api.wordpress.com/rest/v1.1/read/feed/143967848",
142+
"site": "https://public-api.wordpress.com/rest/v1.1/read/sites/182890486"
143+
}
144+
},
145+
"image": "https://a8cdesignsimple.files.wordpress.com/2024/09/a8c-design-site-icon-2024.png?w=32",
146+
"description": "Designing a better web"
147+
}
148+
}
149+
},
150+
"is_wpforteams_site": false,
151+
"is_paid_subscription": false,
152+
"is_rss": false,
153+
"is_gift": false
154+
},
155+
{
156+
"ID": "785513750",
157+
"blog_ID": "3584907",
158+
"feed_ID": "25823",
159+
"URL": "http://en.blog.wordpress.com",
160+
"date_subscribed": "2024-10-11T20:14:36+00:00",
161+
"delivery_methods": {
162+
"notification": {
163+
"send_posts": false
164+
}
165+
},
166+
"name": "WordPress.com News",
167+
"organization_id": 0,
168+
"unseen_count": 0,
169+
"last_updated": "2025-09-30T21:13:09+00:00",
170+
"site_icon": null,
171+
"is_owner": false,
172+
"meta": {
173+
"links": {
174+
"site": "https://public-api.wordpress.com/rest/v1.2/read/sites/3584907",
175+
"feed": "https://public-api.wordpress.com/rest/v1.1/read/feed/25823"
176+
},
177+
"data": {
178+
"site": {
179+
"ID": 3584907,
180+
"name": "WordPress.com News",
181+
"description": "The latest news on WordPress.com and the WordPress community.",
182+
"URL": "http://en.blog.wordpress.com",
183+
"jetpack": false,
184+
"jetpack_connection": false,
185+
"post_count": 1992,
186+
"subscribers_count": 120400870,
187+
"lang": "en",
188+
"logo": {
189+
"id": 0,
190+
"sizes": [],
191+
"url": ""
192+
},
193+
"visible": true,
194+
"is_private": false,
195+
"is_coming_soon": false,
196+
"is_following": true,
197+
"organization_id": 0,
198+
"meta": {
199+
"links": {
200+
"self": "https://public-api.wordpress.com/rest/v1.2/sites/3584907",
201+
"help": "https://public-api.wordpress.com/rest/v1.2/sites/3584907/help",
202+
"posts": "https://public-api.wordpress.com/rest/v1.2/sites/3584907/posts/",
203+
"comments": "https://public-api.wordpress.com/rest/v1.1/sites/3584907/comments/",
204+
"xmlrpc": "https://en.blog.wordpress.com/xmlrpc.php"
205+
}
206+
},
207+
"launch_status": false,
208+
"site_migration": {
209+
"is_complete": false,
210+
"in_progress": false
211+
},
212+
"is_fse_active": false,
213+
"is_fse_eligible": false,
214+
"is_core_site_editor_enabled": false,
215+
"is_wpcom_atomic": false,
216+
"is_wpcom_staging_site": false,
217+
"is_deleted": false,
218+
"is_a4a_client": false,
219+
"is_a4a_dev_site": false,
220+
"capabilities": {
221+
"edit_pages": false,
222+
"edit_posts": false,
223+
"edit_others_posts": false,
224+
"edit_theme_options": false,
225+
"list_users": false,
226+
"manage_categories": false,
227+
"manage_options": false,
228+
"publish_posts": false,
229+
"upload_files": false,
230+
"view_stats": false
231+
},
232+
"is_multi_author": true,
233+
"feed_ID": 25823,
234+
"feed_URL": "http://en.blog.wordpress.com",
235+
"header_image": false,
236+
"owner": {
237+
"ID": 26957695,
238+
"login": "a8cuser",
239+
"name": "a8cuser",
240+
"first_name": "",
241+
"last_name": "",
242+
"nice_name": "a8cuser",
243+
"URL": "",
244+
"avatar_URL": "https://1.gravatar.com/avatar/48e997e4a437d5002ae4c1eff741b37c2f4e1cad14d45f173ae78c25a0c41a38?s=96&d=retro",
245+
"profile_URL": "https://gravatar.com/a8cuser",
246+
"ip_address": false,
247+
"site_visible": false,
248+
"has_avatar": true
249+
},
250+
"subscription": {
251+
"delivery_methods": {
252+
"email": null,
253+
"notification": {
254+
"send_posts": false
255+
}
256+
}
257+
},
258+
"is_blocked": false,
259+
"unseen_count": 0
260+
},
261+
"feed": {
262+
"blog_ID": "3584907",
263+
"feed_ID": "25823",
264+
"blog_owner": {
265+
"ID": 26957695,
266+
"name": "a8cuser"
267+
},
268+
"name": "WordPress.com News",
269+
"URL": "http://en.blog.wordpress.com/",
270+
"feed_URL": "http://en.blog.wordpress.com",
271+
"subscribers_count": 120400870,
272+
"is_following": true,
273+
"last_update": "2025-09-30T21:13:09+00:00",
274+
"last_checked": "2025-09-30T21:24:37+00:00",
275+
"marked_for_refresh": false,
276+
"next_refresh_time": null,
277+
"organization_id": 0,
278+
"subscription_id": "785513750",
279+
"unseen_count": 0,
280+
"meta": {
281+
"links": {
282+
"self": "https://public-api.wordpress.com/rest/v1.1/read/feed/25823",
283+
"site": "https://public-api.wordpress.com/rest/v1.1/read/sites/3584907"
284+
}
285+
},
286+
"image": "http://s0.wp.com/i/buttonw-com.png",
287+
"description": "The latest news on WordPress.com and the WordPress community."
288+
}
289+
}
290+
},
291+
"is_wpforteams_site": false,
292+
"is_paid_subscription": false,
293+
"is_rss": false,
294+
"is_gift": false
295+
}
11296
],
12297
"page": 1,
13-
"number": 0,
14-
"total_subscriptions": 0
298+
"number": 2,
299+
"total_subscriptions": 2
15300
},
16301
"headers": {
17302
"Content-Type": "application/json",

Modules/Sources/JetpackStats/Cards/ChartCard.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ struct ChartCard: View {
127127
loadingErrorView(with: Strings.Chart.hourlyDataUnavailable)
128128
} else {
129129
mainChartView(metric: selectedMetric, data: data)
130+
.accessibilityIdentifier("chart_card_chart_view")
130131
.transition(.opacity.combined(with: .scale(scale: 0.97)))
131132
}
132133
} else {
@@ -275,7 +276,7 @@ private struct CardGradientBackground: View {
275276
}
276277
}
277278

278-
enum ChartType: String, CaseIterable, Codable {
279+
public enum ChartType: String, CaseIterable, Codable {
279280
case line
280281
case columns
281282

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import Foundation
22

3-
struct ChartCardConfiguration: Codable {
3+
public struct ChartCardConfiguration: Codable {
44
let id: UUID
55
var metrics: [SiteMetric]
66
var chartType: ChartType
77

8-
init(id: UUID = UUID(), metrics: [SiteMetric], chartType: ChartType = .columns) {
8+
init(id: UUID = UUID(), metrics: [SiteMetric], chartType: ChartType = Self.defaultChartType) {
99
self.id = id
1010
self.metrics = metrics
1111
self.chartType = chartType
1212
}
13+
14+
nonisolated(unsafe) public static var defaultChartType: ChartType = .columns
1315
}

0 commit comments

Comments
 (0)