Skip to content

Conversation

@DanTup
Copy link
Contributor

@DanTup DanTup commented Sep 14, 2023

Some tweaks to the sidebar UI. Currently looks like this:

sidebar2.mp4

Things that still need doing:

  • background color is from the editor, not the sidebar
  • test light theme
  • need an icon for DevTools dropdown
  • debug session names show literal (null) for mode while starting
  • some items missing from DevTools menu
  • DevTools page conditions need verifying/sharing
  • ...

@kenzieschmoll @anderdobo

@DanTup DanTup requested a review from a team as a code owner September 14, 2023 14:10
@DanTup DanTup requested review from bkonyi and kenzieschmoll and removed request for a team September 14, 2023 14:10
@kenzieschmoll
Copy link
Member

need an icon for DevTools dropdown

Can we just use the Dart Icon? @InMatrix @Nancyhu2023 should we create an icon specific to DevTools (like the Dart icon with a wrench or something?)

return TableRow(
children: [
Text(
'${session.name} (${session.flutterMode})',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of showing null as a literal, can we just show 'Session starting...' until we know we have non null values for both of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped the mode if it's null. I think if we want to show explicitly that it's starting, we should tweak the API to make a more explicit status rather than using this field to infer it (I think they're equivalent but it feels like a slightly weird assumption).

children: [
Text(
'${session.name} (${session.flutterMode})',
style: Theme.of(context).textTheme.titleSmall,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about Theme.of(context).regularTextStyle here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Although I'm not actually sure what the difference is between that and just not having it. When I add that line and/or comment it out, the spacing of some of the letters changes very slightly when I hot reload, but only for one session and not the other. Seems almost like some rounding issue:

textstyle.mp4

Comment on lines +144 to +145
// TODO(dantup): Ensure the order matches the DevTools tab bar (if
// possible, share this order).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkout the ScreenMetaData enum in screen.dart. We can try to match the order there. If we do this, we should also add a test to visible_screens_test.dart that ensures that the order of DevTools screens matches the order specified in the enum.

Comment on lines 134 to 135
return Directionality(
textDirection: reversedDirection,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this directionality widget?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to have the menu anchor on the right and expand left (and also to put the icons on the right). I've added a comment to make this clearer.

Screenshot 2023-09-15 105539

Screenshot 2023-09-15 105549

Comment on lines 68 to 69
style:
TextStyle(color: isSelected ? colorScheme.onPrimary : null),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do Theme.of(context).regularTextStyle.copyWith(color: ...)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I also applied regularTextStyle to the TextButton because it was making the text bold by default which didn't match the debug sessions.

image

textDirection: reversedDirection,
// Reverse the direction so the menu is anchored on the far side and
// expands in the opposite direction with the icons on the right.
textDirection: normalDirection,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want this revered, shouldn't this be reversedDirection?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ug sorry, this was an accidental change after I took the screenshot above. Fixed.

for (final device in devices)
_createDeviceRow(
colorScheme,
Theme.of(context),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

store theme in a var at the top of the build method so we don't have to call Theme.of(context) more than once

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Member

@kenzieschmoll kenzieschmoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good! one comment then lgtm

@InMatrix
Copy link

Can we just use the Dart Icon? @InMatrix @Nancyhu2023 should we create an icon specific to DevTools (like the Dart icon with a wrench or something?)

How about the construction icon from Google Symbols and Icons? https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/construction/default/24px.svg.

image

@DanTup
Copy link
Contributor Author

DanTup commented Sep 17, 2023

I've switched to the construction icon for now, but can easily change if we find something better (or DevTools gets a specific icon).

@DanTup DanTup merged commit b20ec12 into flutter:master Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants