Skip to content

Add agent metadata statusbar to monitor resource usage #555

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

EhabY
Copy link
Contributor

@EhabY EhabY commented Jul 16, 2025

#191

Looks like the following:

image

The statusbar creation happens in remote.ts#setup which AFAIK seems to be called only once per session/extension activation. The creation of this statusbar happens at the very end when everything goes smoothly.

Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Left some minor thoughts. We should add a changelog entry as well, and it might make sense to mention that if they want to change which shows in the toolbar, they can reorder the metadata in the Terraform since we show the first one.

* The status bar item updates dynamically based on changes to the agent's metadata,
* and hides itself if no metadata is available or an error occurs.
*/
private createAgentMetadataStatusBar(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking out loud, not sure if this is a good move or not, but would it make sense to make this part of WorkspaceMonitor? Such that new WorkspaceMonitor() would monitor both the workspace and the agent metadata and update the status bar with both pieces of info.

But on the other hand, I could also see an argument that monitoring the workspace and monitoring the agent are really two different things and should not be colocated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had thought of that but indeed I thought this is not really a Workspace item, it's purely an Agent item

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah fair enough

src/remote.ts Outdated
this.storage.writeToCoderOutputChannel(
formatMetadataError(agentWatcher.error),
);
statusBarItem.hide();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to show the error here? Or just a warning icon or something with the error in the tooltip maybe?

Copy link
Contributor Author

@EhabY EhabY Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm tbh I am not entirely sure how frequent an error like this can happen.

If we show an error, it could be annoying if it keeps popping up frequently. Perhaps adding an error icon with some label and the tooltip can include the error message is good (while still logging of course). Though I don't love having a "useless" status bar item since the status bar is already crowded 🤔

Which is why I favor the current approach, what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is that if we think it is important enough to show metadata in the status bar, it is important enough to show errors getting that metadata.

Definitely agree there should be no popups or anything like that, that would be super annoying.

Thinking about it from the original request, the user wanted to be able to see disk space in the status bar. Suppose one day there was an error and we could not fetch the metadata, likely the user wants to be aware of that (I am projecting of course lol)

@EhabY
Copy link
Contributor Author

EhabY commented Jul 18, 2025

One extra improvement here is that we can use Coders icon right next to the text. This would require creating a custom font with all the extensions logos in it so might be out of scope here 🤔

For example the Git extension adds this which gives context to what the text after it means:

image

--

Currently in this PR, it just shows whatever the first item is which is not intuitive for users to recognize as being related to Coder

@EhabY
Copy link
Contributor Author

EhabY commented Jul 19, 2025

This is just using the logo SVG:

image

It seems a bit big tbh, maybe the C alone or the dash can be smaller?

@matifali
Copy link
Member

I prefer the no logo, or if we can make the logo smaller, such as 70% of its original size.

@EhabY
Copy link
Contributor Author

EhabY commented Jul 20, 2025

I prefer the no logo, or if we can make the logo smaller, such as 70% of its original size.

Agreed, the logo is a bit too big, here's how it looks if the logo is scaled down to 60% of its original size:

image

Ideally there should be a more "square" form of the Coder logo that would fit the VS Code environment more. Here it just means that the logo is made smaller and so there are invisible spaces around it. For example, if you point to the left of it you get the hover due to the invisible padding:

image

@matifali
Copy link
Member

@rachelmullenax can we have a square logo for use cases like this?

@code-asher
Copy link
Member

code-asher commented Jul 21, 2025

I wonder if some generic icon indicating a remote resource would work better than the logo? Like a cloud icon or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants