(null);
if (!logo || failedUrl === logo) {
+ if (fallback) return fallback;
return name ? : ;
}
@@ -47,7 +64,9 @@ export function PluginLogo({
src={logo}
className={cn("size-6 object-contain", LOGO_TILE)}
referrerPolicy="no-referrer"
- loading="lazy"
+ // Eager: in WebKit a lazy logo sometimes never starts loading and fires no error, so the
+ // tile stayed blank and the fallback never ran. A 24px mark gains nothing from waiting.
+ loading="eager"
onError={() => setFailedUrl(logo)}
/>
);
diff --git a/app/src/components/settings/github-sources.tsx b/app/src/components/settings/github-sources.tsx
index 59574f374f..475f41f9a3 100644
--- a/app/src/components/settings/github-sources.tsx
+++ b/app/src/components/settings/github-sources.tsx
@@ -1,4 +1,9 @@
-import { IconBrandGithub, IconPlus } from "@/components/icons";
+import {
+ IconBrandGithub,
+ IconCheck,
+ IconChevronDown,
+ IconPlus,
+} from "@/components/icons";
import { useMutation, useQuery } from "@tanstack/react-query";
import { Fragment, useId, useState } from "react";
import {
@@ -6,7 +11,13 @@ import {
PageRows,
PageSection,
} from "@/components/layout/page-shell";
+import { copyText } from "@/components/settings/linked-accounts";
import { Button } from "@/components/ui/button";
+import {
+ Collapsible,
+ CollapsibleContent,
+ CollapsibleTrigger,
+} from "@/components/ui/collapsible";
import {
Dialog,
DialogBody,
@@ -22,7 +33,7 @@ import {
Item,
ItemActions,
ItemContent,
- ItemDescription,
+ ItemFooter,
ItemMedia,
ItemTitle,
} from "@/components/ui/item";
@@ -55,9 +66,10 @@ export function GithubSources() {
Add a repository
}
- description="Add a repository here, then add a webhook in GitHub with the address below and the same secret. Its events, like issues.opened, can then start work on a goal."
+ description="Events from these repositories, like issues.opened, can start work on a goal."
title="Repositories"
>
+
{error ? (
{failureSaid(error)}
@@ -82,28 +94,12 @@ export function GithubSources() {
{bindings.data.map((binding, index) => (
{index > 0 ? : null}
- -
-
-
-
-
- {binding.repository}
-
- {window.location.origin}
- {binding.webhookPath}
-
-
-
-
-
-
+ remove.mutate(binding.id)}
+ removing={remove.isPending}
+ repository={binding.repository}
+ />
))}
@@ -113,6 +109,106 @@ export function GithubSources() {
);
}
+/**
+ * The steps to connect a repository's events, folded away: they are read once, when a repository
+ * is added, and then they only pushed the rows down.
+ */
+function HowToSetUp() {
+ return (
+
+ }
+ >
+ How to set up
+
+
+
+
+ - Add a repository here, with a webhook secret.
+ - Copy its webhook address.
+ -
+ In GitHub, add a webhook to the repository with that address and the
+ same secret.
+
+
+
+
+ );
+}
+
+/**
+ * One repository: Copy webhook address and Remove. The address used to be drawn in full on the row,
+ * a long raw address nobody reads, so one press copies it.
+ *
+ * Where the copy fails (OpenBot served over plain http has no clipboard), the row says so and shows
+ * the address on a line of its own, the row's full width, selected with one click. "Copied" is
+ * said to a screen reader too, since the button's own words change only on screen.
+ */
+function RepositoryRow({
+ address,
+ repository,
+ removing,
+ onRemove,
+}: {
+ address: string;
+ repository: string;
+ removing: boolean;
+ onRemove: () => void;
+}) {
+ const [copied, setCopied] = useState(null);
+ return (
+ -
+
+
+
+
+ {repository}
+
+
+
+
+ {copied ? "Copied" : ""}
+
+ {/* Remove, not Disconnect: Disconnect is the account's, above. */}
+
+
+ {copied === false ? (
+
+
+ Couldn't copy. Select the address and copy it yourself.
+
+
+ {address}
+
+
+ ) : null}
+
+ );
+}
+
/**
* A repository and the webhook secret GitHub will sign its events with.
*/
diff --git a/app/src/components/settings/linked-accounts.tsx b/app/src/components/settings/linked-accounts.tsx
index e398a3d0a0..b457d61256 100644
--- a/app/src/components/settings/linked-accounts.tsx
+++ b/app/src/components/settings/linked-accounts.tsx
@@ -1,4 +1,9 @@
-import { IconBrandGithub, IconBrandSlack, IconLink } from "@/components/icons";
+import {
+ IconBrandGithub,
+ IconBrandSlack,
+ IconCheck,
+ IconLink,
+} from "@/components/icons";
import { useMutation, useQuery } from "@tanstack/react-query";
import { useEffect, useState } from "react";
import {
@@ -381,8 +386,25 @@ function LinkedAccountRow({ account }: { account: LinkedAccount }) {
- {account.title}
- {linkedAccountDescription(account)}
+ {/* Connected says so in words, with the check the Apps tile shows beside it. */}
+ {account.status === "needs_reconnect" ? (
+ <>
+ {account.title}
+
+ {linkedAccountDescription(account)}
+
+ >
+ ) : (
+ <>
+
+
+ {account.title} account connected
+
+ {account.handle ? (
+ @{account.handle}
+ ) : null}
+ >
+ )}