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

Support customizing sections #145

Closed
heylookltsme opened this issue Jul 9, 2022 · 8 comments
Closed

Support customizing sections #145

heylookltsme opened this issue Jul 9, 2022 · 8 comments

Comments

@heylookltsme
Copy link

Is your feature request related to a problem? Please describe.
My company does not use Github Issues, so I have no need for the issues section. I'd love to hide it!

Describe the solution you'd like
A config option to specify which sections should be shown.

Describe alternatives you've considered
Just ignoring the issues section. :) But if #141 is ever supported (and I really hope it is!) then it would be more important, imo, to be able to customize which sections are shown because then there would be three.

Thanks for the awesome project!

@dlvhdr
Copy link
Owner

dlvhdr commented Jul 9, 2022

I like this idea :) Shouldn't be too hard to add..
Do you want to maybe contribute it?

@heylookltsme
Copy link
Author

I'd be happy to, but I'm not sure I'll have time. 😞 If I find myself with the bandwidth, I'll comment here and ask you to assign this to me 👍🏻

Glad to hear it wouldn't be too difficult. I've never written any go before, so I'll have a bit of a learning curve. Could you give me an overview of how it might be implemented? That'll definitely give me a head start :D

@dlvhdr
Copy link
Owner

dlvhdr commented Jul 10, 2022

No problem, only if you have time.
You'd have to learn the basics of go and bubbletea which could be a cool learning opportunity 😎

@heylookltsme
Copy link
Author

I started poking around the code and I had a couple of thoughts I wanted to run by you before doing anything.

It's very tempting to want to make a new top-level config option called sections and nest the prSections and issuesSections options underneath that. That would also help pave the way for a notifications section, should there ever be one.

However, that's a huge change and wouldn't be backward compatible, so I'm guessing that's not really tenable.

An alternative could be adding a boolean flag to the SectionConfig type (include or something) that defaults to true. So if you want to remove a section, you simply set include to false. That's probably the way to go. What do you think?

Also, I'm noticing a number of if/elses that assume there's only ever two possible sections - PRs or Issues. Here's an example:

gh-dash/ui/ui.go

Lines 295 to 301 in d25d810

func (m *Model) switchSelectedView() config.ViewType {
if m.ctx.View == config.PRsView {
return config.IssuesView
} else {
return config.PRsView
}
}

If I'm updating that code anyway, what do you think about me changing those ifs to switches to more easily support new sections?

Thanks for your guidance!

@dlvhdr
Copy link
Owner

dlvhdr commented Jul 11, 2022

An alternative could be adding a boolean flag to the SectionConfig type (include or something) that defaults to true.

Yeah that sounds like a good idea.
I'm using starship (a command prompt) that does something similar.
They use the disable = true toml syntax to remove sections.
I agree that doing a backward incompatible change is less preferable.

If I'm updating that code anyway, what do you think about me changing those ifs to switches to more easily support new sections?

Sure that sounds great.

@dlvhdr
Copy link
Owner

dlvhdr commented Jan 7, 2023

Should be solved by #145

@miniscruff
Copy link
Contributor

Should be solved by #145

Did you mean another issue? I think this is already solved as well but maybe you meant #187 ?

@dlvhdr
Copy link
Owner

dlvhdr commented May 24, 2024

yes @miniscruff thank you!

@dlvhdr dlvhdr closed this as completed May 24, 2024
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

No branches or pull requests

3 participants