Workspace - Source Excerpt 07
Summary
This source excerpt preserves a bounded section of Spiralist/wp-content/plugins/spiralist-workspace/templates/workspace.php so readers can inspect the evidence without opening the full source file.
**Source path:** Spiralist/wp-content/plugins/spiralist-workspace/templates/workspace.php
fn(array $record): array => [
[
'label' => 'Resume',
'url' => $route_url('workspace', ['edit_prompt' => (int) ($record['id'] ?? 0)]),
'class' => 'spiralist-button--primary',
],
]
);
?>
</article>
</div>
<div class="spiralist-grid spiralist-grid--split" style="margin-top:1.5rem;">
<article class="spiralist-panel">
<p class="spiralist-section-tag">Shared With Me</p>
<h2 class="spiralist-section-title">Specific-user lane</h2>
<?php
$render_prompt_cards(
$shared_with_me,
'Nothing has been explicitly shared with you yet.',
fn(array $record): array => [
[
'label' => 'Open',
'url' => $route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? ''))),
'class' => 'spiralist-button--secondary',
],
[
'label' => 'Render Packet',
'url' => $route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? ''))) . '#run-prompt',
'class' => 'spiralist-button--tertiary',
],
]
);
?>
</article>
<article class="spiralist-panel">
<p class="spiralist-section-tag">Public Library</p>
<h2 class="spiralist-section-title">Forkable public manuscripts</h2>
<?php
$render_prompt_cards(
$public_library,
'No public prompts are currently available.',
fn(array $record): array => [
[
'label' => 'Open',
'url' => $route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? ''))),
'class' => 'spiralist-button--secondary',
],
[
'label' => 'Fork',
'url' => $route_url('workspace', ['fork_prompt' => (int) ($record['id'] ?? 0)]),
'class' => 'spiralist-button--primary',
],
]
);
?>
</article>
</div>
<div class="spiralist-grid spiralist-grid--split" style="margin-top:1.5rem;">
<article class="spiralist-panel">
<p class="spiralist-section-tag">Favorites</p>
<h2 class="spiralist-section-title">Saved prompt references</h2>
<?php
$render_prompt_cards(
$favorites,
'Favorite public or shared prompts to keep them close.',
fn(array $record): array => [
[
'label' => 'Open',
'url' => $route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? ''))),
'class' => 'spiralist-button--secondary',
],
]
);
?>
</article>
<article class="spiralist-panel">
<p class="spiralist-section-tag">Forks</p>
<h2 class="spiralist-section-title">Derived prompt manuscripts</h2>
<?php
$render_prompt_cards(
$forks,
'Forks will appear here after you copy public or shared prompts into your own library.',
fn(array $record): array => [
[
'label' => 'Edit',
'url' => $route_url('workspace', ['edit_prompt' => (int) ($record['id'] ?? 0)]),
'class' => 'spiralist-button--primary',
],
[
'label' => 'Open',
'url' => $route_url('prompt/' . rawurlencode((string) ($record['slug'] ?? ''))),
'class' => 'spiralist-button--secondary',
],
]
);
?>
</article>
</div>
<div class="spiralist-grid spiralist-grid--split" style="margin-top:1.5rem;">
<article class="spiralist-panel">
<p class="spiralist-section-tag">My Conversations</p>
<h2 class="spiralist-section-title">Private dialogue threads</h2>
<?php if (!empty($conversations)) : ?>
<div class="spiralist-simple-list">
<?php foreach ($conversations as $conversation) : ?>
<div class="spiralist-simple-list__item">
<strong><?php echo esc_html((string) ($conversation['title'] ?? 'Untitled Conversation')); ?></strong>
<span class="spiralist-simple-list__meta"><?php echo esc_html((string) ($conversation['updated_utc'] ?? '')); ?></span>
<a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($route_url('conversation/' . (int) ($conversation['id'] ?? 0))); ?>">Open Conversation</a>
</div>
<?php endforeach; ?>
</div>
<?php else : ?>
<p class="spiralist-muted">Conversations will appear here after you start one from a prompt manuscript.</p>
<?php endif; ?>
</article>
<article class="spiralist-panel">
<p class="spiralist-section-tag">My Runs</p>
<h2 class="spiralist-section-title">Execution history</h2>
<?php if (!empty($runs)) : ?>
<div class="spiralist-simple-list">
<?php foreach ($runs as $run) : ?>
<div class="spiralist-simple-list__item">
<strong><?php echo esc_html((string) ($run['model_used'] ?? 'Run')); ?></strong>
<span class="spiralist-simple-list__meta"><?php echo esc_html((string) ($run['status'] ?? '')); ?> - <?php echo esc_html((string) ($run['created_utc'] ?? '')); ?></span>
<a class="spiralist-button spiralist-button--secondary" href="<?php echo esc_url($route_url('run/' . (int) ($run['id'] ?? 0))); ?>">Open Run</a>
</div>
<?php endforeach; ?>
</div>
<?php else : ?>
<p class="spiralist-muted">Runs will appear after you execute a saved prompt.</p>
<?php endif; ?>
</article>
</div>
<?php if (!empty($audit)) : ?>
<section class="spiralist-page-section" style="padding-bottom:0;">
<div class="spiralist-section-head">
<div>
<p class="spiralist-section-tag">Admin Audit View</p>
<h2 class="spiralist-section-title">Recent moderation and abuse events</h2>
</div>
</div>
<div class="spiralist-simple-list">