Skip to content

Commit db39fec

Browse files
authored
fix web shard icons (#3251)
This is so all web tests show using the Chromium icon rather than OS icon.
1 parent 9f94c26 commit db39fec

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

dashboard/lib/widgets/task_icon.dart

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,37 +48,41 @@ class TaskIcon extends StatelessWidget {
4848
);
4949
}
5050

51-
if (qualifiedTask.task!.toLowerCase().contains('_fuchsia')) {
51+
final String matchedName = qualifiedTask.task!.toLowerCase();
52+
final bool isWebTest = matchedName.contains('_web') || matchedName.contains('web_');
53+
final bool isToolTest = matchedName.contains('_tool') || matchedName.contains('tool_');
54+
55+
if (matchedName.contains('_fuchsia')) {
5256
return Padding(
5357
padding: const EdgeInsets.all(2.0),
5458
child: Image.asset(
5559
'assets/fuchsia.png',
5660
color: blendFilter,
5761
),
5862
);
59-
} else if (qualifiedTask.task!.toLowerCase().contains('_web')) {
63+
} else if (isWebTest && !isToolTest) {
6064
return Padding(
6165
padding: const EdgeInsets.all(2.0),
6266
child: Image.asset(
6367
'assets/chromium.png',
6468
color: blendFilter,
6569
),
6670
);
67-
} else if (qualifiedTask.task!.toLowerCase().contains('_android')) {
71+
} else if (matchedName.contains('_android')) {
6872
return Icon(
6973
Icons.android,
7074
color: blendFilter,
7175
);
72-
} else if (qualifiedTask.task!.toLowerCase().startsWith('linux')) {
76+
} else if (matchedName.startsWith('linux')) {
7377
return Padding(
7478
padding: const EdgeInsets.all(2.0),
7579
child: Image.asset(
7680
'assets/linux.png',
7781
color: blendFilter,
7882
),
7983
);
80-
} else if (qualifiedTask.task!.toLowerCase().startsWith('mac')) {
81-
if (qualifiedTask.task!.toLowerCase().contains('_ios')) {
84+
} else if (matchedName.startsWith('mac')) {
85+
if (matchedName.contains('_ios')) {
8286
return Icon(
8387
Icons.phone_iphone,
8488
color: blendFilter,
@@ -92,7 +96,7 @@ class TaskIcon extends StatelessWidget {
9296
),
9397
);
9498
}
95-
} else if (qualifiedTask.task!.toLowerCase().startsWith('win')) {
99+
} else if (matchedName.startsWith('win')) {
96100
return Image.asset(
97101
'assets/windows.png',
98102
color: blendFilter,

0 commit comments

Comments
 (0)