survey icon indicating copy to clipboard operation
survey copied to clipboard

Adding footer message to Survey

Open vhvb1989 opened this issue 3 years ago • 2 comments
trafficstars

Looking to have a feature like the one proposed in this PR where I can add a footer message as a hint that there are more items in the survey.

Related to: https://github.com/Azure/azure-dev/issues/66

I am adding only the support for Select. If this idea and implementation would be OK, I could update multi-select and create some test cases.

vhvb1989 avatar Jul 13 '22 04:07 vhvb1989

Thanks for proposing this!

I'm wary of adding a new overly-specific configuration option. Generally, if there was a way to indicate more items below or after the "fold", I'd be into that, but I would like to see this generalized solution built into the current configuration around pagination, and not being called something vague like a "footer".

Until this feature is available in Survey, would it be an option for your app to customize the template string to add the "below the fold" indicator? I'm thinking that you might not need to make any changes to Survey in order to override this string in your app https://github.com/AlecAivazis/survey/blob/e47352f914346a910cc7e1ca9f65a7ac0674449a/select.go#L69-L85

mislav avatar Jul 14 '22 12:07 mislav

Thanks for proposing this!

I'm wary of adding a new overly-specific configuration option. Generally, if there was a way to indicate more items below or after the "fold", I'd be into that, but I would like to see this generalized solution built into the current configuration around pagination, and not being called something vague like a "footer".

Until this feature is available in Survey, would it be an option for your app to customize the template string to add the "below the fold" indicator? I'm thinking that you might not need to make any changes to Survey in order to override this string in your app

https://github.com/AlecAivazis/survey/blob/e47352f914346a910cc7e1ca9f65a7ac0674449a/select.go#L69-L85

Thank you @mislav I have explored the template-override approach, but the template logic becomes extra complicated as it needs to figure it out if the last item from .Select.Options is in .PageEntries !!
It would be much simpler if this information is returned by paginate() fn and passed to SelectTemplateData. Then the template can show the footer message only when user is not seeing the last page.

vhvb1989 avatar Jul 18 '22 19:07 vhvb1989

I'm going to close this PR since it's gone a bit stale. I agree we want something like this in general so let's try to figure out what the right API is that gives us a little more flexibility than a fixed string. For example, I'd like to be able to say 5 more at the bottom. I've opened https://github.com/AlecAivazis/survey/issues/453 for that discussion

AlecAivazis avatar Sep 22 '22 21:09 AlecAivazis