Skip to content
Open
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
132 changes: 0 additions & 132 deletions src/app/(app)/auto-triage/AutoTriagePageClient.tsx

This file was deleted.

13 changes: 3 additions & 10 deletions src/app/(app)/auto-triage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import { getUserFromAuthOrRedirect } from '@/lib/user.server';
import { AutoTriagePageClient } from './AutoTriagePageClient';
import { AutoTriagePageClient } from '@/components/auto-triage/AutoTriagePageClient';

type AutoTriagePageProps = {
searchParams: Promise<{ success?: string; error?: string }>;
};

export default async function PersonalAutoTriagePage({ searchParams }: AutoTriagePageProps) {
const search = await searchParams;
const user = await getUserFromAuthOrRedirect('/users/sign_in?callbackPath=/auto-triage');
await getUserFromAuthOrRedirect('/users/sign_in?callbackPath=/auto-triage');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user wasn't being used in the Page component at all.


return (
<AutoTriagePageClient
userId={user.id}
userName={user.google_user_name}
successMessage={search.success}
errorMessage={search.error}
/>
);
return <AutoTriagePageClient successMessage={search.success} errorMessage={search.error} />;
}
2 changes: 1 addition & 1 deletion src/app/(app)/organizations/[id]/auto-triage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OrganizationByPageLayout } from '@/components/organizations/OrganizationByPageLayout';
import { AutoTriagePageClient } from './AutoTriagePageClient';
import { AutoTriagePageClient } from '@/components/auto-triage/AutoTriagePageClient';

type AutoTriagePageProps = {
params: Promise<{ id: string }>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { useQuery } from '@tanstack/react-query';
import Link from 'next/link';

type AutoTriagePageClientProps = {
organizationId: string;
organizationName: string;
organizationId?: string;
organizationName?: string;
successMessage?: string;
errorMessage?: string;
};
Expand All @@ -30,13 +30,21 @@ export function AutoTriagePageClient({

// Fetch GitHub App installation status
const { data: statusData, isLoading: isStatusLoading } = useQuery(
trpc.organizations.autoTriage.getGitHubStatus.queryOptions({
organizationId,
})
organizationId
? trpc.organizations.autoTriage.getGitHubStatus.queryOptions({ organizationId })
: trpc.personalAutoTriage.getGitHubStatus.queryOptions()
);

const isGitHubAppInstalled = statusData?.connected && statusData?.integration?.isValid;

const githubIntegrationsHref = organizationId
? `/organizations/${organizationId}/integrations/github`
: '/integrations/github';

const subtitle = organizationName
? `Automatically triage GitHub issues with AI-powered analysis for ${organizationName}`
: 'Automatically triage GitHub issues with AI-powered analysis';

// Show toast messages from URL params
useEffect(() => {
if (successMessage === 'github_connected') {
Expand All @@ -55,13 +63,11 @@ export function AutoTriagePageClient({
<div className="space-y-2">
<div className="flex items-center gap-2">
<h1 className="text-3xl font-bold">Auto Triage</h1>
<Badge variant="new">new</Badge>
<Badge variant="beta">beta</Badge>
</div>
<p className="text-muted-foreground">
Automatically triage GitHub issues with AI-powered analysis for {organizationName}
</p>
<p className="text-muted-foreground">{subtitle}</p>
<a
href="https://kilo.ai/docs/advanced-usage/auto-triage"
href="https://kilo.ai/docs/automate/auto-triage/overview"
target="_blank"
rel="noopener noreferrer"
className="mt-2 inline-flex items-center gap-1 text-sm text-blue-400 hover:text-blue-300"
Expand All @@ -81,7 +87,7 @@ export function AutoTriagePageClient({
The Kilo GitHub App must be installed to use Auto Triage. The app automatically
manages workflows and triggers triage on your issues.
</p>
<Link href={`/organizations/${organizationId}/integrations/github`}>
<Link href={githubIntegrationsHref}>
<Button variant="default" size="sm">
Install GitHub App
<ExternalLink className="ml-2 h-3 w-3" />
Expand Down