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

fix(site): hide "Show parent apps" when no running or starting devcontainers#19200

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
Merged
Show file tree
Hide file tree
Changes fromall commits
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
43 changes: 38 additions & 5 deletionssite/src/modules/resources/AgentRow.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -286,10 +286,43 @@ export const GroupApp: Story = {
};

export const Devcontainer: Story = {
beforeEach: () => {
spyOn(API, "getAgentContainers").mockResolvedValue({
devcontainers: [M.MockWorkspaceAgentDevcontainer],
containers: [M.MockWorkspaceAgentContainer],
});
parameters: {
queries: [
{
key: ["agents", M.MockWorkspaceAgent.id, "containers"],
data: {
devcontainers: [M.MockWorkspaceAgentDevcontainer],
containers: [M.MockWorkspaceAgentContainer],
},
},
],
webSocket: [],
},
};

export const FoundDevcontainer: Story = {
args: {
agent: {
...M.MockWorkspaceAgentReady,
},
},
parameters: {
queries: [
{
key: ["agents", M.MockWorkspaceAgentReady.id, "containers"],
data: {
devcontainers: [
{
...M.MockWorkspaceAgentDevcontainer,
status: "stopped",
container: undefined,
agent: undefined,
},
],
containers: [],
},
},
],
webSocket: [],
},
};
21 changes: 10 additions & 11 deletionssite/src/modules/resources/AgentRow.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -137,17 +137,16 @@ export const AgentRow: FC<AgentRowProps> = ({
// This is used to show the parent apps of the devcontainer.
const [showParentApps, setShowParentApps] = useState(false);

let shouldDisplayAppsSection = shouldDisplayAgentApps;
if (
devcontainers &&
devcontainers.find(
// We only want to hide the parent apps by default when there are dev
// containers that are either starting or running. If they are all in
// the stopped state, it doesn't make sense to hide the parent apps.
const anyRunningOrStartingDevcontainers =
devcontainers?.find(
(dc) => dc.status === "running" || dc.status === "starting",
) !== undefined &&
!showParentApps
) {
) !== undefined;

// We only want to hide the parent apps by default when there are dev
// containers that are either starting or running. If they are all in
// the stopped state, it doesn't make sense to hide the parent apps.
let shouldDisplayAppsSection = shouldDisplayAgentApps;
if (anyRunningOrStartingDevcontainers && !showParentApps) {
shouldDisplayAppsSection = false;
}

Expand DownExpand Up@@ -187,7 +186,7 @@ export const AgentRow: FC<AgentRowProps> = ({
</div>

<div className="flex items-center gap-2">
{devcontainers && devcontainers.length > 0 && (
{anyRunningOrStartingDevcontainers && (
<Button
variant="outline"
size="sm"
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp