Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
code-asher merged 4 commits intocoder:mainfromEhabY:add-agent-metadata-statusbar
Jul 24, 2025

Conversation

EhabY
Copy link
Collaborator

#191

Looks like the following:

image

The statusbar creation happens inremote.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.

matifali reacted with heart emoji
Copy link
Member

@code-ashercode-asher left a comment
edited
Loading

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.

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
CollaboratorAuthor

@EhabYEhabYJul 18, 2025
edited
Loading

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)

Copy link
CollaboratorAuthor

@EhabYEhabYJul 22, 2025
edited
Loading

Choose a reason for hiding this comment

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

Hmmm yeah I see your point now. In that case, I think I can show the something like a warning logo with a label then when hovering we show the error details (the same one that is logged). We can even change the background color so it's yellow-ish for example.

So my proposal is something like

statusBarItem.text="$(warning) Agent Status Unavailable";statusBarItem.tooltip=errMessage;statusBarItem.color=newvscode.ThemeColor("statusBarItem.warningForeground",);statusBarItem.backgroundColor=newvscode.ThemeColor("statusBarItem.warningBackground",);

Copy link
Member

Choose a reason for hiding this comment

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

I like it!

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Ah I almost forgot, we still hide the status bar if there is no metadata. Do we want that still?

Copy link
Member

Choose a reason for hiding this comment

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

Oh good point hmmm...I wonder if it would make sense to show "no metadata" and in the popup explain that if you want metadata you have to add it to your workspace template?

But on the other hand, maybe if the template has no metadata it is because the user explicitly did not want to see metadata, and this could be annoying to them.

Honestly not sure, maybe the best move is to add a toggle to hide/disable the metadata?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

You mean always show the status bar item, and if there are no data then we simply say "No metadata available" and the user can toggle the status bar item in a setting 🤔 ?

Yeah not sure as well... For reference, in the tree view, if there is no metadata then nothing is shown to the user about that

Copy link
Member

@code-ashercode-asherJul 24, 2025
edited
Loading

Choose a reason for hiding this comment

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

Yup that was what I was thinking.

I think for now we just hide it, like you say we hide it in the sidebar as well. It could be nice to show a message for discoverability reasons; users may not even realize they can have metadata to show. But, I think it would make sense to revisit that together with the sidebar at a later point.

@EhabY
Copy link
CollaboratorAuthor

EhabY commentedJul 18, 2025
edited
Loading

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
CollaboratorAuthor

This is just using the logo SVG:

image

It seems a bit big tbh, maybe theC 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
CollaboratorAuthor

EhabY commentedJul 20, 2025
edited
Loading

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 commentedJul 21, 2025
edited
Loading

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

@EhabY
Copy link
CollaboratorAuthor

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

I think this could work well since the VS Code codions fit well within the ecosystem.

imageimageimage

The only worry here is that just having an icon won't give enough of an indication that this isCoder's stats but could be fine since other extensions use those so it's consistent 🤔

@EhabYEhabYforce-pushed theadd-agent-metadata-statusbar branch from39c307d tof5c8b9fCompareJuly 22, 2025 18:53
@code-asher
Copy link
Member

The only worry here is that just having an icon won't give enough of an indication that this is Coder's stats but could be fine since other extensions use those so it's consistent

True! But yeah I like the idea of consistent-looking icons in the status bar. I think mostly the logo being so thick and bold compared to the other icons is what throws me off. But I will defer to what you and@matifali think.

@matifali
Copy link
Member

Let's keep using the Coder logo. We can update when@rachelmullenax gets back.

@EhabY
Copy link
CollaboratorAuthor

EhabY commentedJul 24, 2025
edited
Loading

Alright, I'll keep the 70% one but I did have to write afantasticon script to generate the font from the logo. Should I push everything there and possibly make it part of the script? Or just push the font that contains the logo?. (There is no way to use custom logos in the statusbar without adding a custom font...)

The former will make sure we can easily add more icons but requires some discussion since it should be added to the build workflow, while the latter is just a singlewoff2 file that contains the scaled down logo 🤔

Alternatively, we can just use one of the default VS Code logos above (for now)

@matifali
Copy link
Member

matifali commentedJul 24, 2025
edited
Loading

Alternatively, we can just use one of the default VS Code logos above (for now)

I am not familiar with the complexities of custom fonts, so let's use the Dashboard logo, specifically the round gauge.

@EhabY
Copy link
CollaboratorAuthor

Alternatively, we can just use one of the default VS Code logos above (for now)

I am not familiar with the complexities of custom fonts, so let's use the Dashboard logo, specifically the round gauge.

Alright, will do, adding a custom font is not difficult but requires some thought and makes sense to do after we have the logo

matifali and code-asher reacted with thumbs up emoji

@EhabYEhabYforce-pushed theadd-agent-metadata-statusbar branch fromf5c8b9f todfc1a3aCompareJuly 24, 2025 22:09
@EhabY
Copy link
CollaboratorAuthor

This is how it looks like when it is failing (but with an error message):

image

When it works it looks like this:

image

If there are no errors but the metadata is empty, then we simply hide the status bar item.

@code-asher
Copy link
Member

Looks awesome thank you!

@code-ashercode-asher merged commitcb2a4ec intocoder:mainJul 24, 2025
2 checks passed
@matifali
Copy link
Member

If there is a template with nometadata block incoder_agent, how do we handle it? Do we hide it completely or show an error? If it's the latter, then we should probably look into hiding it from the status bar.

@EhabY
Copy link
CollaboratorAuthor

If there is a template with nometadata block incoder_agent, how do we handle it? Do we hide it completely or show an error? If it's the latter, then we should probably look into hiding it from the status bar.

Currently if themetadata is undefined (or an empty list), then nothing is shown in the tree view nor the status bar item. See this thread:#555 (comment)

matifali reacted with thumbs up emoji

@EhabY
Copy link
CollaboratorAuthor

Should we hide it when there's an error since it seems to cause some confusion for users, see#595 (comment)

@code-asher
Copy link
Member

code-asher commentedOct 8, 2025
edited
Loading

It sounds like this led to a real bug being caught, so showing it had real value. Maybe it means we need to somehow make it clearer what the error means through better UX.

I like your idea of introducing retries, that seems like it should solve the issue of transient errors at least.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@code-ashercode-ashercode-asher approved these changes

@matifalimatifalimatifali approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

move agent metadata from sidebar to bottom status bar
3 participants
@EhabY@matifali@code-asher

[8]ページ先頭

©2009-2025 Movatter.jp