Skip to content

Conversation

@kaustubh-nair
Copy link
Member

@kaustubh-nair kaustubh-nair commented May 20, 2020

These commits are not perfectly isolated, because there are a lot of things to be done here:

  • Show LoadingView first and run Model and View initialization asynchronously.
  • Move settings from run.py to LoadingView
  • Move spinning cursor from Controller to LoadingView

@zulipbot zulipbot added the size: L [Automatic label added by zulipbot] label May 20, 2020
@kaustubh-nair kaustubh-nair marked this pull request as draft May 20, 2020 09:33
@kaustubh-nair kaustubh-nair changed the title Show loading screen in urwid. WIP: Show loading screen in urwid. May 20, 2020
@kaustubh-nair
Copy link
Member Author

Making a new PR for this.
I'll keep the current tutorial PR #583 only for tutorial related enhancements.

Adding tests.

@zulipbot zulipbot added size: XL [Automatic label added by zulipbot] and removed size: L [Automatic label added by zulipbot] labels Jun 2, 2020
@kaustubh-nair kaustubh-nair changed the title WIP: Show loading screen in urwid. Show loading screen in urwid. Jun 2, 2020
@kaustubh-nair kaustubh-nair marked this pull request as ready for review June 2, 2020 14:23
@sumanthvrao sumanthvrao added feedback wanted PR needs review PR requires feedback to proceed and removed feedback wanted labels Jun 5, 2020
@sumanthvrao
Copy link
Member

sumanthvrao commented Jun 9, 2020

@kaustubh-nair I tried this out manually and it looks great! 👌

@neiljp neiljp removed the PR needs review PR requires feedback to proceed label Jun 9, 2020
@neiljp
Copy link
Collaborator

neiljp commented Jun 9, 2020

@kaustubh-nair I replied on the stream about this - functionally this does what we want, but the structure is a little confusing and smaller commits may help explain which changes you're making and why. It's great that you're picking up others' older PRs and moving them forward, but it can be challenging precisely since they're not your code

Some aspects to consider:

  • what (current) aspects of the model and view can be started in parallel or not?
  • we have various cases in the code where we check whether the view is set up (hasattr); if we can ensure the ordering in the initial setup then can we remove these?
  • while Controller() and its .main(...) are run consecutively, if we change the order we should understand/explain why
  • when commits simply "move" code around, make sure that the code hasn't been adjusted by other commits between this - this is particularly true with rebasing older PRs!

@kaustubh-nair kaustubh-nair force-pushed the loading_view branch 2 times, most recently from 38b0209 to 3a5ce6a Compare June 13, 2020 15:47
@kaustubh-nair kaustubh-nair added the PR needs review PR requires feedback to proceed label Jun 15, 2020
This is done so that it can be later run asynchronously by
introducing an intermediate view for loading.
Display LoadingView during startup. This blocks the settings shown in
stdout while loading which will be added in the subsequent commits.
Stop showing loading settings for theme and autohide  to stdout and use
the LoadingView instead. Note that in case of invalid settings,
output would still be displayed to stdout.

Tests amended.
Copy link
Member

@sumanthvrao sumanthvrao left a comment

Choose a reason for hiding this comment

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

@kaustubh-nair Thanks for rebasing 👍 .

Additionally, I think this may avoid the UI distort race issue which we have seen in the past. I left a couple of commits but looks good overall.

for cursor in '|/-\\':
yield cursor

self.capture_stdout()
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 capture stdout here again? We already do this now in the previous commit in the __init__ stage itself.


def set_spinner(self, spinner: str) -> None:
self.base_widget.set_text(self.text + [spinner])
self.body.base_widget.set_text(self.text + [spinner])
Copy link
Member

Choose a reason for hiding this comment

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

Is this something necessary for this commit? Couldn't we move this to the previous commit where you introduce the set_spinner class?

@neiljp neiljp added this to the Next Release milestone Aug 16, 2020
def deregister_client(self) -> None:
queue_id = self.model.queue_id
self.client.deregister(queue_id, 1.0)
# Deregister before model has loaded.
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary in this commit?

@neiljp neiljp removed this from the Next Release milestone Jan 22, 2021
@neiljp neiljp added this to the Release after next milestone Jan 22, 2021
Base automatically changed from master to main January 30, 2021 20:30
@zulipbot
Copy link
Member

Heads up @kaustubh-nair, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has conflicts PR needs review PR requires feedback to proceed size: XL [Automatic label added by zulipbot]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants