Skip to content
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

Debugger: soft wrap console input lines #8855

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

srawlins
Copy link
Contributor

@srawlins srawlins commented Feb 5, 2025

See #5505 for original issue screenshot. Here is another:

Screenshot 2025-02-05 at 2 21 39 PM

Afterwards, we get this nice expanding behavior:

Screenshot 2025-02-05 at 2 20 25 PM Screenshot 2025-02-05 at 2 20 46 PM

The console itself is still expandable:

Screenshot 2025-02-05 at 2 20 55 PM

Fixes #5505

@srawlins srawlins requested a review from a team as a code owner February 5, 2025 22:11
@srawlins srawlins requested review from bkonyi and removed request for a team February 5, 2025 22:11
super.key,
}) : searchFieldHeight = searchFieldHeight ?? defaultTextFieldHeight;
}) : searchFieldHeight = searchFieldHeight ?? defaultTextFieldHeight,
_shouldExpandHeight = shouldExpandHeight;
Copy link
Member

Choose a reason for hiding this comment

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

is there a reason this is a private field? Can shouldExpandHeight just be a public field so that we can use this.shouldExpandHeight = true in the constructor parameter?

Copy link
Member

Choose a reason for hiding this comment

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

Also, should the default value be false to match the code below?

Copy link
Member

Choose a reason for hiding this comment

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

See #8855 (comment) before addressing this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only in order to prefer private fields. https://dart.dev/effective-dart/design#prefer-making-declarations-private

It improves static analysis (like you are told when the field could be final, or is unused). It sends readability signals that the field is not intended to be read or written from outside the library. And the price you pay is that you can't use this. in the constructor parameter.

If there is a style in DevTools that is counter to this Effective Dart guideline, we can document that and prefer public.

@@ -970,7 +980,8 @@ class StatelessSearchField<T extends SearchableDataMixin>
this.suffix,
this.style,
this.searchFieldHeight,
});
bool shouldExpandHeight = false,
}) : _shouldExpandHeight = shouldExpandHeight;
Copy link
Member

Choose a reason for hiding this comment

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

same question here: can we just make this public so that we can use this.shouldExpandHeight = false in the constructor?

Copy link
Member

Choose a reason for hiding this comment

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

see #8855 (comment) before addressing this comment.

@@ -1032,6 +1046,7 @@ class StatelessSearchField<T extends SearchableDataMixin>
focusNode: controller.searchFieldFocusNode,
controller: controller.searchTextFieldController,
style: textStyle,
maxLines: _shouldExpandHeight ? null : 1,
Copy link
Member

Choose a reason for hiding this comment

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

what if instead of having this shouldExpandHeight functionality, we just allow maxLines to be passed through? This would also allow us to constrain the height of the console input to some desired max, like 3 lines for example.

@@ -35,7 +35,8 @@ TODO: Remove this section if there are not any general updates.

## Debugger updates

TODO: Remove this section if there are not any general updates.
* The console in the debugger now soft wraps lines.
Copy link
Member

Choose a reason for hiding this comment

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

Verbiage nit: entries should be phrased in the past tense (e.g. "Added XYZ" instead of "Add XYZ").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Console input too long causes input to be unreadable
2 participants