From 809975cb763edbc1d9d955a78573362acd57b9d1 Mon Sep 17 00:00:00 2001 From: null Date: Mon, 25 May 2026 17:07:09 -0500 Subject: [PATCH] pdated settings/git-projects/ --- .../src/app/settings/git-projects/page.tsx | 173 ++++++++++++++++-- frontend/src/app/settings/page.tsx | 26 +-- 2 files changed, 164 insertions(+), 35 deletions(-) diff --git a/frontend/src/app/settings/git-projects/page.tsx b/frontend/src/app/settings/git-projects/page.tsx index 004d227..77fdd27 100644 --- a/frontend/src/app/settings/git-projects/page.tsx +++ b/frontend/src/app/settings/git-projects/page.tsx @@ -28,6 +28,7 @@ import { useAuth } from "@/auth/clerk"; import { ForgejoConnectionsTable } from "@/components/git/ForgejoConnectionsTable"; import { ForgejoRepositoriesTable } from "@/components/git/ForgejoRepositoriesTable"; import { DashboardPageLayout } from "@/components/templates/DashboardPageLayout"; +import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { ConfirmActionDialog } from "@/components/ui/confirm-action-dialog"; import { @@ -37,6 +38,7 @@ import { DialogTitle, } from "@/components/ui/dialog"; import { getApiBaseUrl } from "@/lib/api-base"; +import { cn } from "@/lib/utils"; import { deleteForgejoConnection, deleteForgejoRepository, @@ -71,6 +73,72 @@ type AttentionItem = { href?: string; }; +type SettingsTone = "accent" | "success" | "warning" | "danger" | "neutral"; + +const toneStyles: Record< + SettingsTone, + { + panel: string; + icon: string; + rail: string; + text: string; + } +> = { + accent: { + panel: + "border-[color:rgba(96,165,250,0.24)] bg-[linear-gradient(145deg,rgba(96,165,250,0.1),var(--surface)_58%)]", + icon: "border-[color:rgba(96,165,250,0.3)] bg-[color:var(--accent-soft)] text-[color:var(--accent-strong)]", + rail: "bg-[linear-gradient(90deg,rgba(96,165,250,0),rgba(96,165,250,0.82),rgba(96,165,250,0))]", + text: "text-[color:var(--accent-strong)]", + }, + success: { + panel: + "border-[color:rgba(52,211,153,0.22)] bg-[linear-gradient(145deg,rgba(52,211,153,0.09),var(--surface)_58%)]", + icon: "border-[color:rgba(52,211,153,0.3)] bg-[color:rgba(52,211,153,0.14)] text-[color:var(--success)]", + rail: "bg-[linear-gradient(90deg,rgba(52,211,153,0),rgba(52,211,153,0.78),rgba(52,211,153,0))]", + text: "text-[color:var(--success)]", + }, + warning: { + panel: + "border-[color:rgba(251,191,36,0.24)] bg-[linear-gradient(145deg,rgba(251,191,36,0.09),var(--surface)_58%)]", + icon: "border-[color:rgba(251,191,36,0.32)] bg-[color:rgba(251,191,36,0.14)] text-[color:var(--warning)]", + rail: "bg-[linear-gradient(90deg,rgba(251,191,36,0),rgba(251,191,36,0.82),rgba(251,191,36,0))]", + text: "text-[color:var(--warning)]", + }, + danger: { + panel: + "border-[color:rgba(248,113,113,0.24)] bg-[linear-gradient(145deg,rgba(248,113,113,0.09),var(--surface)_58%)]", + icon: "border-[color:rgba(248,113,113,0.3)] bg-[color:rgba(248,113,113,0.12)] text-[color:var(--danger)]", + rail: "bg-[linear-gradient(90deg,rgba(248,113,113,0),rgba(248,113,113,0.78),rgba(248,113,113,0))]", + text: "text-[color:var(--danger)]", + }, + neutral: { + panel: + "border-[color:var(--border)] bg-[linear-gradient(180deg,rgba(255,255,255,0.035),rgba(255,255,255,0)_72%),var(--surface)]", + icon: "border-[color:var(--border-strong)] bg-[color:var(--surface-muted)] text-muted", + rail: "bg-[linear-gradient(90deg,rgba(96,165,250,0),rgba(96,165,250,0.28),rgba(52,211,153,0.2),rgba(96,165,250,0))]", + text: "text-muted", + }, +}; + +function ToneRail({ tone }: { tone: SettingsTone }) { + return ( + + ); +} + +function panelClass(tone: SettingsTone = "neutral") { + return cn( + "relative overflow-hidden rounded-xl border p-4 shadow-lush md:p-5", + toneStyles[tone].panel, + ); +} + const repositoryName = (repository: ForgejoRepository) => repository.display_name || `${repository.owner}/${repository.repo}`; @@ -114,16 +182,23 @@ function SectionHeader({ title, description, action, + tone = "accent", }: { icon: ReactNode; title: string; description: string; action?: ReactNode; + tone?: SettingsTone; }) { return (
-
+
{icon}
@@ -141,14 +216,22 @@ function StatCard({ label, value, caption, + tone = "accent", }: { icon: ReactNode; label: string; value: string; caption: string; + tone?: SettingsTone; }) { return ( -
+
+

@@ -158,7 +241,7 @@ function StatCard({ {value}

-
+
{icon}
@@ -190,11 +273,32 @@ function HealthSummaryPanel({ : status === "warning" ? "border-[color:rgba(245,158,11,0.35)] bg-[color:rgba(245,158,11,0.08)] text-[color:var(--warning)]" : "border-[color:rgba(248,113,113,0.35)] bg-[color:rgba(248,113,113,0.08)] text-[color:var(--danger)]"; + const metricTones: SettingsTone[] = [ + "accent", + "success", + "warning", + "danger", + ]; return ( -
+
+
+ + Git operations +
@@ -229,11 +333,15 @@ function HealthSummaryPanel({
- {metrics.map((metric) => ( + {metrics.map((metric, index) => (
+

{metric.label}

@@ -281,11 +389,35 @@ function AttentionPanel({ const hasWebhookItems = items.some((item) => item.kind === "webhook"); return ( -
+
item.tone === "danger") + ? "danger" + : items.length + ? "warning" + : "success", + )} + > + item.tone === "danger") + ? "danger" + : items.length + ? "warning" + : "success" + } + /> } title="Needs Attention" description="Connection and repository signals that can block fresh issue data." + tone={ + items.some((item) => item.tone === "danger") + ? "danger" + : items.length + ? "warning" + : "success" + } action={
{hasSyncItems ? ( @@ -340,7 +472,7 @@ function AttentionPanel({ return (

@@ -393,11 +525,13 @@ function LastImportPanel({ }) { const lastImport = importRuns[0] ?? null; return ( -

+
+ } title="Full Import" description="Run a complete issue pull when webhooks or scheduled sync need a reset." + tone="accent" action={
{/* Repositories */} -
+
+ } title="Tracked Repositories" description="Repositories whose issues are cached and shown in Pipeline." + tone="success" action={
@@ -1313,12 +1454,14 @@ export default function GitProjectSettingsPage() { {/* Webhook Setup */}
+ } title="Webhook Setup" description="Configure Forgejo webhooks to push issue updates to Pipeline in real time." + tone="warning" /> {repositories.length === 0 ? ( @@ -1415,11 +1558,13 @@ export default function GitProjectSettingsPage() {
{/* Scheduled Sync */} -
+
+ } title="Scheduled Sync" description="Pipeline runs a background sync for all active repositories every 60 minutes." + tone="neutral" />

diff --git a/frontend/src/app/settings/page.tsx b/frontend/src/app/settings/page.tsx index 330e83a..3d9c59b 100644 --- a/frontend/src/app/settings/page.tsx +++ b/frontend/src/app/settings/page.tsx @@ -594,26 +594,10 @@ export default function SettingsPage() { forceRedirectUrl: "/settings", signUpForceRedirectUrl: "/settings", }} - title="Settings" - description="Manage your profile, workspace configuration, and integrations." + title={null} stickyHeader - headerActions={ -

- - - - - - -
- } mainClassName="relative bg-app" + headerClassName="hidden" >
@@ -666,8 +650,8 @@ export default function SettingsPage() {
-
-