feat(desktop): add Projects as first-class top-level view (#546)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Wes
2026-05-12 10:51:09 -07:00
committed by GitHub
parent 6b4f9f05d4
commit ef5fdca792
17 changed files with 692 additions and 19 deletions

View File

@@ -19,6 +19,7 @@ export const KIND_TYPING_INDICATOR = 20002;
export const KIND_READ_STATE = 30078;
export const KIND_USER_STATUS = 30315;
export const KIND_AGENT_OBSERVER_FRAME = 24200;
export const KIND_REPO_ANNOUNCEMENT = 30617;
const CHANNEL_MESSAGE_EVENT_KINDS = [
KIND_STREAM_MESSAGE,

View File

@@ -0,0 +1,15 @@
/**
* Returns true when the given string is a valid HTTP or HTTPS URL.
*
* Use this to gate any user-supplied URL before rendering it as an `<a href>`,
* opening it in a browser, or embedding it in an iframe.
*/
export function isSafeUrl(url: string | undefined): url is string {
if (!url) return false;
try {
const parsed = new URL(url);
return parsed.protocol === "http:" || parsed.protocol === "https:";
} catch {
return false;
}
}

View File

@@ -7,6 +7,7 @@ type ViewLoadingFallbackKind =
| "agents"
| "channel"
| "forum"
| "projects"
| "pulse"
| "workflows";
@@ -133,7 +134,7 @@ function AgentsLoadingBody() {
);
}
function WorkflowsLoadingBody() {
function CardListLoadingBody() {
return (
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto p-4">
<div className="mb-4 flex items-center justify-between gap-3">
@@ -235,7 +236,8 @@ export function ViewLoadingFallback({
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden">
{includeHeader ? <LoadingHeaderSkeleton /> : null}
{kind === "agents" ? <AgentsLoadingBody /> : null}
{kind === "workflows" ? <WorkflowsLoadingBody /> : null}
{kind === "workflows" ? <CardListLoadingBody /> : null}
{kind === "projects" ? <CardListLoadingBody /> : null}
{kind === "channel" ? <ChannelLoadingBody /> : null}
{kind === "forum" ? <ForumLoadingBody /> : null}
{kind === "pulse" ? <ChannelLoadingBody /> : null}