Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions codersdk/toolsdk/toolsdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,10 @@ func TestMain(m *testing.M) {
var untested []string
for _, tool := range toolsdk.All {
if tested, ok := testedTools.Load(tool.Name); !ok || !tested.(bool) {
// Test is skipped on Windows
if runtime.GOOS == "windows" && tool.Name == "coder_workspace_bash" {
continue
}
untested = append(untested, tool.Name)
}
}
Expand Down
10 changes: 1 addition & 9 deletions docs/user-guides/desktop/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ Coder Desktop requires a Coder deployment running [v2.20.0](https://github.com/c

## Install Coder Desktop

> [!IMPORTANT]
> Coder Desktop can't connect through a corporate VPN.
>
> Due to a [known issue](#coder-desktop-cant-connect-through-another-vpn),
> if your Coder deployment requires that you connect through a corporate VPN, Desktop will timeout when it tries to connect.

<div class="tabs">

You can install Coder Desktop on macOS or Windows.
Expand Down Expand Up @@ -144,9 +138,7 @@ To avoid system VPN configuration conflicts, only one copy of `Coder Desktop.app
If the logged in Coder deployment requires a corporate VPN to connect, Coder Connect can't establish communication
through the VPN, and will time out.

This is due to known issues with [macOS](https://github.com/coder/coder-desktop-macos/issues/201) and
[Windows](https://github.com/coder/coder-desktop-windows/issues/147) networking.
A resolution is in progress.
This issue has been fixed in Coder v2.24.3 and later. For macOS clients, Coder Desktop v0.8.0 or later is also required.

## Next Steps

Expand Down
11 changes: 9 additions & 2 deletions site/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ function withHelmet(Story) {
);
}

/**
* This JSX file isn't part of the main project, so it doesn't get to use the
* ambient types defined in `storybook.d.ts` to provide extra type-safety.
* Extracting main key to avoid typos.
*/
const queryParametersKey = "queries";

/** @type {Decorator} */
function withQuery(Story, { parameters }) {
const queryClient = new QueryClient({
Expand All @@ -112,8 +119,8 @@ function withQuery(Story, { parameters }) {
},
});

if (parameters.queries) {
for (const query of parameters.queries) {
if (parameters[queryParametersKey]) {
for (const query of parameters[queryParametersKey]) {
queryClient.setQueryData(query.key, query.data);
}
}
Expand Down
35 changes: 11 additions & 24 deletions site/src/api/queries/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,6 @@ export const templates = (
};
};

const getTemplatesByOrganizationQueryKey = (
organization: string,
options?: GetTemplatesOptions,
) => [organization, "templates", options?.deprecated];

const templatesByOrganization = (
organization: string,
options: GetTemplatesOptions = {},
) => {
return {
queryKey: getTemplatesByOrganizationQueryKey(organization, options),
queryFn: () => API.getTemplatesByOrganization(organization, options),
};
};

export const templateACL = (templateId: string) => {
return {
queryKey: ["templateAcl", templateId],
Expand Down Expand Up @@ -121,9 +106,11 @@ export const templateExamples = () => {
};
};

export const templateVersionRoot: string = "templateVersion";

export const templateVersion = (versionId: string) => {
return {
queryKey: ["templateVersion", versionId],
queryKey: [templateVersionRoot, versionId],
queryFn: () => API.getTemplateVersion(versionId),
};
};
Expand All @@ -134,7 +121,7 @@ export const templateVersionByName = (
versionName: string,
) => {
return {
queryKey: ["templateVersion", organizationId, templateName, versionName],
queryKey: [templateVersionRoot, organizationId, templateName, versionName],
queryFn: () =>
API.getTemplateVersionByName(organizationId, templateName, versionName),
};
Expand All @@ -153,7 +140,7 @@ export const templateVersions = (templateId: string) => {
};

export const templateVersionVariablesKey = (versionId: string) => [
"templateVersion",
templateVersionRoot,
versionId,
"variables",
];
Expand Down Expand Up @@ -216,7 +203,7 @@ export const templaceACLAvailable = (
};

const templateVersionExternalAuthKey = (versionId: string) => [
"templateVersion",
templateVersionRoot,
versionId,
"externalAuth",
];
Expand Down Expand Up @@ -257,21 +244,21 @@ const createTemplateFn = async (options: CreateTemplateOptions) => {

export const templateVersionLogs = (versionId: string) => {
return {
queryKey: ["templateVersion", versionId, "logs"],
queryKey: [templateVersionRoot, versionId, "logs"],
queryFn: () => API.getTemplateVersionLogs(versionId),
};
};

export const richParameters = (versionId: string) => {
return {
queryKey: ["templateVersion", versionId, "richParameters"],
queryKey: [templateVersionRoot, versionId, "richParameters"],
queryFn: () => API.getTemplateVersionRichParameters(versionId),
};
};

export const resources = (versionId: string) => {
return {
queryKey: ["templateVersion", versionId, "resources"],
queryKey: [templateVersionRoot, versionId, "resources"],
queryFn: () => API.getTemplateVersionResources(versionId),
};
};
Expand All @@ -293,7 +280,7 @@ export const previousTemplateVersion = (
) => {
return {
queryKey: [
"templateVersion",
templateVersionRoot,
organizationId,
templateName,
versionName,
Expand All @@ -313,7 +300,7 @@ export const previousTemplateVersion = (

export const templateVersionPresets = (versionId: string) => {
return {
queryKey: ["templateVersion", versionId, "presets"],
queryKey: [templateVersionRoot, versionId, "presets"],
queryFn: () => API.getTemplateVersionPresets(versionId),
};
};
Expand Down
8 changes: 4 additions & 4 deletions site/src/components/Abbr/Abbr.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const meta: Meta<typeof Abbr> = {
component: Abbr,
decorators: [
(Story) => (
<>
<div className="max-w-prose text-base">
<p>Try the following text out in a screen reader!</p>
<Story />
</>
</div>
),
],
};
Expand All @@ -25,9 +25,9 @@ export const InlinedShorthand: Story = {
},
decorators: [
(Story) => (
<p className="max-w-2xl">
<p>
The physical pain of getting bonked on the head with a cartoon mallet
lasts precisely 593{" "}
lasts precisely 593
<span className="underline decoration-dotted">
<Story />
</span>
Expand Down
61 changes: 34 additions & 27 deletions site/src/components/Abbr/Abbr.test.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
import { render, screen } from "@testing-library/react";
import { Abbr, type Pronunciation } from "./Abbr";
import { Abbr } from "./Abbr";

type AbbreviationData = {
abbreviation: string;
title: string;
expectedLabel: string;
};

type AssertionInput = AbbreviationData & {
pronunciation: Pronunciation;
};

function assertAccessibleLabel({
abbreviation,
title,
expectedLabel,
pronunciation,
}: AssertionInput) {
const { unmount } = render(
<Abbr title={title} pronunciation={pronunciation}>
{abbreviation}
</Abbr>,
);

screen.getByLabelText(expectedLabel, { selector: "abbr" });
unmount();
}

describe(Abbr.name, () => {
it("Has an aria-label that equals the title if the abbreviation is shorthand", () => {
it("Omits abbreviation from screen-reader output if it is shorthand", () => {
const sampleShorthands: AbbreviationData[] = [
{
abbreviation: "ms",
Expand All @@ -43,11 +23,22 @@ describe(Abbr.name, () => {
];

for (const shorthand of sampleShorthands) {
assertAccessibleLabel({ ...shorthand, pronunciation: "shorthand" });
const { unmount } = render(
<Abbr title={shorthand.title} pronunciation="shorthand">
{shorthand.abbreviation}
</Abbr>,
);

// The <abbr> element doesn't have any ARIA role semantics baked in,
// so we have to get a little bit more creative with making sure the
// expected content is on screen in an accessible way
const element = screen.getByTitle(shorthand.title);
expect(element).toHaveTextContent(shorthand.expectedLabel);
unmount();
}
});

it("Has an aria label with title and 'flattened' pronunciation if abbreviation is acronym", () => {
it("Adds title and 'flattened' pronunciation if abbreviation is acronym", () => {
const sampleAcronyms: AbbreviationData[] = [
{
abbreviation: "NASA",
Expand All @@ -67,11 +58,19 @@ describe(Abbr.name, () => {
];

for (const acronym of sampleAcronyms) {
assertAccessibleLabel({ ...acronym, pronunciation: "acronym" });
const { unmount } = render(
<Abbr title={acronym.title} pronunciation="acronym">
{acronym.abbreviation}
</Abbr>,
);

const element = screen.getByTitle(acronym.title);
expect(element).toHaveTextContent(acronym.expectedLabel);
unmount();
}
});

it("Has an aria label with title and initialized pronunciation if abbreviation is initialism", () => {
it("Adds title and initialized pronunciation if abbreviation is initialism", () => {
const sampleInitialisms: AbbreviationData[] = [
{
abbreviation: "FBI",
Expand All @@ -91,7 +90,15 @@ describe(Abbr.name, () => {
];

for (const initialism of sampleInitialisms) {
assertAccessibleLabel({ ...initialism, pronunciation: "initialism" });
const { unmount } = render(
<Abbr title={initialism.title} pronunciation="initialism">
{initialism.abbreviation}
</Abbr>,
);

const element = screen.getByTitle(initialism.title);
expect(element).toHaveTextContent(initialism.expectedLabel);
unmount();
}
});
});
20 changes: 12 additions & 8 deletions site/src/components/Abbr/Abbr.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { FC, HTMLAttributes } from "react";
import { cn } from "utils/cn";

export type Pronunciation = "shorthand" | "acronym" | "initialism";
type Pronunciation = "shorthand" | "acronym" | "initialism";

type AbbrProps = HTMLAttributes<HTMLElement> & {
children: string;
title: string;
pronunciation?: Pronunciation;
className?: string;
};

/**
Expand All @@ -22,23 +23,26 @@ export const Abbr: FC<AbbrProps> = ({
children,
title,
pronunciation = "shorthand",
className,
...delegatedProps
}) => {
return (
<abbr
// Title attributes usually aren't natively available to screen readers;
// always have to supplement with aria-label
// Adding title to make things a little easier for sighted users,
// but titles aren't always exposed via screen readers. Still have
// to inject the actual text content inside the abbr itself
title={title}
aria-label={getAccessibleLabel(children, title, pronunciation)}
className={cn(
"decoration-inherit",
children === children.toUpperCase()
? "tracking-wide"
: "tracking-normal",
"no-underline tracking-normal",
children === children.toUpperCase() && "tracking-wide",
className,
)}
{...delegatedProps}
>
<span aria-hidden>{children}</span>
<span className="sr-only">
{getAccessibleLabel(children, title, pronunciation)}
</span>
</abbr>
);
};
Expand Down
Loading
Loading