Skip to content
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

Tabbed screen #71

Closed
wants to merge 27 commits into from
Closed

Tabbed screen #71

wants to merge 27 commits into from

Conversation

ohitsdaniel
Copy link
Contributor

@ohitsdaniel ohitsdaniel commented May 12, 2021

Helps with #19.

Problem

To enable Tab bar supports, we need to refactor all Navigation path mutations.

  • path

  • lastOccurenceOf(screen) -> ScreenID

  • goTo(id:)

  • goTo(screen:)

  • go(to newPath: [AnyScreen], on: id)

  • go(to newPath: [AnyScreen], on: id)

  • goBack(to: id)

  • goBack(to: screen)

  • replacePath

  • dismiss(id)

  • dismiss(screen)

  • dismissSuccessorOf(id)

  • dismissSuccessorOf(screen)

  • replaceContent(of: id)

  • replaceContent(of: screen)

  • setActive(id)

  • setActive(screen)

  • didAppear(id)

  • View layer for native tab bar

  • initialiseDefaultContents(for screenID:, contents)

  • check onDismiss and see if adjustments are needed

  • add tab bar to example app, write UI tests

  • pushing content onto the tab view

Solution

Do it. And write tests for it, to make sure nothing breaks. 🚀

@krzysztofzablocki
Copy link

@ohitsdaniel any updates, maybe you need help with something?

@ohitsdaniel
Copy link
Contributor Author

@krzysztofzablocki I had some time off and tried not to look at code last week. Getting back to this today (just opened up my laptop). Feel free to pick up any of the path mutations and PR into this branch from your fork. Just leave a comment in this PR so that I know what you're working on.

I will implement lastOccurenceOf now, as it opens up the door for screen-based navigation. :)

@krzysztofzablocki
Copy link

I'm wrapping my sprint work today and will chat with my team so that I can spend some time and try helping out tomorrow

@ohitsdaniel
Copy link
Contributor Author

Cool, thanks in advance!

@ohitsdaniel
Copy link
Contributor Author

Implemented lastOccurrence(of:) and the screen-based navigation (which for now still calls through to the old linear path mutations. But once we implemented those, they will be ready to go as well.

As I'm still off work and want some time to do code-unrelated activities, I will pick up some more path mutations tomorrow. :)

FYI: Replace path will be the hardest one as we need to define how to replace a tree given a linear path. Would recommend goTo(path:, on:) or goBack(to:) as 'beginner friendly mutations'.

@ohitsdaniel
Copy link
Contributor Author

Picking up dismiss and dismissSuccessor.

@ohitsdaniel
Copy link
Contributor Author

Both dismisses done, next up tomorrow: go(to newPath: [AnyScreen], on: ScreenID), then goBack(to: ScreenID), replaceContent and ultimately the goliath, replacePath.

@ohitsdaniel
Copy link
Contributor Author

goBack was easy, as it was a duplicate of dismissSuccessor. 🙈

@ohitsdaniel
Copy link
Contributor Author

Finally broke the knot in my head trying to figure how to implement replace / goToPath. All exiting tests pass now, will add tests for tab screens tomorrow evening.

@ohitsdaniel ohitsdaniel marked this pull request as ready for review July 26, 2021 07:19
@ohitsdaniel ohitsdaniel marked this pull request as draft July 26, 2021 07:19
@mltbnz
Copy link
Contributor

mltbnz commented Aug 9, 2021

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants