Skip to content

feat: enable agent connection reports by default, remove flag (cherry-pick #16778) #16809

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

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
172e523
feat(agent): wire up agentssh server to allow exec into container (#1…
johnstcn Feb 26, 2025
38c0e8a
fix(agent/agentssh): ensure RSA key generation always produces valid …
ThomasK33 Feb 26, 2025
c5a265f
feat(cli): add experimental rpty command (#16700)
johnstcn Feb 26, 2025
a2cc1b8
fix: display premium banner on audit page when license inactive (#16713)
mtojek Feb 26, 2025
2971957
ci: also restart tagged provisioner deployment (#16716)
johnstcn Feb 26, 2025
f1b357d
feat: support session audit log (#16703)
BrunoQuaresma Feb 26, 2025
b94d2cb
fix(coderd): handle deletes and links for new agent/app audit resourc…
mafredri Feb 26, 2025
7c035a4
fix: remove provisioners from deployment sidebar (#16717)
BrunoQuaresma Feb 26, 2025
7cd6e9c
fix: return provisioners in desc order and add limit to cli (#16720)
mafredri Feb 26, 2025
5295902
docs: clarified prometheus integration behavior (#16724)
michaelvp411 Feb 26, 2025
1cb864b
fix: allow viewOrgRoles for custom roles page (#16722)
jaaydenh Feb 26, 2025
81ef9e9
docs: document new feature stages (#16719)
EdwardAngert Feb 26, 2025
2aa749a
chore(cli): fix test flake caused by agent connect race (#16725)
johnstcn Feb 26, 2025
6b69635
chore: warn user without permissions to view org members (#16721)
jaaydenh Feb 26, 2025
5cdc13b
docs: fix broken links in feature-stages (#16727)
EdwardAngert Feb 26, 2025
b3d6755
docs: copy edit early access section in feature-stages doc (#16730)
EdwardAngert Feb 27, 2025
95363c9
fix(enterprise/coderd): remove useless provisioner daemon id from req…
johnstcn Feb 27, 2025
6dd51f9
chore: test metricscache on postgres (#16711)
DanielleMaywood Feb 27, 2025
4ba5a8a
feat(agent): add connection reporting for SSH and reconnecting PTY (#…
mafredri Feb 27, 2025
cccdf1e
feat: implement WorkspaceCreationBan org role (#16686)
Emyrk Feb 27, 2025
464fccd
chore: create collapsible summary component (#16705)
jaaydenh Feb 27, 2025
bf5b002
fix: add org role read permissions to site wide template admins and a…
jaaydenh Feb 27, 2025
91a4a98
chore: add an unassign action for roles (#16728)
aslilac Feb 27, 2025
0ea0601
fix: handle undefined job while updating build progress (#16732)
mtojek Feb 27, 2025
7e33902
chore: use org-scoped roles for organization groups and members e2e t…
aslilac Feb 27, 2025
b23e05b
fix(vpn): fail early if wintun.dll is not present (#16707)
deansheather Feb 28, 2025
3997eee
chore: update tailscale (#16737)
deansheather Feb 28, 2025
64fec8b
feat: include winres metadata in Windows binaries (#16706)
deansheather Feb 28, 2025
ec44f06
feat(cli): allow SSH command to connect to running container (#16726)
johnstcn Feb 28, 2025
6889ad2
fix(agent/agentcontainers): remove empty warning if no containers exi…
johnstcn Feb 28, 2025
e27953d
fix(site): add a beta badge for presets (#16751)
SasSwart Feb 28, 2025
930816f
fix: locate Terraform entrypoint file (#16753)
mtojek Feb 28, 2025
4216e28
fix: editor: fallback to default entrypoint (#16757)
mtojek Feb 28, 2025
fc2815c
docs: fix anchor and repo links (#16555)
guspan-tanadi Mar 2, 2025
ca23abe
feat(provisioner): add support for workspace_owner_rbac_roles (#16407)
nxf5025 Mar 2, 2025
d0e2060
feat(agent): add second SSH listener on port 22 (#16627)
ThomasK33 Mar 3, 2025
c074f77
feat: add notifications inbox db (#16599)
defelmnq Mar 3, 2025
a5842e5
docs: document default GitHub OAuth2 configuration and device flow (#…
hugodutka Mar 3, 2025
9c5d496
docs: suggest disabling the default GitHub OAuth2 provider on k8s (#1…
hugodutka Mar 3, 2025
0f4f6bd
docs: describe default sign up behavior with GitHub (#16765)
hugodutka Mar 3, 2025
88f0131
fix: use dbtime in dbmem query to fix flake (#16773)
ethanndickson Mar 3, 2025
04c3396
refactor: replace `golang.org/x/exp/slices` with `slices` (#16772)
Juneezee Mar 3, 2025
ca23abc
chore(cli): fix test flake in TestSSH_Container/NotFound (#16771)
johnstcn Mar 3, 2025
7dc05cc
feat: enable agent connection reports by default, remove flag
mafredri Mar 3, 2025
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
Next Next commit
chore: create collapsible summary component (#16705)
This is based on the Figma designs here:
https://www.figma.com/design/WfqIgsTFXN2BscBSSyXWF8/Coder-kit?node-id=507-1525&m=dev

---------

Co-authored-by: Steven Masley <stevenmasley@gmail.com>
  • Loading branch information
jaaydenh and Emyrk authored Feb 27, 2025
commit 464fccd8075a65a67e8f977597da48b36a9716f5
120 changes: 120 additions & 0 deletions site/src/components/CollapsibleSummary/CollapsibleSummary.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from "../Button/Button";
import { CollapsibleSummary } from "./CollapsibleSummary";

const meta: Meta<typeof CollapsibleSummary> = {
title: "components/CollapsibleSummary",
component: CollapsibleSummary,
args: {
label: "Advanced options",
children: (
<>
<div className="p-2 border border-border rounded-md border-solid">
Option 1
</div>
<div className="p-2 border border-border rounded-md border-solid">
Option 2
</div>
<div className="p-2 border border-border rounded-md border-solid">
Option 3
</div>
</>
),
},
};

export default meta;
type Story = StoryObj<typeof CollapsibleSummary>;

export const Default: Story = {};

export const DefaultOpen: Story = {
args: {
defaultOpen: true,
},
};

export const MediumSize: Story = {
args: {
size: "md",
},
};

export const SmallSize: Story = {
args: {
size: "sm",
},
};

export const CustomClassName: Story = {
args: {
className: "text-blue-500 font-bold",
},
};

export const ManyChildren: Story = {
args: {
defaultOpen: true,
children: (
<>
{Array.from({ length: 10 }).map((_, i) => (
<div
key={`option-${i + 1}`}
className="p-2 border border-border rounded-md border-solid"
>
Option {i + 1}
</div>
))}
</>
),
},
};

export const NestedCollapsible: Story = {
args: {
defaultOpen: true,
children: (
<>
<div className="p-2 border border-border rounded-md border-solid">
Option 1
</div>
<CollapsibleSummary label="Nested options" size="sm">
<div className="p-2 border border-border rounded-md border-solid">
Nested Option 1
</div>
<div className="p-2 border border-border rounded-md border-solid">
Nested Option 2
</div>
</CollapsibleSummary>
<div className="p-2 border border-border rounded-md border-solid">
Option 3
</div>
</>
),
},
};

export const ComplexContent: Story = {
args: {
defaultOpen: true,
children: (
<div className="p-4 border border-border rounded-md bg-surface-secondary">
<h3 className="text-lg font-bold mb-2">Complex Content</h3>
<p className="mb-4">
This is a more complex content example with various elements.
</p>
<div className="flex gap-2">
<Button>Action 1</Button>
<Button>Action 2</Button>
</div>
</div>
),
},
};

export const LongLabel: Story = {
args: {
label:
"This is a very long label that might wrap or cause layout issues if not handled properly",
},
};
91 changes: 91 additions & 0 deletions site/src/components/CollapsibleSummary/CollapsibleSummary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { type VariantProps, cva } from "class-variance-authority";
import { ChevronRightIcon } from "lucide-react";
import { type FC, type ReactNode, useState } from "react";
import { cn } from "utils/cn";

const collapsibleSummaryVariants = cva(
`flex items-center gap-1 p-0 bg-transparent border-0 text-inherit cursor-pointer
transition-colors text-content-secondary hover:text-content-primary font-medium
whitespace-nowrap`,
{
variants: {
size: {
md: "text-sm",
sm: "text-xs",
},
},
defaultVariants: {
size: "md",
},
},
);

export interface CollapsibleSummaryProps
extends VariantProps<typeof collapsibleSummaryVariants> {
/**
* The label to display for the collapsible section
*/
label: string;
/**
* The content to show when expanded
*/
children: ReactNode;
/**
* Whether the section is initially expanded
*/
defaultOpen?: boolean;
/**
* Optional className for the button
*/
className?: string;
/**
* The size of the component
*/
size?: "md" | "sm";
}

export const CollapsibleSummary: FC<CollapsibleSummaryProps> = ({
label,
children,
defaultOpen = false,
className,
size,
}) => {
const [isOpen, setIsOpen] = useState(defaultOpen);

return (
<div className="flex flex-col gap-4">
<button
className={cn(
collapsibleSummaryVariants({ size }),
isOpen && "text-content-primary",
className,
)}
type="button"
onClick={() => {
setIsOpen((v) => !v);
}}
>
<div
className={cn(
"flex items-center justify-center transition-transform duration-200",
isOpen ? "rotate-90" : "rotate-0",
)}
>
<ChevronRightIcon
className={cn(
"p-0.5",
size === "sm" ? "size-icon-xs" : "size-icon-sm",
)}
/>
</div>
<span className="sr-only">
({isOpen ? "Hide" : "Show"}) {label}
</span>
<span className="[&:first-letter]:uppercase">{label}</span>
</button>

{isOpen && <div className="flex flex-col gap-4">{children}</div>}
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Checkbox from "@mui/material/Checkbox";
import Tooltip from "@mui/material/Tooltip";
import type { SlimRole } from "api/typesGenerated";
import { Button } from "components/Button/Button";
import { CollapsibleSummary } from "components/CollapsibleSummary/CollapsibleSummary";
import {
HelpTooltip,
HelpTooltipContent,
Expand Down Expand Up @@ -159,41 +160,18 @@ export const EditRolesButton: FC<EditRolesButtonProps> = ({
/>
))}
{advancedRoles.length > 0 && (
<>
<button
className={cn([
"flex items-center gap-1 p-0 bg-transparent border-0 text-inherit text-sm cursor-pointer",
"transition-colors text-content-secondary hover:text-content-primary font-medium whitespace-nowrap",
isAdvancedOpen && "text-content-primary",
])}
type="button"
onClick={() => {
setIsAdvancedOpen((v) => !v);
}}
>
{isAdvancedOpen ? (
<ChevronDownIcon className="size-icon-sm p-0.5" />
) : (
<ChevronRightIcon className="size-icon-sm p-0.5" />
)}
<span className="sr-only">
({isAdvancedOpen ? "Hide" : "Show advanced"})
</span>
<span className="[&:first-letter]:uppercase">Advanced</span>
</button>

{isAdvancedOpen &&
advancedRoles.map((role) => (
<Option
key={role.name}
onChange={handleChange}
isChecked={selectedRoleNames.has(role.name)}
value={role.name}
name={role.display_name || role.name}
description={roleDescriptions[role.name] ?? ""}
/>
))}
</>
<CollapsibleSummary label="advanced" defaultOpen={isAdvancedOpen}>
{advancedRoles.map((role) => (
<Option
key={role.name}
onChange={handleChange}
isChecked={selectedRoleNames.has(role.name)}
value={role.name}
name={role.display_name || role.name}
description={roleDescriptions[role.name] ?? ""}
/>
))}
</CollapsibleSummary>
)}
</div>
</fieldset>
Expand Down
Loading