Repository navigation
feat: Remember the episode List/Grid view and add it to the series page - #1168
MrRussLuther wants to merge 4 commits into
Conversation
The season page view toggle now persists in client settings instead of resetting to grid. The series page gets the same toggle next to the season picker (row, list, grid), sharing the same setting. Unset keeps the current defaults: grid on seasons, the horizontal row on series.
The series and season pages scroll in a SingleChildScrollView, so the shrink-wrapped list and grid laid out every episode up front and long seasons stalled while switching to List or Grid. Each item now renders a placeholder of the expected height until it comes within 1.5 viewports of the page's scroll view, then builds once and stays built. The horizontal row was already lazy and is unchanged.
PartyDonut
left a comment
There was a problem hiding this comment.
Not entirely sure if this is something we should merge right now. The season details screen is due for a proper re-design.
Any chance we could atleast simplify the deferred_build or use a CustomScrollView for now?
| // Outer and inner card padding, plus the gap between poster and text when side by side. | ||
| final posterWidth = wide ? (constraints.maxWidth - 32 - 16) / 4 : constraints.maxWidth - 32; | ||
| final placeholderHeight = posterWidth / 1.76 + 32 + (wide ? 0 : 120); | ||
| return DeferredBuild( |
There was a problem hiding this comment.
Not a big fan of this. I'm assuming this is to fix this sizing issues with the shrinkWrapped ListView?
Maybe better to fix it by using a CustomScrollView for now?
There was a problem hiding this comment.
It's not a sizing fix. The list and grid are shrink-wrapped inside the scaffold's SingleChildScrollView, so every episode gets laid out and starts loading its image at once. The season page already does that today, but on the series page with "All" selected it's the whole show, and that stalled on long series. DeferredBuild was a way to get lazy building without touching the scaffold.
A CustomScrollView fixes it properly, but only if the episode list becomes a sliver of the page's scroll view. That scroll view lives in DetailScaffold (a SingleChildScrollView wrapping a Stack over the backdrop) and is shared by every detail screen, so it felt like redesign territory rather than something to fold into this PR.
I've dropped DeferredBuild and its test instead. List and Grid on the series page now behave like the season page does today, and the lazy list can come with the redesign. If you'd like the scaffold on slivers before then, happy to do that as its own PR.
Drops DeferredBuild per review. The list and grid go back to the plain shrink-wrapped widgets the season page uses today; a lazy list needs the detail scaffold on slivers, which belongs with the screen redesign. This reverts commit c6518dc.
|
Fair enough on the redesign. I've trimmed the PR to the feature itself: the persisted setting, the shared selector and the series page toggle. The season screen part is a net removal (the inlined segmented button becomes the shared selector), so if the redesign replaces the screen the setting and selector carry over and only the list gets swapped. Merged develop in as well. If you'd rather hold it until the redesign that's fine too, just say and I'll park it. |
Pull Request Description
The season page's List/Grid toggle now persists in client settings instead of resetting to Grid every time a season is opened. The series page gets the same toggle (Row, List, Grid) next to the favorite, played and more buttons, sharing the one setting, so whatever you picked last is what you get on either page.
How it fits together:
EpisodeDetailsViewTypemoves fromepisode_details_list.dartintoclient_settings_model.dartso it can be stored onClientSettingsModelas a nullableepisodeViewType. Null keeps today's behaviour: Grid on the season page, the horizontal row on the series page, so nothing changes until someone picks a view.season_detail_screen.dartis nowEpisodeViewTypeSelector, used by both pages. On the series page it's icon-only with tooltips to keep the action row compact, and it's hidden for d-pad input so the TV layout is untouched.EpisodePostersonly takes aviewTypeand falls through to the existing row when it's null, so the row code path is unchanged.One new l10n key (
row), added at the end ofapp_en.arb. Generated files were regenerated withbuild_runnerand reformatted at 120 columns.Issue Being Fixed
Discussion #1155. The season page's view choice doesn't stick, and the series page has no way to see episodes as a list at all.
Screenshots / Recordings
Same series page, same scroll position, with the new selector next to the heart, played and more buttons. Row (unchanged default):
List:
Grid:
Tested On
Checklist