mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-26 06:37:33 +00:00
feat(settings): collapsible settings cards, first on the integrations tab
The settings pages list everything at once, so they read as a wall of
forms. SettingsCard and Section take 'collapsible': the card starts shut
and its badge says its state ('Connected', 'Not set up'); its title is the
button, stretched over the head, the head's action stays its own button.
The body stays mounted while shut. A link to #id opens the card and
scrolls to it; the browser remembers a card left open.
Every integrations card is collapsible now; AI parsing shows its saved
model and MCP the apps signed in. The assistant's settings link opens the
AI connection card. Tests that read into a card open it first
(tests/helpers/settingsCards.ts).
This commit is contained in:
@@ -346,9 +346,21 @@ function ApiTokensTab({ S }: { S: IntegrationsState }) {
|
||||
}
|
||||
|
||||
function IntegrationsMcpSection({ S }: { S: IntegrationsState }) {
|
||||
const { t, activeMcpTab, setActiveMcpTab, copiedKey, mcpEndpoint, handleCopy } = S
|
||||
const { t, activeMcpTab, setActiveMcpTab, copiedKey, mcpEndpoint, handleCopy, oauthSessions } = S
|
||||
// Connected means signed in now: an OAuth session, which is what an app holds while it reaches TREK.
|
||||
const connected = oauthSessions.length
|
||||
return (
|
||||
<Section title={t('settings.mcp.title')} icon={Terminal}>
|
||||
<Section
|
||||
id="mcp"
|
||||
collapsible
|
||||
title={t('settings.mcp.title')}
|
||||
icon={Terminal}
|
||||
badge={
|
||||
connected > 0
|
||||
? <StatusPill tone="success" icon={<span className="h-1.5 w-1.5 rounded-full bg-current" />}>{t('settings.mcp.appsConnected', { count: connected })}</StatusPill>
|
||||
: <StatusPill>{t('settings.notSetUp')}</StatusPill>
|
||||
}
|
||||
>
|
||||
{/* Endpoint URL */}
|
||||
<EditorField label={t('settings.mcp.endpoint')}>
|
||||
<CopyValue value={mcpEndpoint} copied={copiedKey === 'endpoint'} label={t('settings.mcp.copy')} onCopy={() => handleCopy(mcpEndpoint, 'endpoint')} />
|
||||
|
||||
Reference in New Issue
Block a user