Skip to content

[Product Quality] Fix copy-to-clipboard behavior in the console #9204

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

elliette
Copy link
Member

@elliette elliette commented May 22, 2025

Fixes #4915
Work towards #8939

Previously, copying an inspected widget from the console would copy null. Now, the name and text preview (if it exists) will be copied.

Also improves what is copied for any instance variables that have a length (maps, lists, sets, etc). The test cases in dart_object_node_test.dart show what is copied in each case.

@elliette elliette requested a review from a team as a code owner May 22, 2025 23:42
@elliette elliette requested review from kenzieschmoll and removed request for a team May 22, 2025 23:42
@elliette elliette marked this pull request as draft May 23, 2025 16:34
@elliette elliette removed the request for review from kenzieschmoll May 23, 2025 16:35
? instanceRef.valueAsString
: instanceRef;
return '$name - $value';
if (instanceRef != null && (name ?? '').isNotEmpty) {
Copy link
Member

Choose a reason for hiding this comment

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

use !name.isNullOrEmpty here instead

// Inspector nodes.
final diagnostic = ref?.diagnostic;
final description = diagnostic?.description;
if (diagnostic != null && description != null) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: the diagnostic != null check is redundant here

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.

Bad copy to clipboard behavior in console
2 participants