-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adds ability to view series in text editor by pressing "v" or "enter" on a selected row #20
Conversation
… when a row is selected
c2fab3d
to
54ea783
Compare
Signed-off-by: Pedro Tanaka <[email protected]>
Signed-off-by: Pedro Tanaka <[email protected]>
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.
Thanks for this. Left some feedback to be addressed.
Signed-off-by: Pedro Tanaka <[email protected]>
Left feedback as PR as well: swar8080#1 |
Feedback PR to view raw series in editor
Co-authored-by: Pedro Tanaka <[email protected]>
…tograms and summaries into a single base metric for consistency with native histograms
I noticed that classic histograms stopped working in the editor, which the recent commit fixes. It also now lists classic histograms and summaries under a single base metric like it does for native histograms. I noticed the way cardinality is displayed is still different though, where each I'll take a look at the test failure |
cmd/cardinality.go
Outdated
|
||
// Run the editor and clean up | ||
err := cmd.Run() | ||
os.Remove(tmpFile) |
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 is fine to leave those temp files. If you try to open on a GUI editor, the file will be empty. I tried with EDITOR=code
.
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.
This is looking good already. Just let's leave the temp file behind as I said and I will approve/merge.
…t block when called through exec.Command, so the file they're editing needs to remain
Okay just made that change. I realized that text editors like sublime block the go thread when running Also, I noticed you added a line to quit the program after viewing text in the editor. Does it work correctly for you if you leave the program running? I find it convenient to explore multiple metrics without having to restart the program each time |
This looks fine for me, but it still quits the program once we run the editor.
I had a problem when using vim/nvim where the rendering of the file would be mixed with the rest of the program. Like both of them were running in paralllel. My combination of software was: iTerm2 + Zsh + NVIM v0.10.2 |
Ahh okay, i'm going to dig into how k9s handles editing resources |
…tor to see if it avoids interference with editors that run in the same terminal
Hi @pedro-stanaka, I couldn't reproduce the issue with the same set-up but am wondering if my last commit fixes the issue? I looked at the k9s code and it looks very similar except they suspend the UI event loop and also "disengage" the terminal using the below code. Bubbletea supports suspending the event loop, which is what this recent change does, but I'm not sure if it offers everything the k9s disengage code does. ![]() |
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.
LG with latest changes.
Let me know what you think. I tested this both with a terminal editor (vim) and editor that opens files in a different window (sublime).
Styling the "flash message" was surprisingly tricky so it looks pretty basic, but the control flow was fun to write.
I can also update the README once you're done reviewing
Closes #19