New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flutter tools] Revert desktop device name changes and print the category instead #60395
[flutter tools] Revert desktop device name changes and print the category instead #60395
Conversation
…gory instead Revert flutter#58812 and instead make `flutter devices`/`flutter doctor` print the device category, which is what the IntelliJ IDE plugin does. The format will be: • deviceName (category) • deviceID • targetPlatformName • osName This does mean that the device name again will be the same the OS name for desktop devices. @devoncarew also suggested suffixing `-device` for the device names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes!
One main comment - I think the device ID for the desktop devices should have a -desktop
suffix (instead of a -device
suffix) to help differentiate them from other devices.
@@ -17,7 +17,7 @@ import 'linux_workflow.dart'; | |||
/// A device that represents a desktop Linux target. | |||
class LinuxDevice extends DesktopDevice { | |||
LinuxDevice() : super( | |||
'linux', | |||
'linux-device', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linux-desktop
?
@@ -15,7 +15,7 @@ import 'macos_workflow.dart'; | |||
/// A device that represents a desktop MacOS target. | |||
class MacOSDevice extends DesktopDevice { | |||
MacOSDevice() : super( | |||
'macos', | |||
'macos-device', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macos-desktop
?
@@ -18,7 +18,7 @@ import 'windows_workflow.dart'; | |||
/// A device that represents a desktop Windows target. | |||
class WindowsDevice extends DesktopDevice { | |||
WindowsDevice() : super( | |||
'windows', | |||
'windows-device', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windows-desktop
?
Out of curiosity, what devices are |
@@ -559,7 +559,7 @@ abstract class Device { | |||
supportIndicator += ' ($type)'; | |||
} | |||
table.add(<String>[ | |||
device.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will change everything, not just desktop; is that desired?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my intent, yes. Whether it's desirable it up to review. ;)
@@ -559,7 +559,7 @@ abstract class Device { | |||
supportIndicator += ' ($type)'; | |||
} | |||
table.add(<String>[ | |||
device.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't seem to have any associated test changes. If we want this behavior change, we should test it.
I believe the main motivation is to avoid the |
That isn't the line now, so mission accomplished if that's the whole problem statement 🙂 But the statement there was "it has confused people", which doesn't really tell me what the specific problem is. What, exactly, is it being confused with, or confusing them about? Do we know enough to know whether "Linux (desktop) • linux • linux-x64 • Linux" will still be confusing, and how? In what way will adding the word "desktop" to that line a second time reduce confusion? Without understanding exactly what problem we're trying to solve, it's hard to evaluate proposals. For instance, if the problem is that it's just the word Linux a bunch of times and people don't know why it keeps saying the same thing, adding more details to the last component, the way we do on other platforms (e.g., |
I agree with @stuartmorgan that Eventually, we'll also fix the device architecture to something like |
Actually it was tested 😄
|
Ah; the main overall issue is that the original change regressed the UX in IDEs. Whatever else we change, we should address that. You can see the issue in the linked PR. I care much less about reducing redundancy in the |
I understand that part; I'm asking for more specific details about the motivation for the initial PR. The change from including "desktop" in the name to displaying the category in
This PR does two seemingly unrelated things: fixes the regression for IDE display (I'm all for that), and then for reasons I don't understand adds redundancy to the |
macos: Nothing. windows: In practice, nothing. Historically there have been other Windows devices other than desktops. Granted, those other Windows-based platforms are dead now, and Flutter doesn't support them. linux: This one is the confusing one, and I changed the macos and windows devices for consistency. Android is Linux-based; does that count? What about other potential Linux-based platforms? It was particularly confusing if you ran I'm not particularly tied to changing the device IDs (which is why I settled with just lowercasing them in #58812), so I don't mind leaving that alone, but I thought it would be nice to break up the device-name/device-id/os-name monotony slightly. |
bc09e34
to
3a2c448
Compare
I fixed the tests, and since the device ID changes seem a bit controversial, I've changed those back |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Revert #58812 and instead make
flutter devices
/flutter doctor
print the device category, which is what the IntelliJ IDE plugin
does. The format will be:
This does mean that the device name again will be the same the OS
name for desktop devices.
@devoncarew also suggested suffixing
-device
for the device names.Related Issues
#58812
Tests
None
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
I reverted tests back to the state prior to #58812.