Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/renderer/components/BrowserPreviewSettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function BrowserPreviewSettingsCard() {
const { settings, updateSettings, isLoading, isSaving } = useAppSettings();

return (
<div className="flex items-center justify-between gap-4">
<div id="browser-preview-settings-card" className="flex items-center justify-between gap-4">
<div className="flex flex-1 flex-col gap-0.5">
<span className="text-sm font-medium text-foreground">Show localhost links in browser</span>
<span className="text-sm text-muted-foreground">
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/DefaultAgentSettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const DefaultAgentSettingsCard: React.FC = () => {
};

return (
<div className="flex items-center justify-between gap-4">
<div id="default-agent-settings-card" className="flex items-center justify-between gap-4">
<div className="flex flex-1 flex-col gap-0.5">
<p className="text-sm font-medium text-foreground">Default agent</p>
<p className="text-sm text-muted-foreground">
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/components/HiddenToolsSettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export default function HiddenToolsSettingsCard() {
}, [availability, labels]);

return (
<div className="rounded-xl border border-border/60 bg-muted/10 p-2">
<div
id="hidden-tools-settings-card"
className="rounded-xl border border-border/60 bg-muted/10 p-2"
>
<div className="space-y-2">
{sortedApps.map((app) => {
const isDetected = availability[app.id] ?? app.alwaysAvailable ?? false;
Expand Down
56 changes: 27 additions & 29 deletions src/renderer/components/IntegrationsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { useModalContext } from '../contexts/ModalProvider';
import GitLabSetupForm from './integrations/GitLabSetupForm';
import ForgejoSetupForm from './integrations/ForgejoSetupForm';
import { GithubDeviceFlowModal } from './GithubDeviceFlowModal';
import { INTEGRATION_REGISTRY, type IntegrationId } from './integrations/registry';

/** Light mode: original SVG colors. Dark / dark-black: primary colour. */
const SvgLogo = ({ raw }: { raw: string }) => {
Expand Down Expand Up @@ -472,21 +473,27 @@ const IntegrationsCard: React.FC = () => {
}
}, []);

const integrations = [
// Runtime state per integration. Static metadata (name/description/order)
// lives in INTEGRATION_REGISTRY so it can be shared with the settings
// search index.
const integrationRuntime: Record<
IntegrationId,
{
id: 'github',
name: 'GitHub',
description: 'Connect your repositories',
logoSvg: string;
connected: boolean;
loading: boolean;
onConnect: () => void;
onDisconnect: () => void;
}
> = {
github: {
logoSvg: githubSvg,
connected: authenticated,
loading: isLoading,
onConnect: handleGithubConnect,
onDisconnect: handleGithubDisconnect,
},
{
id: 'linear',
name: 'Linear',
description: 'Work on Linear tickets',
linear: {
logoSvg: linearSvg,
connected: linearConnected,
loading: linearLoading,
Expand All @@ -496,10 +503,7 @@ const IntegrationsCard: React.FC = () => {
},
onDisconnect: handleLinearDisconnect,
},
{
id: 'jira',
name: 'Jira',
description: 'Work on Jira tickets',
jira: {
logoSvg: jiraSvg,
connected: jiraConnected,
loading: jiraLoading,
Expand All @@ -509,10 +513,7 @@ const IntegrationsCard: React.FC = () => {
},
onDisconnect: handleJiraDisconnect,
},
{
id: 'gitlab',
name: 'GitLab',
description: 'Work on GitLab issues',
gitlab: {
logoSvg: gitlabSvg,
connected: gitlabConnected,
loading: gitlabLoading,
Expand All @@ -522,10 +523,7 @@ const IntegrationsCard: React.FC = () => {
},
onDisconnect: handleGitlabDisconnect,
},
{
id: 'plain',
name: 'Plain',
description: 'Work on support threads',
plain: {
logoSvg: plainSvg,
connected: plainConnected,
loading: plainLoading,
Expand All @@ -535,10 +533,7 @@ const IntegrationsCard: React.FC = () => {
},
onDisconnect: handlePlainDisconnect,
},
{
id: 'forgejo',
name: 'Forgejo',
description: 'Work on Forgejo issues',
forgejo: {
logoSvg: forgejoSvg,
connected: forgejoConnected,
loading: forgejoLoading,
Expand All @@ -548,10 +543,7 @@ const IntegrationsCard: React.FC = () => {
},
onDisconnect: handleForgejoDisconnect,
},
{
id: 'sentry',
name: 'Sentry',
description: 'Fix errors from Sentry',
sentry: {
logoSvg: sentrySvg,
connected: sentryConnected,
loading: sentryLoading,
Expand All @@ -561,11 +553,17 @@ const IntegrationsCard: React.FC = () => {
},
onDisconnect: handleSentryDisconnect,
},
];
};

const integrations = INTEGRATION_REGISTRY.map((entry) => ({
...entry,
...integrationRuntime[entry.id as IntegrationId],
}));

return (
<>
<div
id="integrations-card"
className="grid gap-3"
style={{ gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))' }}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/KeyboardSettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ const KeyboardSettingsCard: React.FC = () => {
};

return (
<div className="rounded-xl border border-border/60 bg-muted/10 p-4">
<div id="keyboard-settings-card" className="rounded-xl border border-border/60 bg-muted/10 p-4">
<div className="space-y-4">
{CONFIGURABLE_SHORTCUTS.map((shortcut) => (
<div key={shortcut.id} className="flex items-center justify-between gap-2">
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/NotificationSettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const NotificationSettingsCard: React.FC = () => {
};

return (
<div className="flex flex-col gap-4">
<div id="notification-settings-card" className="flex flex-col gap-4">
{/* Master toggle */}
<div className="flex items-center justify-between gap-4">
<div className="flex flex-1 flex-col gap-0.5">
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/RepositorySettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const RepositorySettingsCard: React.FC = () => {
}, [repository?.branchPrefix]);

return (
<div className="grid gap-8">
<div id="repository-settings-card" className="grid gap-8">
<div className="grid gap-2">
<Input
defaultValue={repository?.branchPrefix ?? DEFAULTS.branchPrefix}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/ResourceMonitorSettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ResourceMonitorSettingsCard: React.FC = () => {
const showResourceMonitor = settings?.interface?.showResourceMonitor ?? false;

return (
<div className="flex items-center justify-between gap-4">
<div id="resource-monitor-settings-card" className="flex items-center justify-between gap-4">
<div className="flex flex-1 flex-col gap-0.5">
<span className="text-sm font-medium text-foreground">
Show resource monitor in titlebar
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/components/ReviewAgentSettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ const ReviewAgentSettingsCard: React.FC = () => {
};

return (
<div className="flex flex-col gap-4 rounded-xl border border-muted p-4">
<div
id="review-agent-settings-card"
className="flex flex-col gap-4 rounded-xl border border-muted p-4"
>
<div className="flex items-start justify-between gap-4">
<div className="flex flex-1 flex-col gap-0.5">
<p className="text-sm font-medium text-foreground">Review preset</p>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/RightSidebarSettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const RightSidebarSettingsCard: React.FC = () => {
const autoRightSidebarBehavior = interfaceSettings?.autoRightSidebarBehavior ?? false;

return (
<div className="flex items-center justify-between gap-4">
<div id="right-sidebar-settings-card" className="flex items-center justify-between gap-4">
<div className="flex flex-1 flex-col gap-0.5">
<span className="text-sm font-medium text-foreground">
Auto-collapse right sidebar on home pages
Expand Down
Loading
Loading