Skip to content

feat: show agent metadata #92

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

Merged
merged 7 commits into from
May 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
wip: only refresh if data is different
  • Loading branch information
rodrimaia committed May 8, 2023
commit a3fbc8e0eedbeb9775ac8f04ee8d2ba837910bfe
12 changes: 9 additions & 3 deletions src/workspacesProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ export class WorkspaceProvider implements vscode.TreeDataProvider<vscode.TreeIte
const workspacesTreeItem: WorkspaceTreeItem[] = []
workspaces.workspaces.forEach((workspace) => {
const showMetadata = this.getWorkspacesQuery === WorkspaceQuery.Mine
const agents = extractAgents(workspace)
agents.forEach((agent) => this.monitorMetadata(agent.id)) // monitor metadata for all agents
if (showMetadata) {
const agents = extractAgents(workspace)
agents.forEach((agent) => this.monitorMetadata(agent.id)) // monitor metadata for all agents
}
const treeItem = new WorkspaceTreeItem(
workspace,
this.getWorkspacesQuery === WorkspaceQuery.All,
Expand Down Expand Up @@ -84,7 +86,11 @@ export class WorkspaceProvider implements vscode.TreeDataProvider<vscode.TreeIte
agentMetadataEventSource.close()
}

this.agentMetadata[agentId] = agentMetadata // overwrite existing metadata
const savedMetadata = this.agentMetadata[agentId]
if (JSON.stringify(savedMetadata) !== JSON.stringify(agentMetadata)) {
this.agentMetadata[agentId] = agentMetadata // overwrite existing metadata
this.refresh()
}
} catch (error) {
agentMetadataEventSource.close()
}
Expand Down