codefori / vscode-ibmi

🌍 IBM i development extension for VS Code
https://codefori.github.io/docs/#/
MIT License
283 stars 93 forks source link

Dynamic Color Theme'ing based on current IBM i Connection #179

Open mahoneyl opened 3 years ago

mahoneyl commented 3 years ago

Is your feature request related to a problem? Please describe. I connect to multiple machines a day simultaneously by opening a new VS Code Window and connecting to the different machine. Sometimes I forget to check the icon on the bottom row that says which IBM i that I am connected to and I end up changing files on the wrong machine.

Describe the solution you'd like I would like to be able to configure the connections by the window's editor colors. There is an extension out there called Window Colors (https://marketplace.visualstudio.com/items?itemName=stuart.unique-window-colors) that has this ability to change the titleBar's colors based on the root folder name of the current project you are working on. It would be awesome if in the connection's Advanced Settings we could change the same settings that extension uses to make sure that connection always consistently has the same distinctive color.

Describe alternatives you've considered Other ideas on on manging multiple connections simultanesouly are welcomed. Maybe making it possible to connect to multiple machines at the same time and then click on the "IBM i:" icon at the bottom to switch environments.

Additional context image

worksofliam commented 3 years ago

A very cute idea indeed. I will look into this and post further information if I see it as viable.

worksofliam commented 3 years ago

So I took a look at this and I think it's such a cool idea! With that being said.. it's not going to be an easy task. It's something that I will look into adding when I can spare some hours to do it! Of course, someone else is welcome to pick it up.

This is what I had in mind:

We could also let users provide their own hex colour... but I mostly want to keep this as simple as possible.

Would love to hear what you think about this.

mahoneyl commented 3 years ago

I think that sounds perfect. Allowing users to do their own Hex colours could be a future enhancement beyond this one.

worksofliam commented 3 years ago

After some further investigation into how the colors work.. it will be a bit tricky.

We can have only two types of settings:\

Here's another idea:

When you make a connection, we could give the option to tie it to the current workspace (if there is one).. then whenever the user launches VS Code in that workspace.. we could try and automatically connect you. Then that workspace can have its own configuration for that connection and then you could have the colors you wanted for that workspace/connection.

worksofliam commented 3 years ago

@mahoneyl Please let me know what you think of this based on PR #182:

https://user-images.githubusercontent.com/3708366/121780934-869ace00-cb70-11eb-8f5b-b66d7f4a7c1c.mp4

mahoneyl commented 3 years ago

I like that a lot. I think this adds value in saving your configs and allows people to quickly load up a "daily driver" workspace or associate different colors with different projects/connections.

I think functionally this will also work well because it seems like after you have connected to an IBM i and then go back to "normal VS Code" on the explorer and change the root folder/directory you are working in then it will automatically disconnect you from your current IBM i session. I think that is good because it kind of enforces the mental note that "this color" = "this workspace/connection" and if the color changes it indicates your connected machine might have been changed.

worksofliam commented 3 years ago

@mahoneyl Glad you think so!

The issue here is that I won't be able to merge it in unless it is tested by others.

Do you think you'd be able to build the extension and have a go yourself? I am happy to write some instructions if you needed!

edshaw42 commented 3 years ago

@worksofliam I could help test it! Shoot me the instructions and step by step, and I will try to get it tested this weekend!

szsascha commented 3 years ago

@worksofliam What's the current status on this? When will it find its way into the production build?

worksofliam commented 3 years ago

@szsascha there is a PR for this. It needs to be tested more before I would consider merging it.

szsascha commented 3 years ago

@worksofliam thank you for your reply.

I've just tried to test it. I did the following:

  1. Fetch upstream into my private fork
  2. Switching into feature/181_connection_workspace in my GitHub Desktop client
  3. Open VS Code in git working dir and running npm i
  4. Starting new VS Code instance in debug view by clicking "Run Extension"
  5. A new VS Code window shows up (like for debugging extensions)
  6. Creating a new workspace
  7. Switching into the new workspace
  8. Clicking on the current connection in the left side of the footer. A "Additional settings" tab shows up.
  9. Can't find color settings

But maybe I'm blind or stupid or both. This happens sometimes :D Maybe @edshaw42 got the same issue?

@worksofliam What am I doing wrong?

During my (unsuccessful tests) I noticed, that you can click the connection in the footer bar as often as you want and everytime a new tab opens up. That's not so nice in my opinion. Would prefer to show the "Additional settings" tab just one time.

worksofliam commented 3 years ago

@worksofliam What am I doing wrong?

It's been a while, but I believe to test this you need to create a build of the extension and install it (npm run package). Then try and debug it through there - running the debugger and switching workspaces seems a bit dodgy at times.

During my (unsuccessful tests) I noticed, that you can click the connection in the footer bar as often as you want and everytime a new tab opens up. That's not so nice in my opinion. Would prefer to show the "Additional settings" tab just one time.

I don't see much of an issue here. There also isn't an easy way to detect what web views are open I believe. You could make a PR for this, though.