-
-
Notifications
You must be signed in to change notification settings - Fork 17
Navigation update #358
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
Navigation update #358
Conversation
Add routes for post,user,community,message.
Ensure all modlog links use router.
Ensure all links in context menus use router.
Switch to router in navdrawer, userscreen and explore item.
Switch some routes to use router.
Switch some routes to use router.
Switch some routes to use router.
dart format lib/src/
Add helper for differences in accessing sqlite on web and native. Disable import/export database on web, hopefully temporary.
Add helper function to push appropriate post route depending on post type.
Update gradle so is compatible with flutter_web_auth_2 dependency.
…that share the same tag' error.
|
Should be ready for review now. The linux build is failing because to handle oauth redirects in the browser I added a package which has a dependency on webkit2gtk-4.1 which will need to be added to the workflow script. |
jwr1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I'm sure this migration took a while to work on! Here's my initial review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we try to make some of these routes more consistent with existing frontends? For example, almost every platform uses /u/namehere for users and /c/namehere for communities (except Mbin of course).
I also think there's an issue with the numeric id routes (threads, microblogs, comments), where they are not server agnostic, which would be an issue if you tried to copy-paste a link from one server to another. Some Lemmy frontends solve this by having the server domain in the path. I also think it would be nice to have the community name in the path as well.
Just as a reference, here are a few example links from other frontends:
Voyager:
https://vger.app/posts/lemmy.zip/u/Stamets@lemmy.dbzer0.com
https://vger.app/posts/lemmy.zip/c/whitepeopletwitter@sh.itjust.works/comments/57940056
Blorp:
https://blorpblorp.xyz/home/c/technology@lemmy.world/posts/https%3A%2F%2Flemmy.world%2Fpost%2F42282750
(blorp interestingly uses the AP-id in the URL)
Alexandrite:
https://a.lemmy.world/lemmy.world/post/42382934
I realize these would probably be some pretty big changes though, so we could definitely save it for a different PR, especially considering this one is already huge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it would be good to be consistent with the other frontends. I think blorp's way of using the apid is probably the best from a compatibility with different servers standpoint. Especially for sharing links. But we would have to support fetching via the apid rather than server specific id, so maybe down the road.
Should we do something like
https://interstellar.com/${instance}/u/${user_name}
https://interstellar.com/${instance}/c/${community_name}/thread/${postId}
https://interstellar.com/${instance}/c/${community_name}/microblog/${postId}
I also want to add routes for the different feed filters. e.g. /all, /subscribed, /moderated etc.
So yeah this PR should be for getting it working and then in another PR we can make sure the routes are consistent and comprehensive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think it would be nice to support a "default" instance, in case Interstellar is set up as an alternative frontend. For example, if I set up Interstellar running at i.kbin.earth, it would be nice if I could set kbin.earth to be the default server, and the URL path not include the domain if you are signed into kbin.earth. I think the path would look cleaner this way, and I could see this being useful if you want to view a link on the alternative frontend, just by changing the domain in your browser. So you might be able to do the following:
https://kbin.earth/u/jwr1 -> https://i.kbin.earth/u/jwr1
https://kbin.earth/m/steamdeck@sopuli.xyz/t/2360294/ -> https://i.kbin.earth/m/steamdeck@sopuli.xyz/t/2360294/ -> https://i.kbin.earth/c/steamdeck@sopuli.xyz/thread/2360294/ (we could set up a redirect in the router to make this once work.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be neat. Like being able to switch between old.reddit.com and reddit.com without changing the rest of the url.
Update redirect uri to be more general. Remove unneeded comment in main. Update .gitignore to ignore generated route files.
It looks like that dependency is required to create a web view on Linux, which we don't need. I'm assuming we will still have to include |
|
Can you try signing in again? I just removed our custom HTTP server, and it was working fine on my device (Linux). Are you using Linux or Windows? |
|
Can confirm it works for me on linux. |
# Conflicts: # lib/src/screens/settings/debug/debug_screen.dart # lib/src/widgets/content_item/content_info.dart # lib/src/widgets/content_item/content_item.dart # lib/src/widgets/tags/tag_screen.dart # pubspec.lock # pubspec.yaml
|
Unfortuently, due to the oauth callback url being different on Android, iOS, and macOS, users will need to sign out and back in to all their Mbin accounts again. I haven't tested, but I think we could still use localhost for iOS and macOS, but I did try using it with Android to no luck. Should we test if localhost would work for iOS and macOS, and change it back if so? |
|
Getting people to sign out and back in again will be a hassle. Would it be viable to add a migration which sets the |
I hadn't thought about that, but if you think you could make it work, it definitely sounds better than making users remove all of their accounts and log back in one by one. Actually, now that you mention it, it's not a bad idea to have a system like that in place for future similar occurrences as well, such as OAuth scope changes. I'll go ahead and get this merged though. |
I believe I've switched all the navigation across to using auto_route now. Next step is to make sure all the paths make sense and that path parameters match up.
I've also started on making sure it works on web. Two biggest issues so far seem to be with file io and checking the platform. Apparently
Platform.isAndroid,Platform.isLinuxetc don't work on web so I've had to add some util functions that check if it is web before checking the platform. Haven't switched out all the platform checks yet so some pages might throw errors but the main feed should show up on web now.It looks like a really big diff but most (~13K) of the added lines come from adding a file for drift to work on web. 'web/drift_worker.dart.js'