diff --git a/core/http/react-ui/public/locales/de/home.json b/core/http/react-ui/public/locales/de/home.json index 8b881828f..d4f438bfb 100644 --- a/core/http/react-ui/public/locales/de/home.json +++ b/core/http/react-ui/public/locales/de/home.json @@ -84,6 +84,9 @@ "compatTitle": "Drop-in-Kompatibilität", "apiReference": "Vollständige API-Referenz", "copy": "Kopieren", - "copied": "Kopiert" + "copied": "Kopiert", + "browse": "Browse the API", + "hide": "Hide endpoints", + "dismiss": "Dismiss" } } diff --git a/core/http/react-ui/public/locales/en/home.json b/core/http/react-ui/public/locales/en/home.json index 0bdc26577..fabd9e9dd 100644 --- a/core/http/react-ui/public/locales/en/home.json +++ b/core/http/react-ui/public/locales/en/home.json @@ -84,6 +84,9 @@ "compatTitle": "Drop-in compatibility", "apiReference": "Full API reference", "copy": "Copy", - "copied": "Copied" + "copied": "Copied", + "browse": "Browse the API", + "hide": "Hide endpoints", + "dismiss": "Dismiss" } } diff --git a/core/http/react-ui/public/locales/es/home.json b/core/http/react-ui/public/locales/es/home.json index 397d78e07..83d29c1a0 100644 --- a/core/http/react-ui/public/locales/es/home.json +++ b/core/http/react-ui/public/locales/es/home.json @@ -84,6 +84,9 @@ "compatTitle": "Compatibilidad directa", "apiReference": "Referencia completa de la API", "copy": "Copiar", - "copied": "Copiado" + "copied": "Copiado", + "browse": "Browse the API", + "hide": "Hide endpoints", + "dismiss": "Dismiss" } } diff --git a/core/http/react-ui/public/locales/id/home.json b/core/http/react-ui/public/locales/id/home.json index d7873e214..368a40709 100644 --- a/core/http/react-ui/public/locales/id/home.json +++ b/core/http/react-ui/public/locales/id/home.json @@ -84,6 +84,9 @@ "compatTitle": "Kompatibilitas drop-in", "apiReference": "Referensi API lengkap", "copy": "Salin", - "copied": "Disalin" + "copied": "Disalin", + "browse": "Browse the API", + "hide": "Hide endpoints", + "dismiss": "Dismiss" } } diff --git a/core/http/react-ui/public/locales/it/home.json b/core/http/react-ui/public/locales/it/home.json index 8cc9d3fde..e6f46fb30 100644 --- a/core/http/react-ui/public/locales/it/home.json +++ b/core/http/react-ui/public/locales/it/home.json @@ -84,6 +84,9 @@ "compatTitle": "Compatibilità drop-in", "apiReference": "Riferimento API completo", "copy": "Copia", - "copied": "Copiato" + "copied": "Copiato", + "browse": "Esplora le API", + "hide": "Nascondi gli endpoint", + "dismiss": "Ignora" } } diff --git a/core/http/react-ui/public/locales/ko/home.json b/core/http/react-ui/public/locales/ko/home.json index 11fccbcb4..b54572697 100644 --- a/core/http/react-ui/public/locales/ko/home.json +++ b/core/http/react-ui/public/locales/ko/home.json @@ -84,6 +84,9 @@ "compatTitle": "드롭인 호환성", "apiReference": "전체 API 레퍼런스", "copy": "복사", - "copied": "복사됨" + "copied": "복사됨", + "browse": "Browse the API", + "hide": "Hide endpoints", + "dismiss": "Dismiss" } } diff --git a/core/http/react-ui/public/locales/zh-CN/home.json b/core/http/react-ui/public/locales/zh-CN/home.json index 667094057..4386c293e 100644 --- a/core/http/react-ui/public/locales/zh-CN/home.json +++ b/core/http/react-ui/public/locales/zh-CN/home.json @@ -84,6 +84,9 @@ "compatTitle": "即插即用兼容", "apiReference": "完整 API 参考", "copy": "复制", - "copied": "已复制" + "copied": "已复制", + "browse": "Browse the API", + "hide": "Hide endpoints", + "dismiss": "Dismiss" } } diff --git a/core/http/react-ui/src/App.css b/core/http/react-ui/src/App.css index 9da26adb1..af3b25538 100644 --- a/core/http/react-ui/src/App.css +++ b/core/http/react-ui/src/App.css @@ -5618,6 +5618,8 @@ select.input { .home-page { display: flex; flex-direction: column; + flex: 1; + justify-content: center; gap: var(--space-section); max-width: var(--page-max-medium); margin: 0 auto; @@ -6121,6 +6123,39 @@ select.input { padding: 0; } .home-connect-url .btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; } +.home-connect-dismiss { + margin-left: auto; + flex-shrink: 0; + display: inline-flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + background: none; + border: none; + border-radius: var(--radius-md); + color: var(--color-text-muted); + cursor: pointer; + transition: background var(--duration-fast) var(--ease-default), color var(--duration-fast) var(--ease-default); +} +.home-connect-dismiss:hover { background: var(--color-surface-hover); color: var(--color-text-primary); } +.home-connect-toggle { + display: inline-flex; + align-items: center; + gap: var(--spacing-xs); + margin-top: var(--spacing-md); + padding: var(--spacing-xs) 0; + background: none; + border: none; + color: var(--color-primary); + font: inherit; + font-size: var(--text-sm); + font-weight: var(--font-weight-medium); + cursor: pointer; +} +.home-connect-toggle:hover { color: var(--color-primary-hover); } +.home-connect-toggle i { font-size: 0.7em; } +.home-connect-endpoints { margin-top: var(--spacing-sm); } .home-connect-block { margin-top: var(--spacing-md); } .home-connect-block-head { display: flex; diff --git a/core/http/react-ui/src/components/HomeConnect.jsx b/core/http/react-ui/src/components/HomeConnect.jsx index 46e211d41..882216274 100644 --- a/core/http/react-ui/src/components/HomeConnect.jsx +++ b/core/http/react-ui/src/components/HomeConnect.jsx @@ -27,6 +27,14 @@ const COMPAT = [ export default function HomeConnect() { const { t } = useTranslation('home') const [copied, setCopied] = useState(false) + // Endpoint catalog is collapsed by default so Home stays uncluttered; the + // base URL stays visible and the full list is one click away (discoverable). + const [showEndpoints, setShowEndpoints] = useState(false) + // Dismissable: hiding the card unmounts it entirely so the vertical space is + // recovered, and the choice is remembered across visits. + const [dismissed, setDismissed] = useState(() => { + try { return localStorage.getItem('localai_home_connect_dismissed') === '1' } catch { return false } + }) // Absolute base for this instance, honouring any sub-path mount. const base = new URL(apiUrl('/'), window.location.origin).href.replace(/\/$/, '') @@ -39,6 +47,13 @@ export default function HomeConnect() { } catch (_) { /* clipboard blocked — the URL is selectable anyway */ } } + const dismiss = () => { + try { localStorage.setItem('localai_home_connect_dismissed', '1') } catch { /* ignore */ } + setDismissed(true) + } + + if (dismissed) return null + return (
@@ -47,6 +62,9 @@ export default function HomeConnect() {

{t('connect.title')}

{t('connect.subtitle')}

+