managarten/packages/website-blocks/src/spacer/Spacer.svelte
Till JS 54a12ffd5c feat(webapp): wire isParallelSafe in Companion chat + Mission runner
Enables the M1 parallel-reads optimisation on the webapp side. Both
consumers of runPlannerLoop pass an isParallelSafe predicate derived
from the tool catalog:

  isParallelSafe: (name) =>
    AI_TOOL_CATALOG_BY_NAME.get(name)?.defaultPolicy === 'auto'

Auto-policy tools (list_tasks, get_habits, nutrition_summary, …) run
via Promise.all in batches of 10 when the LLM fans them out in one
round. Propose-policy tools — which surface to the user as Proposal
cards — stay sequential so intent ordering in the inbox is preserved
and pre-execute guardrails can reason about prior-step state.

Tests: 31 existing companion + mission tests pass unchanged; the
parallel path is exercised via the new loop.test.ts cases shipped
with the M1 commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 14:11:24 +02:00

50 lines
1 KiB
Svelte

<script lang="ts">
import type { BlockRenderProps } from '../types';
import type { SpacerProps } from './schema';
let { block, mode }: BlockRenderProps<SpacerProps> = $props();
const isEdit = $derived(mode === 'edit');
</script>
<div
class="wb-spacer"
class:wb-spacer--sm={block.props.size === 'sm'}
class:wb-spacer--md={block.props.size === 'md'}
class:wb-spacer--lg={block.props.size === 'lg'}
class:wb-spacer--xl={block.props.size === 'xl'}
data-mode={mode}
>
{#if isEdit}
<span class="wb-spacer__label">Spacer ({block.props.size})</span>
{/if}
</div>
<style>
.wb-spacer {
display: flex;
align-items: center;
justify-content: center;
}
.wb-spacer--sm {
height: 1.5rem;
}
.wb-spacer--md {
height: 3rem;
}
.wb-spacer--lg {
height: 6rem;
}
.wb-spacer--xl {
height: 9rem;
}
.wb-spacer[data-mode='edit'] {
border: 1px dashed rgba(255, 255, 255, 0.1);
}
.wb-spacer__label {
font-size: 0.75rem;
opacity: 0.35;
letter-spacing: 0.05em;
text-transform: uppercase;
}
</style>