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

Implement the log retention setting #7951

Merged
merged 15 commits into from
Jun 25, 2024

Conversation

CoderDake
Copy link
Contributor

@CoderDake CoderDake commented Jun 19, 2024

Implement the log retention setting.
Screenshot 2024-06-20 at 12 56 41 PM

@CoderDake CoderDake requested a review from a team as a code owner June 19, 2024 14:37
@@ -49,9 +51,10 @@ class LoggingTableRow extends StatefulWidget {
// TODO(danchevalier): Improve row2 height by manually flowing metadas into another row
// if theyoverflow.
final row2Height = calculateTextSpanHeight(
TextSpan(text: text, style: metadataStyle),
TextSpan(text: 'short text for now', style: metadataStyle),
Copy link
Member

Choose a reason for hiding this comment

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

remove this hard coded string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Metadata will be handled in a future PR. I'll just leave this for now.

Comment on lines 336 to 338
controller: TextEditingController(
text: newRetentionLimit.toString(),
),
Copy link
Member

Choose a reason for hiding this comment

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

this will get created on each build and never disposed, causing memory leaks. Create the text editing controller in initState and use it here. Also dispose it in dispose.

By doing this, I think we can also drop the newRetentionLimit variable, since you can just lookup the text from the controller textEditingController.text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated, but it doesn't look like it has a dispose function.

Copy link
Member

Choose a reason for hiding this comment

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

It should. Here is an example of another TextEditingController getting disposed: https://github.com/flutter/devtools/blob/master/packages/devtools_app/lib/src/framework/home_screen.dart/#L191

SizedBox(
height: defaultTextFieldHeight,
width: defaultTextFieldNumberWidth,
child: TextField(
Copy link
Member

Choose a reason for hiding this comment

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

looking at the screenshot, the text is not vertically centered in the text box. Can we fix that as part of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2024-06-24 at 1 35 40 PM

To get it closer to vertically centered, I've set it to TextAlignVertical.top
a

Comment on lines +2287 to +2288
_textEditingController = TextEditingController()
..text = widget.notifier.value.toString();
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 text controller need to be updated when the value of widget.notifier changes? for example if widget.notifier changed outside the context of this widget?

Copy link
Member

@kenzieschmoll kenzieschmoll left a comment

Choose a reason for hiding this comment

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

lgtm w/ one question

@CoderDake CoderDake added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 25, 2024
@auto-submit auto-submit bot merged commit 523ffb2 into flutter:master Jun 25, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App release-notes-not-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants