~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0
77 lines · 1.7 KB Raw History
<script lang="ts">
	import Icon from '../atoms/Icon.svelte';

	/**
	 * What is wrong with what is typed, each where it is and what: JSON's
	 * syntax first, then the server's problems with the view. Pressed, a
	 * problem is shown where it is in its editor.
	 */
	let { problems, onreveal }: { problems: { at: string | null; message: string }[]; onreveal: (index: number) => void } = $props();
</script>

<div class="problems" role="region" aria-label="Problems">
	<p class="head"><Icon name="issue" />{problems.length === 1 ? '1 problem' : `${problems.length} problems`}</p>
	<ul>
		{#each problems as problem, i (i)}
			<li>
				<button type="button" onclick={() => onreveal(i)}>
					{#if problem.at}<code>{problem.at}</code>{/if}
					<span>{problem.message}</span>
				</button>
			</li>
		{/each}
	</ul>
</div>

<style>
	.problems {
		display: flex;
		flex-direction: column;
		min-height: 0;
		border-top: var(--border);
		background: var(--panel);
	}

	.head {
		display: flex;
		flex: none;
		align-items: center;
		gap: var(--space-1-5);
		padding: var(--space-1-5) var(--space-3);
		color: var(--danger);
		font-size: var(--text-xs);
		font-weight: var(--weight-semibold);
	}

	ul {
		min-height: 0;
		margin: 0;
		padding: 0 0 var(--space-1);
		overflow-y: auto;
		list-style: none;
	}

	button {
		display: flex;
		flex-direction: column;
		gap: var(--space-0-5);
		width: 100%;
		padding: var(--space-1) var(--space-3);
		border: 0;
		background: none;
		color: var(--fg);
		font: var(--text-xs) / var(--leading) var(--font-sans);
		text-align: left;
		cursor: pointer;
	}

	button:hover {
		background: var(--hover);
	}

	code {
		color: var(--mute);
		font: var(--text-2xs) / var(--leading) var(--font-mono);
		overflow-wrap: anywhere;
	}
</style>