vscode-gitops-tools icon indicating copy to clipboard operation
vscode-gitops-tools copied to clipboard

Logs formatting and UX improvements

Open juozasg opened this issue 3 years ago β€’ 8 comments

Controlled Logs visual formatting should be improved, and should run and scroll to bottom initially

juozasg avatar Apr 01 '22 13:04 juozasg

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

juozasg avatar Apr 14 '22 12:04 juozasg

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)

kingdonb avatar Apr 30 '22 13:04 kingdonb

Progress:

  • https://github.com/vscode-kubernetes-tools/vscode-kubernetes-tools/pull/1062

kingdonb avatar Apr 30 '22 14:04 kingdonb

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. πŸ€”

SethFalco avatar May 06 '22 05:05 SethFalco

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 avatar May 06 '22 17:05 kingdonb

@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? Yes No Don'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.

SethFalco avatar May 09 '22 22:05 SethFalco

I think I would like to display these questions the first time the users visit the "Logs" tab πŸ‘ thanks for the suggestion!

kingdonb avatar May 12 '22 14:05 kingdonb

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. ^-^'

image

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.

SethFalco avatar May 17 '22 21:05 SethFalco