From 7a1bb2acd6fdce526aebe41d99a916ccad75c689 Mon Sep 17 00:00:00 2001
From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com>
Date: Sat, 13 Jun 2026 00:46:53 +0530
Subject: [PATCH] feat(model-connections): refactor model roles UI
---
.../settings/model-connections-settings.tsx | 132 +++++++++---------
.../connection-settings-dialog.tsx | 7 +-
2 files changed, 75 insertions(+), 64 deletions(-)
diff --git a/surfsense_web/components/settings/model-connections-settings.tsx b/surfsense_web/components/settings/model-connections-settings.tsx
index cf00ac6c9..c61368974 100644
--- a/surfsense_web/components/settings/model-connections-settings.tsx
+++ b/surfsense_web/components/settings/model-connections-settings.tsx
@@ -1,7 +1,7 @@
"use client";
import { useAtom, useAtomValue } from "jotai";
-import { Trash2 } from "lucide-react";
+import { Dot, Trash2 } from "lucide-react";
import { useState } from "react";
import { toast } from "sonner";
import {
@@ -30,7 +30,6 @@ import {
} from "@/components/ui/alert-dialog";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Label } from "@/components/ui/label";
import {
Select,
@@ -78,7 +77,7 @@ function ConnectionCard({ connection }: { connection: ConnectionRead }) {
return (
-
+
{providerIcon(connection.provider)}
@@ -100,10 +99,11 @@ function ConnectionCard({ connection }: { connection: ConnectionRead }) {
@@ -335,7 +335,11 @@ export function ModelConnectionsSettings({ searchSpaceId }: { searchSpaceId: num
{providerIcon(model.provider)}
- {modelLabel(model)} ยท {model.connectionName}
+
+ {modelLabel(model)}
+
+ {model.connectionName}
+
);
@@ -343,7 +347,66 @@ export function ModelConnectionsSettings({ searchSpaceId }: { searchSpaceId: num
return (
-
+
+
+
Model Roles
+
+ Pick which enabled model powers chat, vision, and image generation for this search
+ space.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Add Provider
@@ -408,63 +471,6 @@ export function ModelConnectionsSettings({ searchSpaceId }: { searchSpaceId: num
) : null}
-
-
-
- Model Roles
-
- Pick which enabled model powers chat, vision, and image generation for this search
- space.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
);
}
diff --git a/surfsense_web/components/settings/model-connections/connection-settings-dialog.tsx b/surfsense_web/components/settings/model-connections/connection-settings-dialog.tsx
index badddb8d7..d20dbbdc6 100644
--- a/surfsense_web/components/settings/model-connections/connection-settings-dialog.tsx
+++ b/surfsense_web/components/settings/model-connections/connection-settings-dialog.tsx
@@ -157,7 +157,12 @@ export function ConnectionSettingsDialog({
return (