feat(ui): polish scm agent views
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Failing after 14s

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-02 07:04:25 +00:00
parent 32e65b8b43
commit 5a561690be
7 changed files with 2127 additions and 905 deletions

File diff suppressed because it is too large Load diff

View file

@ -12,15 +12,23 @@
} }
body { body {
font-family: system-ui, -apple-system, sans-serif; font-family:
background: #f3f4f6; Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
sans-serif;
background:
radial-gradient(circle at top left, rgba(99, 102, 241, 0.15), transparent 24%),
linear-gradient(180deg, #eef2ff 0%, #f8fafc 30%, #f3f4f6 100%);
padding: 2rem; padding: 2rem;
color: #111827;
} }
h1 { h1 {
font-size: 1.5rem; font-size: 1.65rem;
margin-bottom: 1.5rem; margin: 0 auto 1.5rem;
colour: #111827; max-width: 960px;
font-weight: 800;
letter-spacing: -0.03em;
color: #0f172a;
} }
.demo-panel { .demo-panel {
@ -28,25 +36,31 @@
max-width: 960px; max-width: 960px;
margin: 0 auto; margin: 0 auto;
height: 80vh; height: 80vh;
border: 1px solid #d1d5db; border: 1px solid rgba(226, 232, 240, 0.95);
border-radius: 0.5rem; border-radius: 1rem;
overflow: hidden; overflow: hidden;
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
background: rgba(255, 255, 255, 0.82);
backdrop-filter: blur(18px);
} }
h2 { h2 {
font-size: 1.125rem; font-size: 1.125rem;
margin: 2rem auto 1rem; margin: 2rem auto 1rem;
max-width: 960px; max-width: 960px;
colour: #374151; color: #374151;
font-weight: 700;
} }
.standalone { .standalone {
max-width: 960px; max-width: 960px;
margin: 0 auto 2rem; margin: 0 auto 2rem;
border: 1px solid #d1d5db; border: 1px solid rgba(226, 232, 240, 0.95);
border-radius: 0.5rem; border-radius: 1rem;
padding: 1rem; padding: 1rem;
background: #fff; background: rgba(255, 255, 255, 0.82);
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
backdrop-filter: blur(18px);
} }
</style> </style>
<script type="module" src="./src/index.ts"></script> <script type="module" src="./src/index.ts"></script>

View file

@ -29,28 +29,74 @@ export class ScmInstalled extends LitElement {
static styles = css` static styles = css`
:host { :host {
display: block; display: block;
font-family: system-ui, -apple-system, sans-serif; font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
sans-serif;
color: #111827;
}
.shell {
background: rgba(255, 255, 255, 0.84);
border: 1px solid rgba(226, 232, 240, 0.95);
border-radius: 1rem;
padding: 1rem;
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
backdrop-filter: blur(12px);
}
.summary {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid #e2e8f0;
}
.summary-copy {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.summary-title {
font-size: 1rem;
font-weight: 800;
color: #0f172a;
}
.summary-subtitle {
font-size: 0.8125rem;
color: #64748b;
} }
.list { .list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5rem; gap: 0.75rem;
} }
.item { .item {
border: 1px solid #e5e7eb; border: 1px solid #e2e8f0;
border-radius: 0.5rem; border-radius: 1rem;
padding: 1rem; padding: 1rem;
background: #fff; background:
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
transition: box-shadow 0.15s; gap: 1rem;
transition:
transform 0.15s ease,
box-shadow 0.15s ease,
border-color 0.15s ease;
} }
.item:hover { .item:hover {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
border-color: #c7d2fe;
transform: translateY(-2px);
} }
.item-info { .item-info {
@ -58,20 +104,58 @@ export class ScmInstalled extends LitElement {
} }
.item-name { .item-name {
font-weight: 600; font-weight: 800;
font-size: 0.9375rem; font-size: 0.95rem;
color: #0f172a;
} }
.item-meta { .item-meta {
font-size: 0.75rem; font-size: 0.75rem;
colour: #6b7280; color: #64748b;
margin-top: 0.25rem; margin-top: 0.35rem;
display: flex; display: flex;
gap: 1rem; gap: 1rem;
flex-wrap: wrap;
} }
.item-code { .item-code {
font-family: monospace; font-family: monospace;
color: #334155;
font-weight: 700;
}
.item-repo,
.item-entry {
font-family: monospace;
color: #475569;
word-break: break-word;
}
.badge {
display: inline-flex;
align-items: center;
gap: 0.3rem;
font-size: 0.6875rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #166534;
}
.badge::before {
content: '';
width: 0.45rem;
height: 0.45rem;
border-radius: 999px;
background: #22c55e;
}
.badge.unsigned {
color: #64748b;
}
.badge.unsigned::before {
background: #f59e0b;
} }
.item-actions { .item-actions {
@ -80,21 +164,26 @@ export class ScmInstalled extends LitElement {
} }
button { button {
padding: 0.375rem 0.75rem; padding: 0.45rem 0.85rem;
border-radius: 0.375rem; border-radius: 0.75rem;
font-size: 0.8125rem; font-size: 0.8125rem;
cursor: pointer; cursor: pointer;
transition: background 0.15s; font-weight: 700;
transition:
background 0.15s ease,
transform 0.15s ease,
box-shadow 0.15s ease;
} }
button.update { button.update {
background: #fff; background: #fff;
colour: #6366f1; color: #4338ca;
border: 1px solid #6366f1; border: 1px solid #6366f1;
} }
button.update:hover { button.update:hover {
background: #eef2ff; background: #eef2ff;
transform: translateY(-1px);
} }
button.update:disabled { button.update:disabled {
@ -104,35 +193,57 @@ export class ScmInstalled extends LitElement {
button.remove { button.remove {
background: #fff; background: #fff;
colour: #dc2626; color: #dc2626;
border: 1px solid #dc2626; border: 1px solid #dc2626;
} }
button.remove:hover { button.remove:hover {
background: #fef2f2; background: #fef2f2;
transform: translateY(-1px);
} }
.empty { .empty {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
colour: #9ca3af; color: #64748b;
font-size: 0.875rem; font-size: 0.875rem;
} }
.loading { .loading {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
colour: #6b7280; color: #64748b;
} }
.error { .error {
colour: #dc2626; color: #dc2626;
padding: 0.75rem; padding: 0.75rem;
background: #fef2f2; background: #fef2f2;
border-radius: 0.375rem; border: 1px solid #fecaca;
border-radius: 0.75rem;
font-size: 0.875rem; font-size: 0.875rem;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
@media (max-width: 720px) {
.shell {
padding: 0.875rem;
}
.summary,
.item {
flex-direction: column;
align-items: flex-start;
}
.item-actions {
width: 100%;
}
button {
flex: 1;
}
}
`; `;
@property({ attribute: 'api-url' }) apiUrl = ''; @property({ attribute: 'api-url' }) apiUrl = '';
@ -210,39 +321,61 @@ export class ScmInstalled extends LitElement {
} }
return html` return html`
${this.error ? html`<div class="error">${this.error}</div>` : nothing} <div class="shell">
${this.modules.length === 0 <div class="summary">
? html`<div class="empty">No providers installed.</div>` <div class="summary-copy">
: html` <span class="summary-title">Installed providers</span>
<div class="list"> <span class="summary-subtitle">
${this.modules.map( Review local modules, update them, or remove stale installs.
(mod) => html` </span>
<div class="item"> </div>
<div class="item-info"> <div class="summary-copy" style="text-align:right">
<div class="item-name">${mod.name}</div> <span class="summary-title">${this.modules.length}</span>
<div class="item-meta"> <span class="summary-subtitle">Installed</span>
<span class="item-code">${mod.code}</span> </div>
<span>v${mod.version}</span> </div>
<span>Installed ${this.formatDate(mod.installed_at)}</span>
${this.error ? html`<div class="error">${this.error}</div>` : nothing}
${this.modules.length === 0
? html`<div class="empty">No providers installed.</div>`
: html`
<div class="list">
${this.modules.map(
(mod) => html`
<div class="item">
<div class="item-info">
<div class="item-name">${mod.name}</div>
<div class="item-meta">
<span class="item-code">${mod.code}</span>
<span>v${mod.version}</span>
<span>Installed ${this.formatDate(mod.installed_at)}</span>
</div>
<div class="item-meta">
<span class="item-repo">${mod.repo}</span>
<span class="item-entry">entry: ${mod.entry_point}</span>
</div>
<div class="badge ${mod.sign_key ? '' : 'unsigned'}">
${mod.sign_key ? 'Signed manifest' : 'Unsigned manifest'}
</div>
</div>
<div class="item-actions">
<button
class="update"
?disabled=${this.updating.has(mod.code)}
@click=${() => this.handleUpdate(mod.code)}
>
${this.updating.has(mod.code) ? 'Updating\u2026' : 'Update'}
</button>
<button class="remove" @click=${() => this.handleRemove(mod.code)}>
Remove
</button>
</div> </div>
</div> </div>
<div class="item-actions"> `,
<button )}
class="update" </div>
?disabled=${this.updating.has(mod.code)} `}
@click=${() => this.handleUpdate(mod.code)} </div>
>
${this.updating.has(mod.code) ? 'Updating\u2026' : 'Update'}
</button>
<button class="remove" @click=${() => this.handleRemove(mod.code)}>
Remove
</button>
</div>
</div>
`,
)}
</div>
`}
`; `;
} }
} }

View file

@ -29,45 +29,82 @@ export class ScmManifest extends LitElement {
static styles = css` static styles = css`
:host { :host {
display: block; display: block;
font-family: system-ui, -apple-system, sans-serif; font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
sans-serif;
color: #111827;
} }
.manifest { .manifest {
border: 1px solid #e5e7eb; border: 1px solid rgba(226, 232, 240, 0.95);
border-radius: 0.5rem; border-radius: 1rem;
padding: 1.25rem; padding: 1.25rem;
background: #fff; background:
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
} }
.header { .header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
gap: 1rem;
margin-bottom: 1rem; margin-bottom: 1rem;
padding-bottom: 0.9rem;
border-bottom: 1px solid #e2e8f0;
}
.header-copy {
display: flex;
flex-direction: column;
gap: 0.35rem;
} }
h3 { h3 {
margin: 0; margin: 0;
font-size: 1.125rem; font-size: 1.2rem;
font-weight: 600; font-weight: 800;
color: #0f172a;
} }
.version { .version {
font-size: 0.75rem; font-size: 0.75rem;
padding: 0.125rem 0.5rem; padding: 0.25rem 0.625rem;
background: #f3f4f6; background: #eef2ff;
border-radius: 1rem; border-radius: 999px;
colour: #6b7280; color: #4338ca;
font-weight: 700;
}
.meta-row {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.meta-chip {
display: inline-flex;
align-items: center;
gap: 0.35rem;
padding: 0.25rem 0.6rem;
border-radius: 999px;
background: #f8fafc;
border: 1px solid #e2e8f0;
font-size: 0.6875rem;
font-weight: 700;
color: #475569;
text-transform: uppercase;
letter-spacing: 0.05em;
} }
.field { .field {
margin-bottom: 0.75rem; margin-bottom: 0.875rem;
} }
.field-label { .field-label {
font-size: 0.75rem; font-size: 0.75rem;
font-weight: 600; font-weight: 800;
colour: #6b7280; color: #64748b;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.025em; letter-spacing: 0.025em;
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
@ -75,14 +112,17 @@ export class ScmManifest extends LitElement {
.field-value { .field-value {
font-size: 0.875rem; font-size: 0.875rem;
color: #0f172a;
} }
.code { .code {
font-family: monospace; font-family: monospace;
font-size: 0.8125rem; font-size: 0.8125rem;
background: #f9fafb; background: #f8fafc;
padding: 0.25rem 0.5rem; padding: 0.35rem 0.55rem;
border-radius: 0.25rem; border-radius: 0.45rem;
border: 1px solid #e2e8f0;
color: #1f2937;
} }
.slots { .slots {
@ -90,16 +130,20 @@ export class ScmManifest extends LitElement {
grid-template-columns: auto 1fr; grid-template-columns: auto 1fr;
gap: 0.25rem 1rem; gap: 0.25rem 1rem;
font-size: 0.8125rem; font-size: 0.8125rem;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 0.75rem;
padding: 0.75rem;
} }
.slot-key { .slot-key {
font-weight: 600; font-weight: 700;
colour: #374151; color: #334155;
} }
.slot-value { .slot-value {
font-family: monospace; font-family: monospace;
colour: #6b7280; color: #64748b;
} }
.permissions-grid { .permissions-grid {
@ -109,15 +153,16 @@ export class ScmManifest extends LitElement {
} }
.perm-group { .perm-group {
border: 1px solid #e5e7eb; border: 1px solid #e2e8f0;
border-radius: 0.375rem; border-radius: 0.75rem;
padding: 0.5rem; padding: 0.5rem;
background: #fff;
} }
.perm-group-label { .perm-group-label {
font-size: 0.6875rem; font-size: 0.6875rem;
font-weight: 700; font-weight: 800;
colour: #6b7280; color: #64748b;
text-transform: uppercase; text-transform: uppercase;
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
} }
@ -125,7 +170,8 @@ export class ScmManifest extends LitElement {
.perm-item { .perm-item {
font-size: 0.8125rem; font-size: 0.8125rem;
font-family: monospace; font-family: monospace;
colour: #374151; color: #374151;
word-break: break-word;
} }
.signature { .signature {
@ -134,8 +180,9 @@ export class ScmManifest extends LitElement {
gap: 0.75rem; gap: 0.75rem;
margin-top: 1rem; margin-top: 1rem;
padding: 0.75rem; padding: 0.75rem;
border-radius: 0.375rem; border-radius: 0.75rem;
font-size: 0.875rem; font-size: 0.875rem;
font-weight: 600;
} }
.signature.signed { .signature.signed {
@ -155,84 +202,142 @@ export class ScmManifest extends LitElement {
.badge { .badge {
font-size: 0.75rem; font-size: 0.75rem;
font-weight: 600; font-weight: 800;
padding: 0.125rem 0.5rem; padding: 0.25rem 0.55rem;
border-radius: 1rem; border-radius: 999px;
text-transform: uppercase;
letter-spacing: 0.04em;
} }
.badge.verified { .badge.verified {
background: #dcfce7; background: #dcfce7;
colour: #166534; color: #166534;
}
.badge.signed {
background: #e0e7ff;
color: #4338ca;
} }
.badge.unsigned { .badge.unsigned {
background: #fef3c7; background: #fef3c7;
colour: #92400e; color: #92400e;
} }
.badge.invalid { .badge.invalid {
background: #fee2e2; background: #fee2e2;
colour: #991b1b; color: #991b1b;
} }
.actions { .actions {
margin-top: 1rem; margin-top: 1rem;
display: flex; display: flex;
gap: 0.5rem; gap: 0.5rem;
flex-wrap: wrap;
} }
.verify-input { .verify-input {
flex: 1; flex: 1;
padding: 0.375rem 0.75rem; min-width: 14rem;
border: 1px solid #d1d5db; padding: 0.6rem 0.85rem;
border-radius: 0.375rem; border: 1px solid #cbd5e1;
border-radius: 0.75rem;
font-size: 0.8125rem; font-size: 0.8125rem;
font-family: monospace; font-family: monospace;
background: #fff;
} }
button { button {
padding: 0.375rem 1rem; padding: 0.6rem 1rem;
border-radius: 0.375rem; border-radius: 0.75rem;
font-size: 0.8125rem; font-size: 0.8125rem;
cursor: pointer; cursor: pointer;
border: 1px solid #d1d5db; border: 1px solid #d1d5db;
background: #fff; background: #fff;
transition: background 0.15s; transition:
background 0.15s ease,
transform 0.15s ease;
} }
button:hover { button:hover {
background: #f3f4f6; background: #f3f4f6;
transform: translateY(-1px);
} }
button.primary { button.primary {
background: #6366f1; background: linear-gradient(180deg, #6366f1, #4f46e5);
colour: #fff; color: #fff;
border-colour: #6366f1; border-color: #6366f1;
} }
button.primary:hover { button.primary:hover {
background: #4f46e5; background: linear-gradient(180deg, #4f46e5, #4338ca);
} }
.empty { .empty {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
colour: #9ca3af; color: #64748b;
font-size: 0.875rem; font-size: 0.875rem;
} }
.error { .error {
colour: #dc2626; color: #dc2626;
padding: 0.75rem; padding: 0.75rem;
background: #fef2f2; background: #fef2f2;
border-radius: 0.375rem; border: 1px solid #fecaca;
border-radius: 0.75rem;
font-size: 0.875rem; font-size: 0.875rem;
margin-bottom: 0.75rem;
} }
.loading { .loading {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
colour: #6b7280; color: #64748b;
}
.status {
display: flex;
align-items: center;
gap: 0.35rem;
}
.status-dot {
width: 0.5rem;
height: 0.5rem;
border-radius: 999px;
}
.status-dot.verified {
background: #22c55e;
}
.status-dot.signed {
background: #6366f1;
}
.status-dot.unsigned {
background: #f59e0b;
}
.status-dot.invalid {
background: #ef4444;
}
@media (max-width: 720px) {
.manifest {
padding: 1rem;
}
.header {
flex-direction: column;
align-items: flex-start;
}
.actions {
flex-direction: column;
}
} }
`; `;
@ -332,14 +437,39 @@ export class ScmManifest extends LitElement {
const m = this.manifest; const m = this.manifest;
const hasSig = !!m.sign; const hasSig = !!m.sign;
const status = hasSig
? this.verifyResult
? this.verifyResult.valid
? 'verified'
: 'invalid'
: 'signed'
: 'unsigned';
const statusLabel = hasSig
? this.verifyResult
? this.verifyResult.valid
? 'Verified'
: 'Invalid'
: 'Signed'
: 'Unsigned';
const permissionCount =
(m.permissions?.read?.length ?? 0) +
(m.permissions?.write?.length ?? 0) +
(m.permissions?.net?.length ?? 0) +
(m.permissions?.run?.length ?? 0);
return html` return html`
${this.error ? html`<div class="error">${this.error}</div>` : nothing} ${this.error ? html`<div class="error">${this.error}</div>` : nothing}
<div class="manifest"> <div class="manifest">
<div class="header"> <div class="header">
<div> <div class="header-copy">
<h3>${m.name}</h3> <h3>${m.name}</h3>
<span class="code">${m.code}</span> <div class="meta-row">
<span class="meta-chip">${m.code}</span>
<span class="meta-chip">${permissionCount} permissions</span>
${m.modules?.length
? html`<span class="meta-chip">${m.modules.length} modules</span>`
: nothing}
</div>
</div> </div>
<span class="version">v${m.version}</span> <span class="version">v${m.version}</span>
</div> </div>
@ -381,16 +511,17 @@ export class ScmManifest extends LitElement {
? html` ? html`
<div class="field"> <div class="field">
<div class="field-label">Modules</div> <div class="field-label">Modules</div>
${m.modules.map((mod) => html`<div class="code" style="margin-bottom:0.25rem">${mod}</div>`)} ${m.modules.map((mod) => html`<div class="code" style="margin-bottom:0.35rem">${mod}</div>`)}
</div> </div>
` `
: nothing} : nothing}
<div class="signature ${hasSig ? (this.verifyResult ? (this.verifyResult.valid ? 'signed' : 'invalid') : 'signed') : 'unsigned'}"> <div class="signature ${status}">
<span class="badge ${hasSig ? (this.verifyResult ? (this.verifyResult.valid ? 'verified' : 'invalid') : 'unsigned') : 'unsigned'}"> <span class="badge ${status}">${statusLabel}</span>
${hasSig ? (this.verifyResult ? (this.verifyResult.valid ? 'Verified' : 'Invalid') : 'Signed') : 'Unsigned'} <span class="status">
<span class="status-dot ${status}"></span>
${hasSig ? html`<span>Signature present</span>` : html`<span>No signature</span>`}
</span> </span>
${hasSig ? html`<span>Signature present</span>` : html`<span>No signature</span>`}
</div> </div>
<div class="actions"> <div class="actions">

View file

@ -21,7 +21,79 @@ export class ScmMarketplace extends LitElement {
static styles = css` static styles = css`
:host { :host {
display: block; display: block;
font-family: system-ui, -apple-system, sans-serif; font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
sans-serif;
color: #111827;
}
.shell {
background: rgba(255, 255, 255, 0.84);
border: 1px solid rgba(226, 232, 240, 0.95);
border-radius: 1rem;
padding: 1rem;
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
backdrop-filter: blur(12px);
}
.summary {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid #e2e8f0;
}
.summary-copy {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.summary-title {
font-size: 1rem;
font-weight: 800;
color: #0f172a;
}
.summary-subtitle {
font-size: 0.8125rem;
color: #64748b;
}
.summary-stats {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
justify-content: flex-end;
}
.stat {
min-width: 4.5rem;
padding: 0.55rem 0.75rem;
border-radius: 0.85rem;
background: linear-gradient(180deg, #f8fafc, #eef2ff);
border: 1px solid #e2e8f0;
text-align: center;
}
.stat-value {
display: block;
font-size: 1rem;
font-weight: 800;
color: #312e81;
line-height: 1;
}
.stat-label {
display: block;
margin-top: 0.25rem;
font-size: 0.6875rem;
letter-spacing: 0.06em;
text-transform: uppercase;
color: #64748b;
} }
.toolbar { .toolbar {
@ -29,20 +101,26 @@ export class ScmMarketplace extends LitElement {
gap: 0.5rem; gap: 0.5rem;
align-items: center; align-items: center;
margin-bottom: 1rem; margin-bottom: 1rem;
flex-wrap: wrap;
} }
.search { .search {
flex: 1; flex: 1;
padding: 0.5rem 0.75rem; min-width: 14rem;
border: 1px solid #d1d5db; padding: 0.7rem 0.9rem;
border-radius: 0.375rem; border: 1px solid #cbd5e1;
border-radius: 0.85rem;
font-size: 0.875rem; font-size: 0.875rem;
outline: none; outline: none;
background: #fff;
transition:
border-color 0.15s ease,
box-shadow 0.15s ease;
} }
.search:focus { .search:focus {
border-colour: #6366f1; border-color: #6366f1;
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
} }
.categories { .categories {
@ -52,68 +130,128 @@ export class ScmMarketplace extends LitElement {
} }
.category-btn { .category-btn {
padding: 0.25rem 0.75rem; padding: 0.35rem 0.8rem;
border: 1px solid #e5e7eb; border: 1px solid #e2e8f0;
border-radius: 1rem; border-radius: 1rem;
background: #fff; background: #fff;
font-size: 0.75rem; font-size: 0.75rem;
font-weight: 700;
color: #475569;
cursor: pointer; cursor: pointer;
transition: all 0.15s; transition:
background 0.15s ease,
color 0.15s ease,
border-color 0.15s ease,
transform 0.15s ease;
} }
.category-btn:hover { .category-btn:hover {
background: #f3f4f6; background: #f8fafc;
transform: translateY(-1px);
} }
.category-btn.active { .category-btn.active {
background: #6366f1; background: linear-gradient(180deg, #6366f1, #4f46e5);
colour: #fff; color: #fff;
border-colour: #6366f1; border-color: #4f46e5;
box-shadow: 0 6px 16px rgba(99, 102, 241, 0.22);
} }
.grid { .grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 1rem; gap: 0.875rem;
margin-top: 1rem; margin-top: 1rem;
} }
.card { .card {
border: 1px solid #e5e7eb; border: 1px solid #e2e8f0;
border-radius: 0.5rem; border-radius: 1rem;
padding: 1rem; padding: 1rem;
background: #fff; background:
transition: box-shadow 0.15s; linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
transition:
transform 0.15s ease,
box-shadow 0.15s ease,
border-color 0.15s ease;
min-height: 10rem;
display: flex;
flex-direction: column;
justify-content: space-between;
} }
.card:hover { .card:hover {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
border-color: #c7d2fe;
transform: translateY(-2px);
} }
.card-header { .card-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
margin-bottom: 0.5rem; gap: 0.75rem;
margin-bottom: 0.75rem;
} }
.card-name { .card-name {
font-weight: 600; font-weight: 800;
font-size: 0.9375rem; font-size: 0.95rem;
color: #0f172a;
line-height: 1.2;
} }
.card-code { .card-code {
font-size: 0.75rem; margin-top: 0.15rem;
colour: #6b7280; font-size: 0.775rem;
color: #64748b;
font-family: monospace; font-family: monospace;
} }
.card-category { .card-category {
font-size: 0.6875rem; font-size: 0.6875rem;
padding: 0.125rem 0.5rem; padding: 0.2rem 0.5rem;
background: #f3f4f6; background: #e0e7ff;
border-radius: 1rem; border-radius: 999px;
colour: #6b7280; color: #4338ca;
font-weight: 700;
white-space: nowrap;
}
.card-repo {
font-size: 0.7875rem;
color: #475569;
font-family: monospace;
word-break: break-word;
margin-bottom: 0.4rem;
}
.card-sign {
display: inline-flex;
align-items: center;
gap: 0.35rem;
font-size: 0.6875rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #166534;
margin-bottom: 0.4rem;
}
.card-sign::before {
content: '';
width: 0.45rem;
height: 0.45rem;
border-radius: 999px;
background: #22c55e;
}
.card-sign.unsigned {
color: #64748b;
}
.card-sign.unsigned::before {
background: #f59e0b;
} }
.card-actions { .card-actions {
@ -123,18 +261,24 @@ export class ScmMarketplace extends LitElement {
} }
button.install { button.install {
padding: 0.375rem 1rem; padding: 0.45rem 1rem;
background: #6366f1; background: linear-gradient(180deg, #6366f1, #4f46e5);
colour: #fff; color: #fff;
border: none; border: none;
border-radius: 0.375rem; border-radius: 0.75rem;
font-size: 0.8125rem; font-size: 0.8125rem;
font-weight: 700;
cursor: pointer; cursor: pointer;
transition: background 0.15s; transition:
transform 0.15s ease,
box-shadow 0.15s ease,
background 0.15s ease;
box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
} }
button.install:hover { button.install:hover {
background: #4f46e5; background: linear-gradient(180deg, #4f46e5, #4338ca);
transform: translateY(-1px);
} }
button.install:disabled { button.install:disabled {
@ -143,39 +287,66 @@ export class ScmMarketplace extends LitElement {
} }
button.remove { button.remove {
padding: 0.375rem 1rem; padding: 0.45rem 1rem;
background: #fff; background: #fff;
colour: #dc2626; color: #dc2626;
border: 1px solid #dc2626; border: 1px solid #dc2626;
border-radius: 0.375rem; border-radius: 0.75rem;
font-size: 0.8125rem; font-size: 0.8125rem;
font-weight: 700;
cursor: pointer; cursor: pointer;
transition:
background 0.15s ease,
transform 0.15s ease;
} }
button.remove:hover { button.remove:hover {
background: #fef2f2; background: #fef2f2;
transform: translateY(-1px);
} }
.empty { .empty {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
colour: #9ca3af; color: #64748b;
font-size: 0.875rem; font-size: 0.875rem;
} }
.loading { .loading {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
colour: #6b7280; color: #64748b;
} }
.error { .error {
colour: #dc2626; color: #dc2626;
padding: 0.75rem; padding: 0.75rem;
background: #fef2f2; background: #fef2f2;
border-radius: 0.375rem; border: 1px solid #fecaca;
border-radius: 0.75rem;
font-size: 0.875rem; font-size: 0.875rem;
} }
@media (max-width: 720px) {
.shell {
padding: 0.875rem;
border-radius: 0.875rem;
}
.summary {
flex-direction: column;
align-items: flex-start;
}
.summary-stats {
justify-content: flex-start;
}
.toolbar {
flex-direction: column;
align-items: stretch;
}
}
`; `;
@property({ attribute: 'api-url' }) apiUrl = ''; @property({ attribute: 'api-url' }) apiUrl = '';
@ -262,68 +433,95 @@ export class ScmMarketplace extends LitElement {
render() { render() {
return html` return html`
<div class="toolbar"> <div class="shell">
<input <div class="summary">
type="text" <div class="summary-copy">
class="search" <span class="summary-title">Marketplace</span>
placeholder="Search providers\u2026" <span class="summary-subtitle">
.value=${this.searchQuery} Browse, filter, and install providers from the current index.
@input=${this.handleSearch} </span>
/> </div>
</div> <div class="summary-stats">
<div class="stat">
${this.categories.length > 0 <span class="stat-value">${this.modules.length}</span>
? html` <span class="stat-label">Results</span>
<div class="categories">
${this.categories.map(
(cat) => html`
<button
class="category-btn ${this.activeCategory === cat ? 'active' : ''}"
@click=${() => this.handleCategoryClick(cat)}
>
${cat}
</button>
`,
)}
</div> </div>
` <div class="stat">
: nothing} <span class="stat-value">${this.categories.length}</span>
${this.error ? html`<div class="error">${this.error}</div>` : nothing} <span class="stat-label">Categories</span>
${this.loading </div>
? html`<div class="loading">Loading marketplace\u2026</div>` </div>
: this.modules.length === 0 </div>
? html`<div class="empty">No providers found.</div>`
: html` <div class="toolbar">
<div class="grid"> <input
${this.modules.map( type="text"
(mod) => html` class="search"
<div class="card"> placeholder="Search providers\u2026"
<div class="card-header"> .value=${this.searchQuery}
@input=${this.handleSearch}
/>
${this.categories.length > 0
? html`
<div class="categories">
${this.categories.map(
(cat) => html`
<button
class="category-btn ${this.activeCategory === cat ? 'active' : ''}"
@click=${() => this.handleCategoryClick(cat)}
>
${cat}
</button>
`,
)}
</div>
`
: nothing}
</div>
${this.error ? html`<div class="error">${this.error}</div>` : nothing}
${this.loading
? html`<div class="loading">Loading marketplace\u2026</div>`
: this.modules.length === 0
? html`<div class="empty">No providers found.</div>`
: html`
<div class="grid">
${this.modules.map(
(mod) => html`
<div class="card">
<div> <div>
<div class="card-name">${mod.name}</div> <div class="card-header">
<div class="card-code">${mod.code}</div> <div>
<div class="card-name">${mod.name}</div>
<div class="card-code">${mod.code}</div>
</div>
${mod.category
? html`<span class="card-category">${mod.category}</span>`
: nothing}
</div>
<div class="card-repo">${mod.repo}</div>
<div class="card-sign ${mod.sign_key ? '' : 'unsigned'}">
${mod.sign_key ? 'Signed module' : 'Unsigned module'}
</div>
</div>
<div class="card-actions">
<button
class="install"
?disabled=${this.installing.has(mod.code)}
@click=${() => this.handleInstall(mod.code)}
>
${this.installing.has(mod.code) ? 'Installing\u2026' : 'Install'}
</button>
<button class="remove" @click=${() => this.handleRemove(mod.code)}>
Remove
</button>
</div> </div>
${mod.category
? html`<span class="card-category">${mod.category}</span>`
: nothing}
</div> </div>
<div class="card-actions"> `,
<button )}
class="install" </div>
?disabled=${this.installing.has(mod.code)} `}
@click=${() => this.handleInstall(mod.code)} </div>
>
${this.installing.has(mod.code) ? 'Installing\u2026' : 'Install'}
</button>
<button class="remove" @click=${() => this.handleRemove(mod.code)}>
Remove
</button>
</div>
</div>
`,
)}
</div>
`}
`; `;
} }
} }

View file

@ -31,9 +31,14 @@ export class ScmPanel extends LitElement {
:host { :host {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
font-family: system-ui, -apple-system, sans-serif; font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
sans-serif;
height: 100%; height: 100%;
background: #fafafa; background:
radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 30%),
linear-gradient(180deg, #eef2ff 0%, #f8fafc 28%, #f3f4f6 100%);
color: #111827;
} }
/* H — Header */ /* H — Header */
@ -41,68 +46,107 @@ export class ScmPanel extends LitElement {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0.75rem 1rem; gap: 1rem;
background: #fff; padding: 1rem 1.25rem;
border-bottom: 1px solid #e5e7eb; background: rgba(255, 255, 255, 0.86);
backdrop-filter: blur(18px);
border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.title-wrap {
display: flex;
flex-direction: column;
gap: 0.125rem;
} }
.title { .title {
font-weight: 700;
font-size: 1rem; font-size: 1rem;
colour: #111827; font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #0f172a;
}
.subtitle {
font-size: 0.8125rem;
color: #64748b;
} }
.refresh-btn { .refresh-btn {
padding: 0.375rem 0.75rem; padding: 0.5rem 0.875rem;
border: 1px solid #d1d5db; border: 1px solid rgba(99, 102, 241, 0.25);
border-radius: 0.375rem; border-radius: 999px;
background: #fff; background: linear-gradient(180deg, #ffffff, #eef2ff);
color: #4338ca;
font-weight: 600;
font-size: 0.8125rem; font-size: 0.8125rem;
cursor: pointer; cursor: pointer;
transition: background 0.15s; transition:
transform 0.15s ease,
box-shadow 0.15s ease,
background 0.15s ease;
box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
} }
.refresh-btn:hover { .refresh-btn:hover {
background: #f3f4f6; background: linear-gradient(180deg, #ffffff, #e0e7ff);
transform: translateY(-1px);
box-shadow: 0 8px 20px rgba(99, 102, 241, 0.12);
} }
/* H-L — Tabs */ /* H-L — Tabs */
.tabs { .tabs {
display: flex; display: flex;
gap: 0; gap: 0.375rem;
background: #fff; padding: 0.75rem 1rem 0;
border-bottom: 1px solid #e5e7eb; background: rgba(255, 255, 255, 0.72);
padding: 0 1rem; backdrop-filter: blur(18px);
border-bottom: 1px solid rgba(226, 232, 240, 0.9);
overflow-x: auto;
} }
.tab { .tab {
padding: 0.625rem 1rem; padding: 0.7rem 1rem;
font-size: 0.8125rem; font-size: 0.8125rem;
font-weight: 500; font-weight: 700;
colour: #6b7280; letter-spacing: 0.01em;
color: #64748b;
cursor: pointer; cursor: pointer;
border-bottom: 2px solid transparent; border: 1px solid transparent;
transition: all 0.15s; border-radius: 999px 999px 0 0;
background: none; transition:
border-top: none; color 0.15s ease,
border-left: none; background 0.15s ease,
border-right: none; border-color 0.15s ease,
transform 0.15s ease;
background: transparent;
} }
.tab:hover { .tab:hover {
colour: #374151; color: #334155;
transform: translateY(-1px);
} }
.tab.active { .tab.active {
colour: #6366f1; color: #4338ca;
border-bottom-colour: #6366f1; background: rgba(255, 255, 255, 0.96);
border-color: rgba(226, 232, 240, 0.9);
border-bottom-color: rgba(255, 255, 255, 0.96);
box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.6), 0 -8px 24px rgba(15, 23, 42, 0.04);
} }
/* C — Content */ /* C — Content */
.content { .content {
flex: 1; flex: 1;
padding: 1rem; padding: 1.25rem;
overflow-y: auto; overflow-y: auto;
display: flex;
justify-content: center;
align-items: flex-start;
}
.content > * {
width: min(100%, 1120px);
} }
/* F — Footer / Status bar */ /* F — Footer / Status bar */
@ -110,17 +154,20 @@ export class ScmPanel extends LitElement {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0.5rem 1rem; gap: 1rem;
background: #fff; padding: 0.75rem 1.25rem;
border-top: 1px solid #e5e7eb; background: rgba(255, 255, 255, 0.84);
backdrop-filter: blur(18px);
border-top: 1px solid rgba(226, 232, 240, 0.9);
font-size: 0.75rem; font-size: 0.75rem;
colour: #9ca3af; color: #64748b;
} }
.ws-status { .ws-status {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.375rem; gap: 0.375rem;
font-weight: 600;
} }
.ws-dot { .ws-dot {
@ -131,15 +178,33 @@ export class ScmPanel extends LitElement {
.ws-dot.connected { .ws-dot.connected {
background: #22c55e; background: #22c55e;
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
} }
.ws-dot.disconnected { .ws-dot.disconnected {
background: #ef4444; background: #ef4444;
box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
} }
.ws-dot.idle { .ws-dot.idle {
background: #d1d5db; background: #d1d5db;
} }
@media (max-width: 720px) {
.header,
.footer {
flex-direction: column;
align-items: flex-start;
}
.tabs {
padding-inline: 0.75rem;
}
.content {
padding: 0.875rem;
}
}
`; `;
@property({ attribute: 'api-url' }) apiUrl = ''; @property({ attribute: 'api-url' }) apiUrl = '';
@ -269,7 +334,10 @@ export class ScmPanel extends LitElement {
return html` return html`
<div class="header"> <div class="header">
<span class="title">SCM</span> <div class="title-wrap">
<span class="title">SCM</span>
<span class="subtitle">Marketplace, manifests, installed modules, and registry status</span>
</div>
<button class="refresh-btn" @click=${this.handleRefresh}>Refresh</button> <button class="refresh-btn" @click=${this.handleRefresh}>Refresh</button>
</div> </div>

View file

@ -22,23 +22,64 @@ export class ScmRegistry extends LitElement {
static styles = css` static styles = css`
:host { :host {
display: block; display: block;
font-family: system-ui, -apple-system, sans-serif; font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
sans-serif;
color: #111827;
}
.shell {
background: rgba(255, 255, 255, 0.84);
border: 1px solid rgba(226, 232, 240, 0.95);
border-radius: 1rem;
padding: 1rem;
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
backdrop-filter: blur(12px);
}
.summary {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid #e2e8f0;
}
.summary-copy {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.summary-title {
font-size: 1rem;
font-weight: 800;
color: #0f172a;
}
.summary-subtitle {
font-size: 0.8125rem;
color: #64748b;
} }
.list { .list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.375rem; gap: 0.625rem;
} }
.repo { .repo {
border: 1px solid #e5e7eb; border: 1px solid #e2e8f0;
border-radius: 0.5rem; border-radius: 1rem;
padding: 0.75rem 1rem; padding: 0.75rem 1rem;
background: #fff; background:
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: 1rem;
} }
.repo-info { .repo-info {
@ -46,14 +87,15 @@ export class ScmRegistry extends LitElement {
} }
.repo-name { .repo-name {
font-weight: 600; font-weight: 800;
font-size: 0.9375rem; font-size: 0.95rem;
font-family: monospace; font-family: monospace;
color: #0f172a;
} }
.repo-desc { .repo-desc {
font-size: 0.8125rem; font-size: 0.8125rem;
colour: #6b7280; color: #64748b;
margin-top: 0.125rem; margin-top: 0.125rem;
} }
@ -62,38 +104,48 @@ export class ScmRegistry extends LitElement {
gap: 0.5rem; gap: 0.5rem;
align-items: center; align-items: center;
margin-top: 0.25rem; margin-top: 0.25rem;
flex-wrap: wrap;
} }
.type-badge { .type-badge {
font-size: 0.6875rem; font-size: 0.6875rem;
padding: 0.0625rem 0.5rem; padding: 0.2rem 0.5rem;
border-radius: 1rem; border-radius: 999px;
font-weight: 600; font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.04em;
} }
.type-badge.foundation { .type-badge.foundation {
background: #dbeafe; background: #dbeafe;
colour: #1e40af; color: #1e40af;
} }
.type-badge.module { .type-badge.module {
background: #f3e8ff; background: #f3e8ff;
colour: #6b21a8; color: #6b21a8;
} }
.type-badge.product { .type-badge.product {
background: #dcfce7; background: #dcfce7;
colour: #166534; color: #166534;
} }
.type-badge.template { .type-badge.template {
background: #fef3c7; background: #fef3c7;
colour: #92400e; color: #92400e;
} }
.deps { .deps {
font-size: 0.75rem; font-size: 0.75rem;
colour: #9ca3af; color: #64748b;
}
.path {
font-size: 0.75rem;
font-family: monospace;
color: #475569;
word-break: break-word;
} }
.status { .status {
@ -110,38 +162,54 @@ export class ScmRegistry extends LitElement {
.status-dot.present { .status-dot.present {
background: #22c55e; background: #22c55e;
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
} }
.status-dot.missing { .status-dot.missing {
background: #ef4444; background: #ef4444;
box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
} }
.status-label { .status-label {
font-size: 0.75rem; font-size: 0.75rem;
colour: #6b7280; color: #64748b;
font-weight: 700;
} }
.empty { .empty {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
colour: #9ca3af; color: #64748b;
font-size: 0.875rem; font-size: 0.875rem;
} }
.loading { .loading {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
colour: #6b7280; color: #64748b;
} }
.error { .error {
colour: #dc2626; color: #dc2626;
padding: 0.75rem; padding: 0.75rem;
background: #fef2f2; background: #fef2f2;
border-radius: 0.375rem; border: 1px solid #fecaca;
border-radius: 0.75rem;
font-size: 0.875rem; font-size: 0.875rem;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
@media (max-width: 720px) {
.shell {
padding: 0.875rem;
}
.summary,
.repo {
flex-direction: column;
align-items: flex-start;
}
}
`; `;
@property({ attribute: 'api-url' }) apiUrl = ''; @property({ attribute: 'api-url' }) apiUrl = '';
@ -180,35 +248,51 @@ export class ScmRegistry extends LitElement {
} }
return html` return html`
${this.error ? html`<div class="error">${this.error}</div>` : nothing} <div class="shell">
${this.repos.length === 0 <div class="summary">
? html`<div class="empty">No repositories in registry.</div>` <div class="summary-copy">
: html` <span class="summary-title">Registry</span>
<div class="list"> <span class="summary-subtitle">
${this.repos.map( Workspace repositories and dependency order from repos.yaml.
(repo) => html` </span>
<div class="repo"> </div>
<div class="repo-info"> <div class="summary-copy" style="text-align:right">
<div class="repo-name">${repo.name}</div> <span class="summary-title">${this.repos.length}</span>
${repo.description <span class="summary-subtitle">Entries</span>
? html`<div class="repo-desc">${repo.description}</div>` </div>
: nothing} </div>
<div class="repo-meta">
<span class="type-badge ${repo.type}">${repo.type}</span> ${this.error ? html`<div class="error">${this.error}</div>` : nothing}
${repo.depends_on && repo.depends_on.length > 0 ${this.repos.length === 0
? html`<span class="deps">depends: ${repo.depends_on.join(', ')}</span>` ? html`<div class="empty">No repositories in registry.</div>`
: html`
<div class="list">
${this.repos.map(
(repo) => html`
<div class="repo">
<div class="repo-info">
<div class="repo-name">${repo.name}</div>
${repo.description
? html`<div class="repo-desc">${repo.description}</div>`
: nothing} : nothing}
<div class="repo-meta">
<span class="type-badge ${repo.type}">${repo.type}</span>
${repo.depends_on && repo.depends_on.length > 0
? html`<span class="deps">depends: ${repo.depends_on.join(', ')}</span>`
: nothing}
</div>
${repo.path ? html`<div class="path">${repo.path}</div>` : nothing}
</div>
<div class="status">
<span class="status-dot ${repo.exists ? 'present' : 'missing'}"></span>
<span class="status-label">${repo.exists ? 'Present' : 'Missing'}</span>
</div> </div>
</div> </div>
<div class="status"> `,
<span class="status-dot ${repo.exists ? 'present' : 'missing'}"></span> )}
<span class="status-label">${repo.exists ? 'Present' : 'Missing'}</span> </div>
</div> `}
</div> </div>
`,
)}
</div>
`}
`; `;
} }
} }