Skip to content

Conversation

@elliette
Copy link
Member

@elliette elliette commented Mar 18, 2025

Work towards #9028, #1948

Implements the first step described in this comment: #9028 (comment)

Periodically check that we can send a request to DTD, and if not force the IFRAME to reload

Follow-up after this is to add an isClosed getter to package:dtd so that instead we can check whether DTD is closed instead of sending it an empty request. Want to do that in a separate PR however in case we decide we should cherry-pick this into the current Flutter beta (and therefore we don't need to coordinate a DTD cherrypick at the same time.)

property_Editor_reconnection

@elliette elliette changed the title [Draft] [Property Editor] Show reconnection overlay when disconnection detected [Property Editor] Show reconnection overlay when disconnection detected Mar 18, 2025
@elliette elliette marked this pull request as ready for review March 18, 2025 18:13
@elliette elliette requested a review from a team as a code owner March 18, 2025 18:13
@elliette elliette requested review from kenzieschmoll and removed request for a team March 18, 2025 18:13

static const _editableArgsDebounceDuration = Duration(milliseconds: 600);

static const _checkConnectionInterval = Duration(seconds: 5);
Copy link
Member

Choose a reason for hiding this comment

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

do we need to check this frequently?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm it looks like no! It seems like the timer starts immediately after the tab is re-awoken, so even setting this to 1 minute means the overlay is displayed immediately after returning from sleep.

return Timer.periodic(interval, (timer) async {
final isClosed = await editorClient.isClientClosed();
if (isClosed) {
_shouldReconnect.value = true;
Copy link
Member

Choose a reason for hiding this comment

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

does this value ever get set back to false?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, but because the IFRAME is then re-loaded the whole Property Editor is re-initialized again (with the default value false). I could reset to false though I don't know if it would ever actually be called.

Widget build(BuildContext context) {
final theme = Theme.of(context);
return Container(
color: theme.colorScheme.surface.withValues(alpha: 0.5),
Copy link
Member

Choose a reason for hiding this comment

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

use theme.colorScheme.semiTransparentOverlayColor. In fact, bonus points for pulling the overlay message out of timeline_events_view.dart into a shared widget to use here and in timeline_events_view.dart.

https://github.com/flutter/devtools/blob/master/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/timeline_events_view.dart/#L90

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, pulled this into shared widget

Copy link
Member Author

Choose a reason for hiding this comment

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

FYI here is what the Timeline events overlay now looks like (should be the same as before)

timeline_Events

@elliette elliette merged commit 0be2e1f into flutter:master Mar 20, 2025
41 of 42 checks passed
elliette added a commit to elliette/devtools that referenced this pull request Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants