Githawk: Add tabs to PR view

Created on 18 Nov 2017  路  16Comments  路  Source: GitHawkApp/GitHawk

Discussion, Commits and Files

Maybe?


Bug Report Dump (Auto-generated)

Version 1.13.0 (1192)
Device: iPhone 6s Plus (iOS 11.2)
TestFlight: true

馃啎 feature request

Most helpful comment

@Sherlouk okay sounds good, I鈥檒l get on with implementing that shortly.. 馃憤

Sent with GitHawk

All 16 comments

Would probably need to diverge from issues significantly, maybe a new VC?

Sent with GitHawk

Not opposed, will give it some thought. Would open up adding even more stuff down the line.

Sent with GitHawk

Does tab man support having one tab and hiding the bar? If so we wouldn鈥檛 need much diversion! Would be a solid feature request if it doesn鈥檛. I definitely think this is the way though!

Sent with GitHawk

Hmmmmm great question. Not totally sure. Tabman is really extendable (tho I can't speak to the quality of extensions). We could write our own plugin/layout for this (similar to writing our own layout to support icons).

Looks like there's a couple ways to do it, the easiest would be using bar.appearance.layout.height (defaults to .auto) and setting that to 0 for Issues?

We could subclass TabBar to add our own logic which detects the amount of items and changes that!

Would definitely open up a few doors, especially drawing more attention to the files section and doing more with reviews!

@rnystrom @Sherlouk Tabman doesn't currently support any sort of hiding logic, setting the height to 0 currently won't work either as the bar won't allow itself to be compressed below it's minimum required intrinsic height (although I should probably change/rename this...).

Open to discussions about any sort of improvements / new features though! And you can of course embed the bars in external views for any more complex behaviours.

Noticed you've had issues with the auto-insetting stuff so I'm trying to get that sorted and a bit more reliable 馃槄

@msaps Cheers for the input, and loving what you've done so far!

See what you're saying about setting the height to 0. Having a quick look at your linebar it looks like the height can be overridden there? If we were to create a custom one which just returned .zero what's stopping that? Feels a bit hacky though regardless!

What would the scale of changes be to add first-level support for this feature? Either just a simple hide/show or, as we want, auto-hide if only one item?

@Sherlouk cheers! 馃憤

Ah yes, that would work! A custom bar would let you do whatever you want, the built-in bars that contain any text / image items are currently resistant to being compressed beyond their intrinsic size - that was what I was referring to!

Support for showing/hiding is something that I'd like to have in the API regardless, so it's definitely worth looking at. The auto-hide with one item also makes a lot of sense for some use-cases. What specifications / use-cases would you require if this was to be implemented?

@msaps The idea of this ticket is to add tabs to our Pull Request view, where we would have tabs for Discussion, Commits and Files. We currently use the same view controller for Issues and PRs, and it'd be nice to continue this!

However, Issues don't need access to tabs. So would only have one tab "Discussion". The idea I'm suggesting where it would auto-hide the bar if there's only one tab is for this exact situation, we obviously can't switch tabs if there's only one so let's hide the bar!

@Sherlouk okay sounds good, I鈥檒l get on with implementing that shortly.. 馃憤

Sent with GitHawk

@rnystrom @Sherlouk this is now available in Tabman as of 1.1.0 馃帀

Added a nice new behaviors API to TabmanBar:

bar.behaviors = [.autoHide(.withOneItem)]

You just provide an array of TabmanBar.Behavior enum values and the behavior engine takes care of the rest 馃槂

@msaps This is so sweet! Cheers for doing that!

@rnystrom We good to go ahead and do this then? For now just adding the tabs, removing the "Show Files" button in replace of it's own tab? (Commits can come later!)

馃挴 lets get started on this! Maybe for 1.15?

Sent with GitHawk

@rnystrom Had a quick look into this, looks like it'll be a fairly large refactor (but will definitely be worth it) essentially all the issue loading and bookmark stuff needs to be into one view controller (with the tab bar) and then we have an IssuesDiscussionViewController which is literally just the timeline structure.

Main reason for this is the tab bar needs to know about the issue type (PR vs issue) in order to show the files VC

In that time we'll need some sort of loading UI, an easy way would be a IssuesLoadingVC? We'd also need a delegate back up the chain to handle pull-to-refresh to update the issue reference

Will take your opinion on it but yh will be pretty disruptive

Maybe we start with files? Then the top VC only needs to do bookmarking and the more menu. The issue child VC can do all of its loading, same with files. That鈥檚 a similar setup to repos now. Probably need to do some back & forth between the top VC and issues for the menu items.

Maybe we could update initializing the top VC with type (issue/PR) information?

Also we could use the FlatCache listener pattern to have both the top VC and children listen to changes and make updates.

Just tossing out ideas. We also aren鈥檛 under any pressure to ship this in 1.15.

Sent with GitHawk

Gonna leave this as an "up for grabs" for now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rnystrom picture rnystrom  路  3Comments

rnystrom picture rnystrom  路  3Comments

Iron-Ham picture Iron-Ham  路  3Comments

BasThomas picture BasThomas  路  3Comments

rnystrom picture rnystrom  路  3Comments