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: make sdk instructions scrollable #150

Merged
merged 6 commits into from
Apr 9, 2024

Conversation

k3llymariee
Copy link
Contributor

@k3llymariee k3llymariee commented Apr 9, 2024

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.

@@ -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()
Copy link
Contributor Author

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?

Copy link
Contributor

@sunnyguduru sunnyguduru Apr 9, 2024

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

Comment on lines +15 to +18
const (
viewportWidth = 80
viewportHeight = 30
)
Copy link
Contributor Author

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?

@k3llymariee k3llymariee marked this pull request as ready for review April 9, 2024 17:33
Comment on lines +96 to +100
md, err := m.renderMarkdown()
if err != nil {
return m, sendErr(err)
}
m.viewport.SetContent(md)
Copy link
Contributor Author

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

@k3llymariee k3llymariee merged commit 8055927 into main Apr 9, 2024
3 checks passed
@k3llymariee k3llymariee deleted the kelly/sc-239306/make-sdk-instructions-scrollable branch April 9, 2024 18:04
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.

3 participants