mirror of
https://github.com/block/buzz.git
synced 2026-11-12 12:22:06 +00:00
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:
@@ -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,
|
||||
|
||||
15
desktop/src/shared/lib/url.ts
Normal file
15
desktop/src/shared/lib/url.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user