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
10 changes: 10 additions & 0 deletions apps/desktop/src/lib/trpc/routers/device.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { getHostId } from "@superset/shared/host-info";
import { publicProcedure, router } from "..";

export const createDeviceRouter = () => {
return router({
getMachineId: publicProcedure.query((): { machineId: string } => {
return { machineId: getHostId() };
}),
});
};
2 changes: 2 additions & 0 deletions apps/desktop/src/lib/trpc/routers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { createChatRuntimeServiceRouter } from "./chat-runtime-service";
import { createChatServiceRouter } from "./chat-service";
import { createConfigRouter } from "./config";
import { createDatabasesRouter } from "./databases";
import { createDeviceRouter } from "./device";
import { createDiagnosticsRouter } from "./diagnostics";
import { createDockerRouter } from "./docker";
import { createExtensionsRouter } from "./extensions";
Expand Down Expand Up @@ -82,6 +83,7 @@ export const createAppRouter = (
settings: createSettingsRouter(),
config: createConfigRouter(),
databases: createDatabasesRouter(),
device: createDeviceRouter(),
diagnostics: createDiagnosticsRouter(),
docker: createDockerRouter(),
uiState: createUiStateRouter(),
Expand Down
9 changes: 9 additions & 0 deletions apps/desktop/src/renderer/hooks/useIsV2CloudEnabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { FEATURE_FLAGS } from "@superset/shared/constants";
import { useFeatureFlagEnabled } from "posthog-js/react";
import { useV2LocalOverrideStore } from "renderer/stores/v2-local-override";

const IS_DEV = process.env.NODE_ENV === "development";

/**
* Returns effective v2 state: remote PostHog flag AND local opt-in.
* Also returns the raw remote flag so the toggle can be shown conditionally.
Expand All @@ -11,6 +13,13 @@ export function useIsV2CloudEnabled() {
useFeatureFlagEnabled(FEATURE_FLAGS.V2_CLOUD) ?? false;
const optInV2 = useV2LocalOverrideStore((s) => s.optInV2);

if (IS_DEV) {
return {
isV2CloudEnabled: true,
isRemoteV2Enabled: true,
};
}

return {
/** The effective value — use this wherever you previously checked the flag directly. */
isV2CloudEnabled: remoteV2Enabled && optInV2,
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/renderer/lib/host-service-client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AppRouter } from "@superset/host-service";
import { createTRPCClient, httpBatchLink } from "@trpc/client";
import { createTRPCClient, httpLink } from "@trpc/client";
import superjson from "superjson";
import { getHostServiceHeaders } from "./host-service-auth";

Expand All @@ -20,7 +20,7 @@ export function getHostServiceClientByUrl(hostUrl: string): HostServiceClient {

const client = createTRPCClient<AppRouter>({
links: [
httpBatchLink({
httpLink({
url: `${hostUrl}/trpc`,
transformer: superjson,
headers: () => getHostServiceHeaders(hostUrl),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { COMPANY } from "@superset/shared/constants";
import { Avatar } from "@superset/ui/atoms/Avatar";
import { Badge } from "@superset/ui/badge";
import {
DropdownMenu,
DropdownMenuContent,
Expand Down Expand Up @@ -27,6 +28,7 @@ import {
} from "react-icons/hi2";
import { IoBugOutline } from "react-icons/io5";
import { LuKeyboard } from "react-icons/lu";
import { useCurrentPlan } from "renderer/hooks/useCurrentPlan";
import { useHotkeyDisplay } from "renderer/hotkeys";
import { authClient } from "renderer/lib/auth-client";
import { electronTrpc } from "renderer/lib/electron-trpc";
Expand Down Expand Up @@ -69,6 +71,18 @@ export function OrganizationDropdown({
const userName = session?.user?.name;
const displayName = activeOrganization?.name ?? userName ?? "Organization";

const currentPlan = useCurrentPlan();
const isPaid = currentPlan !== "free";
const planLabel = currentPlan.charAt(0).toUpperCase() + currentPlan.slice(1);
const planBadge = isPaid ? (
<Badge
variant="default"
className="px-1 py-0 text-[9px] leading-none uppercase tracking-wide h-3.5"
>
{planLabel}
</Badge>
) : null;

const triggerButton =
variant === "collapsed" ? (
<button
Expand Down Expand Up @@ -96,6 +110,7 @@ export function OrganizationDropdown({
className="rounded size-4 shrink-0"
/>
<span className="truncate">{displayName}</span>
{planBadge}
<HiChevronUpDown className="h-3.5 w-3.5 text-muted-foreground shrink-0" />
</button>
) : (
Expand All @@ -113,6 +128,7 @@ export function OrganizationDropdown({
<span className="text-xs font-medium truncate max-w-32">
{displayName}
</span>
{planBadge}
<HiChevronUpDown className="h-3.5 w-3.5 text-muted-foreground shrink-0" />
</button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function SessionSelector({
<button
type="button"
title={currentTitle}
className="flex min-w-0 flex-1 items-center gap-1 rounded px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
className="flex w-full min-w-0 flex-1 items-center gap-1 rounded px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
>
<HiMiniChevronDown className="size-3 shrink-0" />
<span className="min-w-0 flex-1 truncate text-left">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ export function ChatPaneInterface({

return (
<PromptInputProvider initialInput={initialLaunchConfig?.draftInput}>
<div className="flex h-full flex-col bg-background">
<div className="flex h-full w-full flex-col bg-background">
<ChatMessageList
messages={visibleMessages}
isFocused={isFocused}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function DiffFileHeader({
const viewedId = useId();

return (
<div className="@container/diff-file-header flex min-w-0 flex-wrap items-center justify-between gap-1 px-2 py-1.5">
<div className="@container/diff-file-header flex min-w-0 flex-wrap items-center gap-1 px-2 py-1.5">
<button
type="button"
onClick={onToggleCollapsed}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const markdownPreviewView: FileView = {
id: "markdown-preview",
label: "Preview",
match: (filePath) => isMarkdownFile(filePath),
priority: "option",
priority: "default",
documentKind: "text",
Renderer: MarkdownPreviewView,
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { MOCK_ORG_ID } from "shared/constants";
import { useCollections } from "../CollectionsProvider";

interface LocalHostServiceContextValue {
machineId: string | null;
machineId: string;
activeHostUrl: string | null;
}

Expand Down Expand Up @@ -51,27 +51,34 @@ export function LocalHostServiceProvider({
}
}, [organizationIds, startHostService]);

const { data: machineIdData } = electronTrpc.device.getMachineId.useQuery(
undefined,
{ staleTime: Number.POSITIVE_INFINITY },
);

const { data: activeConnection } =
electronTrpc.hostServiceCoordinator.getConnection.useQuery(
{ organizationId: activeOrganizationId as string },
{ enabled: !!activeOrganizationId, refetchInterval: 5_000 },
);

const value = useMemo(() => {
const value = useMemo<LocalHostServiceContextValue | null>(() => {
if (!machineIdData) return null;
const machineId = machineIdData.machineId;

if (!activeConnection?.port) {
return { machineId: null, activeHostUrl: null };
return { machineId, activeHostUrl: null };
}

const activeHostUrl = `http://127.0.0.1:${activeConnection.port}`;
if (activeConnection.secret) {
setHostServiceSecret(activeHostUrl, activeConnection.secret);
}

return {
machineId: activeConnection.machineId ?? null,
activeHostUrl,
};
}, [activeConnection]);
return { machineId, activeHostUrl };
}, [machineIdData, activeConnection]);

if (!value) return null;

return (
<LocalHostServiceContext.Provider value={value}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Badge } from "@superset/ui/badge";
import { Button } from "@superset/ui/button";
import { toast } from "@superset/ui/sonner";
import { Switch } from "@superset/ui/switch";
Expand Down Expand Up @@ -49,7 +50,7 @@ type ComparisonValue = string | boolean | null;
type ComparisonRow = {
label: string;
values: ComparisonValue[];
comingSoon?: boolean;
badge?: { label: string; variant: "default" | "secondary" };
};

type ComparisonSection = {
Expand Down Expand Up @@ -135,18 +136,22 @@ const COMPARISON_SECTIONS: ComparisonSection[] = [
values: [true, true, true],
},
{
label: "GitHub integration",
values: [true, true, true],
label: "Remote workspaces",
values: [null, true, true],
badge: { label: "Beta", variant: "default" },
},
{
label: "Cloud workspaces",
label: "Automations",
values: [null, true, true],
comingSoon: true,
},
{
label: "Mobile app",
values: [null, true, true],
comingSoon: true,
badge: { label: "Coming soon", variant: "secondary" },
},
{
label: "GitHub integration",
values: [true, true, true],
},
{
label: "Linear integration",
Expand Down Expand Up @@ -583,10 +588,13 @@ function PlansPage() {
<Fragment key={row.label}>
<div className="flex items-center gap-1.5 px-2 py-2.5 text-xs text-muted-foreground">
{row.label}
{row.comingSoon && (
<span className="text-[10px] text-muted-foreground/60">
(Coming Soon)
</span>
{row.badge && (
<Badge
variant={row.badge.variant}
className="px-1.5 py-0 text-[10px] font-medium"
>
{row.badge.label}
</Badge>
)}
</div>
{row.values.map((value, valueIndex) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function ProjectLocationSection({
(q) =>
q
.from({ hosts: collections.v2Hosts })
.where(({ hosts }) => eq(hosts.machineId, machineId ?? ""))
.where(({ hosts }) => eq(hosts.machineId, machineId))
.select(({ hosts }) => ({
name: hosts.name,
isOnline: hosts.isOnline,
Expand Down
8 changes: 8 additions & 0 deletions apps/marketing/public/logos/runway-wordmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ const CLIENT_LOGOS = [
height: 20,
},
{
name: "perplexity",
label: "Perplexity",
logo: "/logos/perplexity-wordmark.svg",
height: 28,
name: "runway",
label: "Runway",
logo: "/logos/runway-wordmark.svg",
height: 18,
invert: false,
},
{
name: "salesforce",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function DesktopRow({ row }: { row: ComparisonRow }) {
<td className="py-4 pr-4 text-sm text-foreground">
<div className="flex items-center gap-2">
<span>{row.label}</span>
{row.comingSoon && <ComingSoonBadge />}
{row.badge && <RowBadge badge={row.badge} />}
</div>
</td>
{row.values.map((value, index) => (
Expand Down Expand Up @@ -143,7 +143,7 @@ function MobileTable() {
>
<div className="flex items-center gap-2 text-sm text-foreground">
<span>{row.label}</span>
{row.comingSoon && <ComingSoonBadge />}
{row.badge && <RowBadge badge={row.badge} />}
</div>
<div className="shrink-0 text-sm text-foreground">
<Cell value={row.values[selectedIndex] ?? null} />
Expand Down Expand Up @@ -173,14 +173,18 @@ function Cell({ value }: { value: ComparisonRow["values"][number] }) {
return <span>{value}</span>;
}

function ComingSoonBadge() {
function RowBadge({ badge }: { badge: NonNullable<ComparisonRow["badge"]> }) {
const isPrimary = badge.variant === "default";
return (
<span
className={cn(
"rounded-sm bg-accent/40 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",
"rounded-sm px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide",
isPrimary
? "bg-foreground text-background"
: "bg-accent/40 text-muted-foreground",
)}
>
Coming soon
{badge.label}
</span>
);
}
16 changes: 6 additions & 10 deletions apps/marketing/src/app/pricing/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface ComparisonRow {
string | boolean | null,
string | boolean | null,
];
comingSoon?: boolean;
badge?: { label: string; variant: "default" | "secondary" };
}

export interface ComparisonSection {
Expand All @@ -134,22 +134,18 @@ export const COMPARISON_SECTIONS: ComparisonSection[] = [
rows: [
{ label: "Desktop app", values: [true, true, true] },
{ label: "Local workspaces", values: [true, true, true] },
{ label: "GitHub integration", values: [true, true, true] },
{
label: "CLI",
values: [true, true, true],
comingSoon: true,
},
{
label: "Remote workspaces",
values: [null, true, true],
comingSoon: true,
badge: { label: "Beta", variant: "default" },
},
{ label: "Automations", values: [null, true, true] },
{
label: "Mobile",
label: "Mobile app",
values: [null, true, true],
comingSoon: true,
badge: { label: "Coming soon", variant: "secondary" },
},
{ label: "GitHub integration", values: [true, true, true] },
{ label: "Linear integration", values: [null, true, true] },
{ label: "Slack integration", values: [null, true, true] },
{ label: "Team collaboration", values: [null, true, true] },
Expand Down
Loading
Loading