-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(site/src/pages/WorkspacesPage): show only parent agent apps in workspaces table #26568
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -656,15 +656,19 @@ const WorkspaceApps: FC<WorkspaceAppsProps> = ({ workspace }) => { | |
| * Coder is pretty flexible and allows an enormous variety of use cases, such | ||
| * as having multiple resources with many agents, but they are not common. The | ||
| * most common scenario is to have one single compute resource with one single | ||
| * agent containing all the apps. Lets test this getting the apps for the | ||
| * first resource, and first agent - they are sorted to return the compute | ||
| * resource first - and see what customers and ourselves, using dogfood, think | ||
| * about that. | ||
| * agent containing all the apps. We get the apps from the first compute | ||
| * resource (they are sorted to return the compute resource first). | ||
| * | ||
| * For multi-agent workspaces we show the apps from the parent agent, the one | ||
| * without a `parent_id`, instead of whichever agent happens to be discovered | ||
| * first. Sub-agents, such as those created by devcontainers, are skipped so | ||
|
Comment on lines
+662
to
+664
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only valid for multi-agent workspaces with child agents. There are cases when there could be multiple parent-level agents. |
||
| * their apps do not replace the parent agent's apps depending on ordering. | ||
| * This keeps the shortcuts row deterministic. | ||
| */ | ||
| const agent = workspace.latest_build.resources | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit [CRF-2] (Gon)
|
||
| .filter((r) => !r.hide) | ||
| .at(0) | ||
| ?.agents?.at(0); | ||
| ?.agents?.find((a) => a.parent_id === null); | ||
| if (!agent) { | ||
| return null; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit [CRF-1] "their apps do not replace the parent agent's apps depending on ordering" parses two ways: (1) the ordering-dependent replacement no longer happens, or (2) whether replacement happens depends on ordering. The follow-up sentence resolves it, but a reader shouldn't have to read ahead to parse one sentence.
Suggestion:
(Leorio)