-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support displaying images data from tui i
#55
Conversation
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
tui i
tui i
For example, for the
Then it passes It'll be good to figure out how to extend the |
Waiting for results in |
) | ||
|
||
// Model represents the state of the TUI. | ||
type Model struct { |
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.
Here as well... let's use a less Bubble Tea specific name... Let's call it TUI
(type TUI struct
). This way, somebody who doesn't know much about the Bubble Tea architecture and terminology will be able to understand what this code is for. Comments help too, of course. Calling the struct TUI
will make it more obvious.
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.
Noted and addressed.
} | ||
|
||
// InitialModel returns the initial state of the model. | ||
func InitialModel(images map[string]crt.BasicImageInfo, standalone bool) *Model { |
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.
Here as well... InitialTUI
will make it easier to understand what it's for
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.
Noted and addressed.
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
…odels Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
What
images
fromOnCommand
in the images command packageimages command
packageWhy
mint images --tui
or themint tui -> i
use modestui
modeHow Tested
mint images
-> should not open tui modemint images --tui
-> should open tui modemint tui
-> opens tui mode ->i
-> open image mode ->esc
-> return to the home mode ->d
-> open the debug view ->q
-> quit the TUIOpen Issues
app
level logs to the CLI after the TUI closes.General questions
command package
?OnCommand
outputs somedata
that the TUI model needs to ingest in order to perform an update, what is the preferred pattern toawait
the return of data from the call ofOnCommand
?OnCommand
in the images package to returnimages.
My previous attempt had been to callImageModel.Update
(not exact reference), but because this call was returning before theOnCommand
return, the final model returned inside of the previousImageModel.Update
call (being the initial call performed by theHome Model 'i' key input handler
) did not retain the images data. Having some intermediate state handler inside of the images model was another approach, but this felt more confusing to maintain.