-
Notifications
You must be signed in to change notification settings - Fork 352
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
(high priority) two push transitions corrupts tab bar (and presumably 2+) #345
Comments
I was trying to look into this just now, but it's hard to test this because I've run into a couple of problems:
Anyway I'll try to fix this as soon as I can once you help me out with these issues. Thank you. |
thanks - I've put it back to "push" and the issue reproduces for me... not sure what you mean about not having a rendering option? Which part? Everything renders for me - which view? |
I'm also on the develop branch. I just added
but oddly for me that view renders fine without it. Does the issue still not reproduce with the $render added? |
I've fixed it. bba2f91 Also I've started keeping track of these small test cases just so it's easier to test every time there's a change in how tab bars work https://github.com/Jasonette/Jasontests/blob/master/tabs/index.json Feel free to send PRs for future bugs when you encounter problems, but I can also keep updating the repo myself. Anyway it should be fixed now, can you check? |
awesome - just confirmed the fix works great. |
Re-opening because the issue still reproduces with slight variation from previous steps:
Thanks! |
@gliechtenstein any chance you'll have time to take a look at this please? |
This was happening because none of the bottom tab bar items urls were matching the current url. The previous commits had fixed this to a certain extent, but this particular case was an additional layer of edge case that happened when you have multi-level hrefs. It should be fixed now 2cdf9ef |
thanks for taking a look, I'll merge this into my branch and give it a try. There is no tab bar on any of the push transition views, so I'm not sure I understand the explanation. Only top-level views have the tab bar in my app, is this not an ok idea? I could change it so that all views contain the tab bar but I'm not sure that would work because the tab bar url for the currently shown view would be different each time (for each level of push transition) What is the best practices for tab bars? I'll change to whatever you recommend and works best in the app, but my understanding was that they should only be used on the top-level view? |
Your https://kadist-ios.herokuapp.com/kmap_artists_by_letter?letter=A has footer tab bars. And none of the tab bar item URLs match the https://kadist-ios.herokuapp.com/kmap_artists_by_letter?letter=A This is fine, and things like this should just work, which was the point of this entire thread and the fix.
As I mentioned just above, you should be able to use tabs anywhere. That was the whole point of this fix, so no need to use it in just top-level views. Hopefully it works! |
ok great, thanks, merging now, well, installing the multigigabyte update to xcode first. Finger's crosses xcode still works. |
I just merged the code and unfortunately it doesn't fix the problem except for the single case where upon returning to the top-level-view I click the left most tab. If I click any other then the tabs are "confused", (mixed up, clicking one for News, opens, for example, Artists tab) If I read you properly if I remove the tab bar from the first level on the artist's tab then it should work right, as a workaround? I'm releasing this app soon so if there's a fix then I'll hold off, otherwise if the best solution is to remove the first level tab in the artist's tab then I can do that. Just to be clear, steps to reproduce:
I think from looking at your code you have to maintain a stack rather than a flag, the visible tab when moving to an untabbed view should push the previous tab's url onto a stack so that as the transitions unwind the correct view is rendered. |
Please try the latest fix c95f275 - There can be many different solutions but i've been trying to fix this while making least amount of change so as to minimize unknown factors, but historically tab bars has been really tricky. I tried multiple different scenarios and confirmed they're working but there could be some case I overlooked, so feel free to share if there's another issue. |
I made sure that for every push transition I replaced that tab's url with the current one (which was easier than I thought) and the tabs still get messed up after only a few clicks. By messed up I mean click "news" and get "artists" or some other tab (in this example, I've seen others playing with it for a few minutes) I'll leave it like this then back out the tabs-on-every-view on Sunday (so it works again) in case you want to look at it before then. Here's one of many sequences that reproduces the issue:
at this point the "news" tab shows the "artists" view Since I've taken a lot of your time with this if you prefer not to do more on this (due to the risk of destabalizing other things) then just say and I'll only put my tabs on the top level views. Aside: the work to replace the tab's url with the push transition's url was pretty easy with flask, but it would be possible to do this internally to Jasonette. It's definitely easier for Jasonette to be stateless and it's not that hard for users to do it but it would certainly be nice to have an option in transition like "keep_footer": "true" to auto inject the footer of the parent markup for all depth levels. |
OK let's try this one more time. Try the latest The stateless tabbar thing has given me too much headache and it sure is tempting to drop the policy (the majority of the buggy behaviors on Jasonette have something to do with this), but that kind of feels like selling the soul to the devil so I'll try to get this right as much as I can. |
This is worse - now the tabs lose their push state, if for news tab I move to level 1 (from 0) then switch tabs to artists and then back I’ve lost the chevron to go back in the news tab to level 0. This happens for all tabs so the app becomes unusable because you can never get back to level 0 pretty quickly.
I reverted this change in my branch and will remove the tab bar from any where other than level 0.
I think that for apps using tabs there should be a top level app.json that defines the tabs so the views aren't stateless, the tabs then wouldn’t need to be defined in any of the child view levels, they would be managed at the app level. Not sure how this would work in your code but that seems like a better design. Tabs really live outside of any view. Each view belongs to a tab and all child views inherit from that tab. I don’t know iOS coding so maybe this isn’t how they work. It seems like the idea of jasonette understanding an app holistically as opposed to a set of stateless independent views might be quite challenging to change. However, I think that would be worthwhile because there are quite a few other things that are really app properties (that belong in json) but not associated with any particular view. Style classes for example would be another use for an app.json, global data is another. This though would break everyone’s apps currently. Not sure what the roadmap looks like, if you’re already planning other v2 breaking changes then might be something to consider.
… On Jun 9, 2018, at 6:11 AM, gliechtenstein ***@***.***> wrote:
OK let's try this one more time. Try the latest develop. If it fails again I think it's best to just go with tab bar on level0 only for now. At least it's much better than the previous state where the only way to use tab bars was to have the current view's URL always match the tab you're in.
The stateless tabbar thing has given me too much headache and it sure is tempting to drop the policy (the majority of the buggy behaviors on Jasonette have something to do with this), but that kind of feels like selling the soul to the devil so I'll try to get this right as much as I can.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
After returning from a push transition, the footer tab bar operation is corrupted, switch to first tab no longer works. I verified that the tab bar urls are correct in the markup.
reproducible sequence:
@gliechtenstein - one of my users showed me their iPhone X that did not exhibit this behavior. I wasn't able to tell if she had the latest code base but thought that this might help determine the cause (recent change in the code, or timing related)
It seems to assume that the push always happens from the first (left most) tab and restores the current view (on push view's close) to the left most tab, but that's not the tab that initiated the push. The same behaviour can be reproduced in other tabs/parts of the application too. I marked this high priority because it affects users and can't be fixed by simply pulling to refresh (because that refreshes the wrong view)
(@gliechtenstein as a temporary workaround while this is pending - switching from push to modal prevents the issue - possibly that's also useful info)
The text was updated successfully, but these errors were encountered: