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

Pod logs refactoring #1516

Merged
merged 6 commits into from Nov 26, 2020
Merged

Conversation

aleksfront
Copy link
Contributor

Refactoring log components by spreading PodLogs monolith to logical and presentational ones.

Also fixing founded bugs including:

  • Unclear appearing of jump to bottom button
  • Loading more and more logs when switching tabs
  • Log controls blinking

funbox logs

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
@aleksfront aleksfront added this to the 4.0.0 milestone Nov 25, 2020
@aleksfront aleksfront requested a review from a team November 25, 2020 11:17
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
this.isJumpButtonVisible = false;
}
if (!logs.length) {
this.isLastLineVisible = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This field really sounds like it is computed. Shouldn't it be marked as such?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. This is an observable flag not really different from other ones like isJumpButtonVisible. A computed is used to calculate some value from other observables. isLastLineVisible just holds bool value and doesn't need to be "computed".

src/renderer/components/dock/pod-log-list.tsx Outdated Show resolved Hide resolved
Comment on lines 26 to 28
reaction(() => this.props.tab.id, async () => {
await this.load();
this.scrollToBottom();
await this.reload();
}, { fireImmediately: true }),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Couldn't we just pass this.reload to the reaction directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you elaborate this a bit please?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure. It seems like we have the following snippet. async () => { await this.reload(); }. I wonder if we could instead just have, this.reload if it has been marked with @autobind().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it works as expected. Thanks for review!

@aleksfront aleksfront merged commit 2a96e09 into master Nov 26, 2020
@aleksfront aleksfront deleted the fix/logs-scroll-to-bottom-appearence branch November 26, 2020 11:12
@jakolehm jakolehm mentioned this pull request Nov 26, 2020
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.

None yet

2 participants