vscode-gitops-tools
                                
                                 vscode-gitops-tools copied to clipboard
                                
                                    vscode-gitops-tools copied to clipboard
                            
                            
                            
                        Logs formatting and UX improvements
Controlled Logs visual formatting should be improved, and should run and scroll to bottom initially
This is an upstream setting in the vscode-kubernetes-tools extension. I've created an issue there: https://github.com/vscode-kubernetes-tools/vscode-kubernetes-tools/issues/1058
Tracking:
- https://github.com/vscode-kubernetes-tools/vscode-kubernetes-tools/issues/1058
I think we said we were going to try to make this happen upstream, whether that means we need to submit it as a PR and get it merged, or fork the upstream extension if possible so that we can iterate a bit faster than at the pace of two committees...
Moved this to high priority, I think we have other logging enhancements proposed, like
- #254
and we'd like to get some or all of them into one of the next two upcoming milestones (0.20, 0.21)
Progress:
- https://github.com/vscode-kubernetes-tools/vscode-kubernetes-tools/pull/1062
Just a heads-up, this should hopefully finish more of that issue btw:
- https://github.com/vscode-kubernetes-tools/vscode-kubernetes-tools/pull/1066
Hope the implementation was fine for whatever you'll need it for, but feel free to drop a comment on your issue if something is up.
- https://github.com/vscode-kubernetes-tools/vscode-kubernetes-tools/issues/1058
Only part missing is scroll to bottom which I'll do after this is merged. Meanwhile, seems if word-wrapping is enabled, scroll-to-bottom doesn't work correctly so going to look into that bug. π€
This is great! Thank you @SethFalco I'll look forward to see this land in the kubernetes extension upstream π
I just found the "Save Settings" button, this is really great π I see the scroll-to-bottom bug you mentioned when wrap is enabled.
@kingdonb Was thinking about it since the default settings aren't going to change. π€ For what it's worth, you can probably make a notification on your extension with a call to action to change those settings for the user maybe?
vscode.window.showInformationMessage('It\'s recommended to have follow logs and autorun enabled by default. Do you want to apply these settings?', () => {
  // Whatever other arguments/options
  // And if they select yes:
  vscode.workspace.getConfiguration('vscode-kubernetes.log-viewer').update('timestamp', true, true);
  vscode.workspace.getConfiguration('vscode-kubernetes.log-viewer').update('autorun', true, true);
});
So maybe on the first time they do a certain action, you display a message like:
It's recommended to have follow logs and autorun enabled by default. Do you want to apply these settings?
YesNoDon't Ask Again
Displaying the prompt and applying the settings should be easy enough. The only thing I'm not sure about is what the right time to prompt the user is, and how to make it only once. ^-^' I think I've seen other extensions display one-time questions, so could just check how they handle it if you aren't aware either.
Alternatively, you can scrap it and stick it out with the new options and Save Settings button. Just wanted to share the idea if you're keen on it.
I think I would like to display these questions the first time the users visit the "Logs" tab π thanks for the suggestion!
Small update on above!
The only thing I'm not sure about is what the right time to prompt the user is, and how to make it only once. ^-^'

Looks like the way Visual Studio Code's built-in extensions handle one-time prompts is by having a Never Show Again action button when prompting the user.
Clicking Never Show Again sets a setting called ignore⦠i.e. vscode-gitops-tools.ignoreConfigSuggestions to true.
Pretty simple but it works, I was hoping there'd be a way that didn't create new global settings, but it's not obvious to me anyway. π€ Probably best to reuse this setting when or if you ever want to suggest other settings in other parts of the extension.