-
Notifications
You must be signed in to change notification settings - Fork 264
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
List hide empty #673
base: master
Are you sure you want to change the base?
List hide empty #673
Conversation
I wonder if it would be better to just be called "HideEmptyStatus" rather than "SetHideEmpty"? |
For me personally it doesn't matter, but I was following the other methods like: SetShowHelp, SetShowTitle, etc. which was the most obvious match to me. Especially if thinking of dynamic switching that one on and off, where HideEmptyStatus(false) would seem a bit weird to me :) |
So part of me wonders if the API should be something like the following to provide more flexibility around how that empty items message is rendered. type Model structure {
EmptyItemsNote func(string) string
} And by default it would be something like: m.EmptyItemsNote = func(itemsPlural string) string {
return fmt.Sprintf("(no %s)", itemsPlural)
} And to hide it you'd: m.EmptyItemsNote = nil
m.RemoveEmptyItemsNote() // Maybe also a helper? |
That's a way better idea :) |
Okay cool! Do you mind updating accordingly? |
Done :) |
Thank you! This looks good on first glance: we'll give it a proper review shortly. |
Added a setting to list which can hide the "No items" on an empty list