Hug the turn activity row's hover on desktop
On macOS, Linux, Windows and desktop browsers the "Thought · tool calls · background tasks" row is as wide as its label, so its hover and click area no longer span the transcript. Phones keep the full-width touch row. The check uses the device platform because web themes are pinned to Android. The scroll fixture gains ?turnactivity=1 for captures.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// The app renders the same Material layout and design on every platform:
|
||||
/// web, Android, iOS and macOS. The Cupertino host and controls remain
|
||||
/// available only when a caller asks for them explicitly (`cupertino: true`);
|
||||
@@ -6,3 +9,17 @@
|
||||
/// Flutter's automatic platform behaviours (scroll physics, text selection,
|
||||
/// page transitions and back-swipe) still follow the target platform.
|
||||
bool prefersCupertino() => false;
|
||||
|
||||
/// Whether this runs on a desktop platform (macOS, Linux, Windows),
|
||||
/// including a desktop browser. Hover and click targets there hug their
|
||||
/// content; phones and tablets keep full-width touch rows. Uses the device's
|
||||
/// platform, not the theme's: web themes are pinned to Android.
|
||||
bool prefersCompactHitTargets(BuildContext context) =>
|
||||
switch (defaultTargetPlatform) {
|
||||
TargetPlatform.macOS ||
|
||||
TargetPlatform.linux ||
|
||||
TargetPlatform.windows => true,
|
||||
TargetPlatform.android ||
|
||||
TargetPlatform.iOS ||
|
||||
TargetPlatform.fuchsia => false,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user