yaru.dart icon indicating copy to clipboard operation
yaru.dart copied to clipboard

YaruMasterDetailPage: fix navigator flaw

Open Feichtmeier opened this issue 1 year ago • 3 comments

YaruMasterDetailPage navigator design is sadly flawed.

There are two navigators

One in portraitlayout: https://github.com/ubuntu/yaru.dart/blob/f006d8ef14c5e5fea6a09b656d29b287324aaaa5/lib/src/widgets/master_detail/yaru_portrait_layout.dart#L102

And one in LandscapeLayout: https://github.com/ubuntu/yaru.dart/blob/f006d8ef14c5e5fea6a09b656d29b287324aaaa5/lib/src/widgets/master_detail/yaru_landscape_layout.dart#L142

The YaruMasterDetailPage allows passing a key to BOTH of the navs, which does not help at all. Actually it makes things worse. For simpler apps that eventually does not happen or when only landscape layout is used. However a simple scenario in musicpod makes this easy to show:

https://github.com/ubuntu/yaru.dart/assets/15329494/420145cc-c461-445a-9e6d-682d1a607f1b

(recorded from vscode debugging thus screen record flickering... old topic)

@Jupi007 @spydon @d-loose do you have any smart idea how to save this switching between portrait and landscape? Otherwise, also because from a design perspective this switching is actually not very helpful, I would suggest that we either sunset this widget and convert to landscape layout or to create a differnt layout when the window is really small

In the weather app I made an expriment which shows the list of master tiles only in a Drawer in narrow windows, WDYT?

https://github.com/ubuntu/yaru.dart/assets/15329494/0154f78f-7a4e-4070-9f5e-a4f4c25a5074

Feichtmeier avatar May 18 '24 11:05 Feichtmeier

The best is probably to just sunset it and start using a better pattern.

spydon avatar May 18 '24 16:05 spydon

The best is probably to just sunset it and start using a better pattern.

You mean better code pattern, right? Because we will continue to need this UI pattern of Master/Detail

Feichtmeier avatar May 18 '24 20:05 Feichtmeier

The best is probably to just sunset it and start using a better pattern.

You mean better code pattern, right? Because we will continue to need this UI pattern of Master/Detail

Yes, better code pattern :)

spydon avatar May 18 '24 23:05 spydon