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

feat: show help text #138

Merged
merged 8 commits into from
Apr 5, 2024
Merged

feat: show help text #138

merged 8 commits into from
Apr 5, 2024

Conversation

dbolson
Copy link
Contributor

@dbolson dbolson commented Apr 5, 2024

Show help text for every step. We want to support going back for each step before merging this.

Also, we should try to fix the padding in the list of SDKs separate from this change.

Screenshot 2024-04-05 at 10 06 55 AM
Screenshot 2024-04-05 at 10 07 00 AM
Screenshot 2024-04-05 at 10 07 09 AM
Screenshot 2024-04-05 at 10 07 15 AM

Copy link

This pull request has been linked to Shortcut Story #237655: figure out help text in setup wizard.

@@ -22,6 +24,8 @@ const (
)

type chooseSDKModel struct {
help help.Model
helpKeys keyMap
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern here is to have each model define the help keys it shows. These are separate from the keys we handle when they're pressed since we don't necessarily want to show, eg. tab in the help text of the toggle flag model.

Comment on lines 38 to 41
Back: key.NewBinding(
key.WithKeys("esc"),
key.WithHelp("esc", "back"),
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't go back on the input step here though - with the new success page we will be able to but is there a way to hide it when we should the textinput View?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed "back" from the help text for create flag.

@@ -75,5 +92,5 @@ func (m toggleFlagModel) View() string {
Padding(0, 1).
MarginRight(margin)

return title + "\n\n" + toggleStyle.Render(toggle) + m.flagKey + furtherInstructions
return title + "\n\n" + toggleStyle.Render(toggle) + m.flagKey + furtherInstructions + "\n\n" + helpView
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the help text jumps after the the flag is toggled for the first time. I don't think there's an easy way to pad this to make sure that doesn't happen though 😞

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to add some padding to keep the help text on the same line, but I'm not sure if the additional space is better than the jump. Maybe we leave the jump to see if anybody comments on it?
Screenshot 2024-04-05 at 1 56 24 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm!

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

Successfully merging this pull request may close these issues.

2 participants