Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into logretention-model2
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderDake committed Jun 19, 2024
2 parents 0ae68c0 + efd04c1 commit a906c4a
Show file tree
Hide file tree
Showing 51 changed files with 810 additions and 133 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ If you need help, consider asking for help on [Discord].

<!-- Links -->
[Contributor Guide]: https://github.com/flutter/devtools/blob/master/CONTRIBUTING.md
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
[build.yaml badge]: https://github.com/flutter/devtools/actions/workflows/build.yaml/badge.svg
5 changes: 4 additions & 1 deletion .github/workflows/flutter-prep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:

- name: Get Latest Flutter Candidate
id: flutter-candidate
# TODO(https://github.com/flutter/devtools/issues/7939): Switch back to using
# LATEST_FLUTTER_CANDIDATE=$(./tool/latest_flutter_candidate.sh)
# once Flutter rolls are tagged again:
run: |
LATEST_FLUTTER_CANDIDATE=$(./tool/latest_flutter_candidate.sh)
LATEST_FLUTTER_CANDIDATE=1c77696615558bf8f9fa7a6e2a473f438f1c03ca
echo "FLUTTER_CANDIDATE=$LATEST_FLUTTER_CANDIDATE" >> $GITHUB_OUTPUT
- name: Load Cached Flutter SDK
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

![GitHub contributors](https://img.shields.io/github/contributors/flutter/devtools.svg)

_tl;dr: join [Discord](https://github.com/flutter/flutter/wiki/Chat), be
_tl;dr: join [Discord](https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md), be
[courteous](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md), follow the steps below
to set up a development environment; if you stick around and contribute, you can
[join the team](https://github.com/flutter/flutter/wiki/Contributor-access) and get commit access._
[join the team](https://github.com/flutter/flutter/blob/master/docs/contributing/Contributor-access.md) and get commit access._

> If you are here because you just want to test the bleeding-edge (unreleased) DevTools functionality,
follow our [beta testing guidance](https://github.com/flutter/devtools/blob/master/BETA_TESTING.md).
Expand All @@ -17,7 +17,7 @@ We gladly accept contributions via GitHub pull requests! We encourage you to rea
framework's contributing guide, as all of that information applies to contributing to the `flutter/devtools`
repo as well.

We communicate primarily over GitHub and [Discord](https://github.com/flutter/flutter/wiki/Chat) on the
We communicate primarily over GitHub and [Discord](https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md) on the
[#hackers-devtools](https://discord.com/channels/608014603317936148/1106667330093723668) channel.

Before contributing code:
Expand Down
8 changes: 4 additions & 4 deletions STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We fully follow [Effective Dart](https://dart.dev/guides/language/effective-dart)
and some items of
[Style guide for Flutter repo](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo):
[Style guide for Flutter repo](https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md):

## Order of getters and setters

Expand All @@ -11,19 +11,19 @@ more complicated than just public field
we declare the related class members always in the same order,
without new lines separating the members,
in compliance with
[Flutter repo style guide]( https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#order-other-class-members-in-a-way-that-makes-sense):
[Flutter repo style guide](https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#order-other-class-members-in-a-way-that-makes-sense):

1. Public getter
2. Private field
3. Public setter (when needed)

## Naming for typedefs and function variables

Follow [Flutter repo naming rules for typedefs and function variables](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#naming-rules-for-typedefs-and-function-variables).
Follow [Flutter repo naming rules for typedefs and function variables](https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#naming-rules-for-typedefs-and-function-variables).

## Overriding equality

Use [boilerplate](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#common-boilerplates-for-operator--and-hashcode).
Use [boilerplate](https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#common-boilerplates-for-operator--and-hashcode).

## URIs and File Paths

Expand Down
32 changes: 32 additions & 0 deletions TRIAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Triage

## The Process

If you are the devtools triage rotation on-call, you are expected to triage issues that appeared/updated during the week (it is ok to triage all of them at the end of the week).

You are also expected to monitor the DevTools discord [channel](https://discord.com/channels/608014603317936148/958862085297672282) for user questions / concerns.

## DevTools Issues

Queue: https://github.com/flutter/devtools/issues?q=is%3Aopen+is%3Aissue+-label%3AP0%2CP1%2CP2%2CP3%2CP4%2CP5%2CP6

For each new issue that comes in, perform all of these tasks that apply:

### Label/project the issue:
* Add labels for its proper category or categories ( “Inspector page”, “debugger page”, “bug”, etc.)
* Add label “waiting for customer response” if you requested more details from reporter
* Add label “fix it friday” if the issue should be fixed and looks easy to fix
* Add to project [go/dart-devtools-ux-issues](https://github.com/orgs/flutter/projects/54/settings) if the issue is cross-screen issue

### Prioritize the issue.

Follow the prioritization rubric [here](https://github.com/flutter/flutter/blob/master/docs/contributing/issue_hygiene/README.md#priorities).

Tag the area owner in a comment if the issue requires specific expertise. Assign to an owner if the issue is a work in process or if the issue needs immediate / almost-immediate attention (P0, P1).

## Related Flutter Issues

flutter/flutter issues relating to DevTools:
https://github.com/flutter/flutter/issues?q=is%3Aopen+label%3A%22d%3A+devtools%22+++no%3Amilestone+

Ping the [hackers-devtools](https://discord.com/channels/608014603317936148/1106667330093723668) discord channel about issues marked “severe: …” or “P0”.
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Home

This wiki is primarily aimed at engineers building or making contributions to DevTools.

If you're looking to make a one-off contribution, please start with the [contributing guide](../CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion packages/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ linter:
- prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # not yet tested
- prefer_contains
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#consider-using--for-short-functions-and-methods
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

// Do not delete these arguments. They are parsed by test runner.
// test-argument:appPath="test/test_infra/fixtures/memory_app"
// test-argument:experimentsOn=true

// ignore_for_file: avoid_print

Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/lib/devtools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
// the constant declaration `const version =`.
// If you change the declaration you must also modify the regex in
// tools/update_version.dart.
const version = '2.37.0-dev.6';
const version = '2.37.0-dev.7';
5 changes: 3 additions & 2 deletions packages/devtools_app/lib/src/framework/about_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,16 @@ class _ContributingLink extends StatelessWidget {
class _DiscordLink extends StatelessWidget {
const _DiscordLink();

static const _discordWikiUrl = 'https://github.com/flutter/flutter/wiki/Chat';
static const _discordDocsUrl =
'https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md';

@override
Widget build(BuildContext context) {
return RichText(
text: GaLinkTextSpan(
link: const GaLink(
display: 'Discord',
url: _discordWikiUrl,
url: _discordDocsUrl,
gaScreenName: gac.devToolsMain,
gaSelectedItemDescription: gac.discordLink,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class InspectorController extends DisposableController
final group = treeGroups.next;
final node = await (detailsSubtree
? group.getDetailsSubtree(subtreeRoot, subtreeDepth: subtreeDepth)
: group.getRoot(treeType));
: group.getRoot(treeType, isSummaryTree: true));
if (node == null || group.disposed || _disposed) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class InspectorController extends DisposableController
final group = treeGroups.next;
final node = await (detailsSubtree
? group.getDetailsSubtree(subtreeRoot, subtreeDepth: subtreeDepth)
: group.getRoot(treeType));
: group.getRoot(treeType, isSummaryTree: false));
if (node == null || group.disposed || _disposed) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,7 @@ class InspectorRowContent extends StatelessWidget {
isSelected: row.isSelected,
searchValue: searchValue,
errorText: error?.errorMessage,
emphasizeNodesFromLocalProject: true,
nodeDescriptionHighlightStyle:
searchValue.isEmpty || !row.isSearchMatch
? DiagnosticsTextStyles.regular(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ abstract class EditorClient {
String? debugSessionId, {
String? page,
bool? forceExternal,
bool? requiresDebugSession,
});

/// Requests the editor enables a new platform (for example by running
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class DiagnosticsNodeDescription extends StatelessWidget {
this.multiline = false,
this.style,
this.nodeDescriptionHighlightStyle,
this.emphasizeNodesFromLocalProject = false,
});

final RemoteDiagnosticsNode? diagnostic;
Expand All @@ -51,6 +52,10 @@ class DiagnosticsNodeDescription extends StatelessWidget {
final bool multiline;
final TextStyle? style;
final TextStyle? nodeDescriptionHighlightStyle;
// TODO(https://github.com/flutter/devtools/issues/7860): Remove and default
// to true when turning on inspector V2. This is currently true for the V2
// inspector and false for the legacy inspector.
final bool emphasizeNodesFromLocalProject;

static Widget _paddedIcon(Widget icon) {
return Padding(
Expand Down Expand Up @@ -264,7 +269,6 @@ class DiagnosticsNodeDescription extends StatelessWidget {
colorScheme,
),
);
var descriptionTextStyle = textStyle;
// TODO(jacobr): use TextSpans and SelectableText instead of Text.
if (diagnosticLocal.isProperty) {
// Display of inline properties.
Expand All @@ -280,8 +284,7 @@ class DiagnosticsNodeDescription extends StatelessWidget {
);
// provide some contrast between the name and description if both are
// present.
descriptionTextStyle =
descriptionTextStyle.merge(theme.subtleTextStyle);
textStyle = textStyle.merge(theme.subtleTextStyle);
}

if (diagnosticLocal.isCreatedByLocalProject) {
Expand Down Expand Up @@ -332,7 +335,7 @@ class DiagnosticsNodeDescription extends StatelessWidget {
Flexible(
child: buildDescription(
description: description,
textStyle: descriptionTextStyle,
textStyle: textStyle,
colorScheme: colorScheme,
diagnostic: diagnostic,
searchValue: searchValue,
Expand Down Expand Up @@ -382,14 +385,25 @@ class DiagnosticsNodeDescription extends StatelessWidget {
}
}

if (!diagnosticLocal.isSummaryTree &&
// TODO(https://github.com/flutter/devtools/issues/7860): Remove this
// if-block once the widget details tree is gone. This bolding is only
// used there.
if (!emphasizeNodesFromLocalProject &&
!diagnosticLocal.isSummaryTree &&
diagnosticLocal.isCreatedByLocalProject) {
textStyle = textStyle.merge(DiagnosticsTextStyles.regularBold);
}

// Grey out nodes that were not created by the local project to emphasize
// those that were:
if (emphasizeNodesFromLocalProject &&
!diagnosticLocal.isCreatedByLocalProject) {
textStyle = textStyle.merge(theme.subtleTextStyle);
}

var diagnosticDescription = buildDescription(
description: diagnosticLocal.description ?? '',
textStyle: descriptionTextStyle,
textStyle: textStyle,
colorScheme: colorScheme,
diagnostic: diagnostic,
searchValue: searchValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -948,21 +948,29 @@ class ObjectGroup extends InspectorObjectGroupBase {
@override
bool canSetSelectionInspector = true;

Future<RemoteDiagnosticsNode?> getRoot(FlutterTreeType type) {
Future<RemoteDiagnosticsNode?> getRoot(
FlutterTreeType type, {
required bool isSummaryTree,
}) {
// There is no excuse to call this method on a disposed group.
assert(!disposed);
switch (type) {
case FlutterTreeType.widget:
return getRootWidget();
return getRootWidgetTree(isSummaryTree: isSummaryTree);
}
}

Future<RemoteDiagnosticsNode?> getRootWidget() {
Future<RemoteDiagnosticsNode?> getRootWidgetTree({
required bool isSummaryTree,
}) {
return parseDiagnosticsNodeDaemon(
invokeServiceMethodDaemonParams(
WidgetInspectorServiceExtensions
.getRootWidgetSummaryTreeWithPreviews.name,
{'groupName': groupName},
WidgetInspectorServiceExtensions.getRootWidgetTree.name,
{
'groupName': groupName,
'isSummaryTree': '$isSummaryTree',
'withPreviews': 'true',
},
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,13 @@ class PostMessageEditorClient implements EditorClient {
String? debugSessionId, {
String? page,
bool? forceExternal,
bool? requiresDebugSession,
}) async {
await _api.openDevToolsPage(
debugSessionId,
page: page,
forceExternal: forceExternal,
requiresDebugSession: requiresDebugSession,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ final class VsCodeApiImpl implements VsCodeApi {
String? debugSessionId, {
String? page,
bool? forceExternal,
bool? requiresDebugSession,
}) {
return sendRequest(
VsCodeApi.jsonOpenDevToolsPageMethod,
{
VsCodeApi.jsonDebugSessionIdParameter: debugSessionId,
VsCodeApi.jsonPageParameter: page,
VsCodeApi.jsonForceExternalParameter: forceExternal,
VsCodeApi.jsonRequiresDebugSessionParameter: requiresDebugSession,
},
);
}
Expand Down Expand Up @@ -212,6 +214,11 @@ class VsCodeCapabilitiesImpl implements VsCodeCapabilities {
bool get openDevToolsExternally =>
_raw?[VsCodeCapabilities.openDevToolsExternallyField] == true;

@override
bool get openDevToolsWithRequiresDebugSessionFlag =>
_raw?[VsCodeCapabilities.openDevToolsWithRequiresDebugSessionFlagField] ==
true;

@override
bool get hotReload => _raw?[VsCodeCapabilities.hotReloadField] == true;

Expand Down
16 changes: 16 additions & 0 deletions packages/devtools_app/lib/src/standalone_ui/api/vs_code_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ abstract interface class VsCodeApi {
///
/// Depending on user settings, this may open embedded (the default) or in an
/// external browser window.
///
/// If [debugSessionId] is `null` the [requiresDebugSession] flag will
/// determine whether the editor will select (or ask the user to select) a
/// debug session for the page. If [requiresDebugSession] is `null` (or if
/// the `openDevToolsWithRequiresDebugSessionFlag` capability is `false`) then
/// the editor will try to make this decision automatically (which may be
/// inaccurate for pages it does not know about, like extensions).
Future<void> openDevToolsPage(
String? debugSessionId, {
String? page,
bool? forceExternal,
bool? requiresDebugSession,
});

/// Sends a Hot Reload request to the debug session with ID [debugSessionId].
Expand Down Expand Up @@ -87,6 +95,7 @@ abstract interface class VsCodeApi {
static const jsonForceExternalParameter = 'forceExternal';
static const jsonDebugSessionIdParameter = 'debugSessionId';
static const jsonPlatformTypeParameter = 'platformType';
static const jsonRequiresDebugSessionParameter = 'requiresDebugSession';
}

/// This class defines a device event sent by the Dart/Flutter extensions in VS
Expand Down Expand Up @@ -153,6 +162,11 @@ abstract interface class VsCodeCapabilities {
/// regardless of user settings.
bool get openDevToolsExternally;

/// Whether the `openDevToolsPage` method can be called with the
/// `requiresDebugSession` flag to indicate whether the editor should select/
/// prompt for a debug session if one was not provided.
bool get openDevToolsWithRequiresDebugSessionFlag;

/// Whether the `hotReload` method is available call to hot reload a specific
/// debug session.
bool get hotReload;
Expand All @@ -164,6 +178,8 @@ abstract interface class VsCodeCapabilities {
static const jsonSelectDeviceField = 'selectDevice';
static const openDevToolsPageField = 'openDevToolsPage';
static const openDevToolsExternallyField = 'openDevToolsExternally';
static const openDevToolsWithRequiresDebugSessionFlagField =
'openDevToolsWithRequiresDebugSessionFlag';
static const hotReloadField = 'hotReload';
static const hotRestartField = 'hotRestart';
}
Loading

0 comments on commit a906c4a

Please sign in to comment.