-
Notifications
You must be signed in to change notification settings - Fork 1
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: make sdk instructions scrollable #150
feat: make sdk instructions scrollable #150
Conversation
@@ -112,6 +112,7 @@ func (m ContainerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { | |||
m.flagKey = msg.flag.key | |||
m.currentStep += 1 | |||
m.err = nil | |||
cmd = sendEnableMouseCellMotionMsg() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can either enable this here as a message or at the start of the quickstart program, thought it was safer to enable here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better here too. Since we don't use the feature elsewhere
const ( | ||
viewportWidth = 80 | ||
viewportHeight = 30 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arbitrary values I picked - we could adjust these based on the window size if we want?
md, err := m.renderMarkdown() | ||
if err != nil { | ||
return m, sendErr(err) | ||
} | ||
m.viewport.SetContent(md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rendering once here vs. every time the View
method is called, to allow for proper updating
scrollable-sdk.mp4
Adds a viewport for displaying the SDK instructions, which should be scrollable both with up/down keys as well as a mouse wheel.