Skip to content

Commit 2a69142

Browse files
committed
fix: address review feedback on kind chip filter
1 parent e9c0cb8 commit 2a69142

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

packages/devtools_app/lib/src/screens/logging/_message_column.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,9 @@ class MessageColumn extends ColumnData<LogData>
9494
builder: (context, constraints) {
9595
return MetadataChips(
9696
data: data,
97-
onKindTapped: (kind) {
98-
final controller = screenControllers
99-
.lookup<LoggingController>();
100-
controller.setActiveFilter(query: 'k:$kind');
101-
},
97+
onKindTapped: (kind) => screenControllers
98+
.lookup<LoggingController>()
99+
.setActiveFilter(query: 'k:"$kind"'),
102100
);
103101
},
104102
),

packages/devtools_app/lib/src/screens/logging/metadata.dart

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ abstract class MetadataChip extends StatelessWidget {
152152
? Border.all(color: theme.colorScheme.subtleTextColor)
153153
: null,
154154
),
155-
margin: includeLeadingMargin
156-
? const EdgeInsets.only(left: denseSpacing)
157-
: null,
158155
padding: const EdgeInsets.symmetric(
159156
horizontal: horizontalPadding,
160157
vertical: verticalPadding,
@@ -187,14 +184,26 @@ abstract class MetadataChip extends StatelessWidget {
187184
);
188185

189186
if (onTap != null) {
190-
chip = MouseRegion(
191-
cursor: SystemMouseCursors.click,
192-
child: GestureDetector(
193-
onTap: onTap,
194-
behavior: HitTestBehavior.opaque,
195-
child: chip,
187+
chip = Padding(
188+
padding: includeLeadingMargin
189+
? const EdgeInsets.only(left: denseSpacing)
190+
: EdgeInsets.zero,
191+
child: MouseRegion(
192+
cursor: SystemMouseCursors.click,
193+
child: GestureDetector(
194+
onTap: onTap,
195+
behavior: HitTestBehavior.opaque,
196+
child: chip,
197+
),
196198
),
197199
);
200+
} else {
201+
chip = Padding(
202+
padding: includeLeadingMargin
203+
? const EdgeInsets.only(left: denseSpacing)
204+
: EdgeInsets.zero,
205+
child: chip,
206+
);
198207
}
199208

200209
return maybeWrapWithTooltip(tooltip: tooltip, child: chip);

0 commit comments

Comments
 (0)