Skip to content

Conversation

@alexvanyo
Copy link
Contributor

@alexvanyo alexvanyo commented Aug 25, 2021

Adds an initial list-detail support for the main page.

The overall approach relies on distinguishing between what the user sees as different screens, and what we implement as different navigation routes.

Navigation-wise, the "home" route is responsible for drawing the list detail screen, as well as the list screen and detail screen on their own (for small devices). Distinguishing between which one to show is now simply a matter of keeping track of whether the user is looking at the list, or a selected article.

Doing so allows meeting a couple of nice behaviors:

  • We keep track of the user's state (scroll state on the list/detail, as well as which one they were looking at), even while changing which side we are looking at
  • We avoid navigating as a side-effect of a size change
  • We can make size changes reversible (mostly as a consequence of the previous point)
List: Detail: List and Detail:
device-2021-09-02-164232 device-2021-09-02-164126 device-2021-09-02-164044
@google-cla google-cla bot added the cla: yes label Aug 25, 2021
Base automatically changed from mv/jetnews_vm to main August 27, 2021 07:27
@manuelvicnt manuelvicnt changed the base branch from main to ls August 27, 2021 08:12
@alexvanyo alexvanyo force-pushed the av/jetnews-large-screens branch 3 times, most recently from 7f688ff to d671872 Compare August 30, 2021 20:35
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Aug 30, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@alexvanyo alexvanyo force-pushed the av/jetnews-large-screens branch 4 times, most recently from 40cb601 to 7ce5d37 Compare August 30, 2021 21:22
@alexvanyo alexvanyo requested a review from manuelvicnt August 30, 2021 21:29
Copy link
Contributor

@manuelvicnt manuelvicnt left a comment

Choose a reason for hiding this comment

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

Left some initial comments, some of them are due to the lack of familiarity with the navigation flow you have in mind. We should try to work on simplifying it as the implementation detail looks tedious. Ideally, someone without the flow chart should be able to follow along easily.

@alexvanyo alexvanyo force-pushed the av/jetnews-large-screens branch from 242d982 to b2cf96b Compare August 31, 2021 23:26
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Aug 31, 2021

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@alexvanyo
Copy link
Contributor Author

@manuelvicnt I just pushed up another commit, which makes quite a few changes.

Most notably, I've removed the article route entirely (for now), so articles are now only displayed from the home route.

I also created a HomeRoute @Composable, which is the primary component responsible for determining which HomeScreen to display (based on the size of the screen, and the available state).

@alexvanyo alexvanyo requested a review from manuelvicnt August 31, 2021 23:31
@alexvanyo alexvanyo force-pushed the av/jetnews-large-screens branch from b2cf96b to c0c5c03 Compare September 1, 2021 17:41
@alexvanyo alexvanyo changed the base branch from ls to mv/navrail September 1, 2021 17:42
@google-cla
Copy link

google-cla bot commented Sep 1, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Sep 1, 2021
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Sep 1, 2021
@google-cla
Copy link

google-cla bot commented Sep 1, 2021

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@alexvanyo
Copy link
Contributor Author

@manuelvicnt This is ready for another look! I've fully rebased on to the navrail PR, and have fixed up a couple things related to that rebase.

I also got to all of the comments you left, and added quite a bit of extra inline documentation around the approach.

Copy link
Contributor

@manuelvicnt manuelvicnt left a comment

Choose a reason for hiding this comment

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

Two nits but LGTM overall. Thank you!

@manuelvicnt
Copy link
Contributor

Also @alexvanyo, can you add screenshots to the description of the PR for reviewers to get a sense of what's been implemented? At some point, we'll also have those mocks in the README. Thanks!

@JolandaVerhoef
Copy link
Collaborator

JolandaVerhoef commented Sep 2, 2021

Is there a reason that you included the migration from List<Post> to PostsFeed in this PR? It's making it difficult to follow the changes related to that migration vs the actual changes made for the large screen support.

Base automatically changed from mv/navrail to ls September 2, 2021 14:22
@alexvanyo alexvanyo force-pushed the av/jetnews-large-screens branch from b72caae to 1df7d7f Compare September 2, 2021 20:43
@alexvanyo alexvanyo marked this pull request as ready for review September 2, 2021 21:13
@alexvanyo
Copy link
Contributor Author

@JolandaVerhoef Ah I apologize, that ended up being a refactor that happened partway through while cleaning everything up. Ideally that should have been pulled out into a separate PR that didn't touch the UI at all.

That ended up being changed to more nicely support having the topmost article selected by default. Previously, the post list was expecting a hardcoded list that was pulled apart into different sections, so the 4th post was arbitrarily chosen to be the "highlighted item." With the refactor to PostsFeed, those sections are now specified by the data object, so we can nicely choose the "highlighted item" to be selected by default.

@alexvanyo alexvanyo merged commit 6b5de29 into ls Sep 3, 2021
@alexvanyo alexvanyo deleted the av/jetnews-large-screens branch September 3, 2021 14:38
@alexvanyo
Copy link
Contributor Author

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

Labels

5 participants