-
Notifications
You must be signed in to change notification settings - Fork 327
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
Ability to disable opening the file when selecting widget from Widget Explorer #6561
Comments
@DanTup could we add a setting in the Dart Code extension to allow disabling the jump to file behavior? This setting should default to true, but this would give users the ability to opt out. |
@kenzieschmoll yep, we can do that. Although I wonder if it may be better controlling from DevTools (eg. don't send a navigate event)? That way it would apply to both editors rather than them have their own settings? |
I think the navigate event is sent from the Flutter framework, and not DevTools. @CoderDake correct me if I am wrong. |
I think you're right, although perhaps it could be toggled in a similar way to toggling inspect mode / debug painting etc.? It's probably much more work (which might be an argument for doing it in VS Code) but I think it would be more visible there. Most users probably haven't scanned all of the settings in VS Code, but having some tickbox/toggle in the inspector for "Navigate IDE on select" would be much more discoverable (and isn't VS Code-specific). WDYT? It's trivial to do only in VS Code and I'm happy to do that if you think it makes most sense. @osaxma I'm also interested in this:
Could you elaborate on this (or file a Dart-Code issue)? If the real issue here isn't the navigation of that it's doing something bad in the editor, we should fix that. IIRC it was supposed to always navigate in an existing editor pane and not open or move any, but since the layouts have become much more flexible since it was added it's possible it's not doing this very well. |
I think opening the file will have to reorder the panes anyway so the file can fit in. But if my intention is not to open the file, then it's inconvenience since I've close the file every time I chose a widget to be shown in the layout explorer. Screen.Recording.2023-10-23.at.1.22.07.PM.movIn the video above, all files were closed before the recording and the Widget Inspector was the only open tab (I do this to have enough space). |
Ah, I see. I wonder if we should never navigate to code if there is no code editor visible? Eg. if you're already running the inspector side-by-side then it'll navigate in the other code window, but if you're using it full-screen we don't open it (or if possible, we open it as a background tab so you can easily switch to it). @osaxma @kenzieschmoll thoughts? |
+1 for opening the file in the background (as a new temp tab) if there's no code editor open. |
I should've looked for an API for this before suggesting it - unfortunately it doesn't seem like it's possible (except for showing then immediately switching back, but I suspect that'll look janky). |
I believe that the app itself currently sends the event, but we have the ability the move that behaviour into DevTools with the new custom Stream behaviour. |
There was a similar request from an IntelliJ user here: flutter/flutter-intellij#6875 (comment) I do think having it as a toggle in DevTools might be more discoverable (as well as only need a single implementation) |
Changing this in DevTools would also require changing package:flutter as current package:flutter dispatches events when inspector selection change that would need to be handled differently depending on this setting. In general I think that is a useful change. The way this is usually surfaced is by a button indicating whether state should be synced. The default should remain syncing the state of the selected widget with the code location but we need to support the alternate option of unsyncing the state. Keep in mind that syncing the source location with the IDE is the single most popular feature in the inspector so we will also need to take care that users don't accidentally disable it and then not understand what went wrong. |
any news here? |
In VS Code, when I am only interested in viewing the widget in the Layout Explorer, opening the file takes a lot of space + it moves all panes in undesirable way.
It'd be nice to have a way to disable the
file opener
or have a separate action to open the file (right click menu or cmd+click combination).The text was updated successfully, but these errors were encountered: