Bahn-X / swift-composable-navigator

An open source library for building deep-linkable SwiftUI applications with composition, testing and ergonomics in mind
MIT License
580 stars 25 forks source link

Tabbed screen #71

Closed ohitsdaniel closed 1 year ago

ohitsdaniel commented 3 years ago

Helps with #19.

Problem

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

Solution

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

krzysztofzablocki commented 3 years ago

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

ohitsdaniel commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

Cool, thanks in advance!

ohitsdaniel commented 3 years ago

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 commented 3 years ago

Picking up dismiss and dismissSuccessor.

ohitsdaniel commented 3 years ago

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

ohitsdaniel commented 3 years ago

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

ohitsdaniel commented 3 years ago

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.

mltbnz commented 3 years ago

👀