@@ -225,6 +225,9 @@ pub fn handle(
225225 http . Post , [ "api" , "v1" , "providers" , "openai-compatible" , "verify" ] ->
226226 handle_verify_openai_compatible ( config , request )
227227
228+ http . Get , [ "api" , "v1" , "sessions" ] ->
229+ handle_list_sessions ( dependencies . repositories )
230+
228231 http . Post , [ "api" , "v1" , "sessions" ] ->
229232 handle_create_session ( request , manager )
230233
@@ -313,6 +316,13 @@ pub fn handle(
313316 }
314317}
315318
319+ fn handle_list_sessions ( repositories : repository . Repositories ) -> wisp . Response {
320+ case repository . list_sessions ( repositories . sessions ) {
321+ Ok ( sessions ) -> json_response ( api_json . sessions_json ( sessions ) , 200 )
322+ Error ( error ) -> error_response ( error )
323+ }
324+ }
325+
316326fn handle_create_session (
317327 request : wisp . Request ,
318328 manager : session_manager . Handle ,
@@ -1222,7 +1232,7 @@ fn ui_index_html() -> String {
12221232 " * { box-sizing: border-box; }" ,
12231233 " body { margin: 0; background: #0b1020; color: #e5e7eb; }" ,
12241234 " .page { min-height: 100vh; padding: 24px; }" ,
1225- " .panel { max-width: 1400px ; margin: 0 auto; background: #11172a; border: 1px solid #24304b; border-radius: 16px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }" ,
1235+ " .panel { max-width: 1600px ; margin: 0 auto; background: #11172a; border: 1px solid #24304b; border-radius: 16px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }" ,
12261236 " .hero { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }" ,
12271237 " .hero h1 { margin: 0 0 8px 0; font-size: 28px; }" ,
12281238 " .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }" ,
@@ -1236,8 +1246,20 @@ fn ui_index_html() -> String {
12361246 " .textarea { resize: vertical; min-height: 140px; }" ,
12371247 " .button { border: 0; border-radius: 12px; background: #2563eb; color: white; padding: 10px 16px; font: inherit; cursor: pointer; }" ,
12381248 " .button:disabled { opacity: 0.45; cursor: not-allowed; }" ,
1239- " .split-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 16px; align-items: start; }" ,
1240- " .chat-pane, .debug-pane { min-width: 0; }" ,
1249+ " .workspace { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; align-items: start; }" ,
1250+ " .sessions-pane, .chat-pane, .debug-pane { min-width: 0; }" ,
1251+ " .sessions-panel, .debug-panel { background: #0f172a; border: 1px solid #24304b; border-radius: 12px; padding: 14px; }" ,
1252+ " .sessions-panel h2, .debug-panel h2 { margin: 0 0 8px 0; }" ,
1253+ " .session-list { display: grid; gap: 10px; max-height: 70vh; overflow-y: auto; padding-right: 4px; }" ,
1254+ " .session-item { width: 100%; text-align: left; border: 1px solid #24304b; border-radius: 12px; background: #111827; color: inherit; padding: 12px; display: grid; gap: 10px; cursor: pointer; }" ,
1255+ " .session-item.current { border-color: #3b82f6; background: #172554; }" ,
1256+ " .session-item:disabled { opacity: 0.7; cursor: not-allowed; }" ,
1257+ " .session-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }" ,
1258+ " .session-id { display: block; white-space: pre-wrap; word-break: break-word; color: #dbeafe; }" ,
1259+ " .session-item-meta { display: flex; flex-direction: column; gap: 4px; }" ,
1260+ " .session-item-tags { display: flex; gap: 8px; flex-wrap: wrap; }" ,
1261+ " .badge { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid #334155; padding: 2px 8px; font-size: 12px; color: #cbd5e1; }" ,
1262+ " .badge.accent { border-color: #3b82f6; color: #bfdbfe; }" ,
12411263 " .messages { display: grid; gap: 12px; margin-bottom: 16px; min-height: 240px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }" ,
12421264 " .message { border-radius: 14px; border: 1px solid #24304b; padding: 12px 14px; }" ,
12431265 " .message.user { background: #172554; }" ,
@@ -1249,13 +1271,12 @@ fn ui_index_html() -> String {
12491271 " .composer { display: grid; gap: 12px; }" ,
12501272 " .composer-actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }" ,
12511273 " .hint { color: #94a3b8; font-size: 13px; }" ,
1252- " .debug-panel { background: #0f172a; border: 1px solid #24304b; border-radius: 12px; padding: 14px; }" ,
1253- " .debug-panel h2 { margin: 0 0 8px 0; }" ,
12541274 " .debug-log { display: grid; gap: 10px; max-height: 70vh; overflow-y: auto; padding-right: 4px; }" ,
12551275 " .debug-entry { border: 1px solid #24304b; border-radius: 10px; padding: 10px; background: #111827; }" ,
12561276 " .debug-message { margin: 6px 0 0 0; white-space: pre-wrap; word-break: break-word; font-size: 13px; }" ,
12571277 " .empty { border: 1px dashed #334155; border-radius: 12px; padding: 18px; color: #94a3b8; text-align: center; }" ,
1258- " @media (max-width: 980px) { .split-layout { grid-template-columns: 1fr; } }" ,
1278+ " @media (max-width: 1280px) { .workspace { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); } .debug-pane { grid-column: 1 / -1; } }" ,
1279+ " @media (max-width: 980px) { .workspace { grid-template-columns: 1fr; } }" ,
12591280 " @media (max-width: 720px) { .page { padding: 12px; } .panel { padding: 16px; } .hero { flex-direction: column; } }" ,
12601281 " </style>" ,
12611282 " </head>" ,
0 commit comments