Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

expose all 14 POST LLM drill types in a responsive domain-grouped config

[._.]/ Adam Eivy928eae277013
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 9654de3316..54a5f0b57c 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -24,6 +24,10 @@
- **[issue-1969] Media Generation Settings is now grouped into tabs.** The image/video backend settings surface — one long flat scroll rendered by the Image Gen, Video Gen, and Storyboard settings drawers — now groups its fields into a pills sub-navigation (Backend / External / Local / Codex CLI / Tokens / Expose / Test) that collapses to a `<select>` on mobile, so no single section is page-length. The grouping is internal to `ImageGenTab` (built on the shared `TabPills`), so it renders identically in every host drawer with no tabs-within-tabs; the active sub-tab deep-links via a `?mediaTab=` search param (`useDrawerTab`) so an open section is shareable and reload-safe. The Save + Test Connection bar stays pinned below the tabs on every section. All existing controls, save/test behavior, and label wiring are unchanged. The Local tab is kept mounted (hidden) once visited so switching tabs during a long-running pip install (e.g. a 10-minute torch upgrade) no longer tears down its stream and cancels the install. (`client/src/components/settings/ImageGenTab.jsx`, Closes #1969)
+## MeatSpace POST
+
+- **[issue-1987] The POST drill config now exposes all 14 LLM drill types in a responsive, domain-grouped layout.** The Drill Configuration screen (`PostDrillConfig.jsx`) previously showed a single narrow column that only surfaced 5 of the 14 generatable LLM drills — so the entire **Imagination** family (What If?, Alternative Uses, Story Prompt, Invention Pitch, Reframe) plus **Compound Chain**, **Bridge Word**, **Double Meaning**, and **Idiom Twist** could be generated server-side but never toggled on for a session. All 14 are now shown as toggle cards grouped under **Wordplay / Verbal Agility / Imagination** section headers, laid out in a responsive grid (single column on mobile, up to three columns on desktop) instead of one page-length stack. Enabling any of them and saving persists via `PUT /post/config` and makes the drill appear in Full POST and Quick 5 Min sessions. (`client/src/components/meatspace/post/PostDrillConfig.jsx`, Closes #1987)
+
## Music Video
- **Deep-link straight to a project's scene board.** The Music Video page's selected project now lives in the URL (`/media/music-video/:projectId`) instead of local component state, so a project's edit/scene-selection board is directly shareable, bookmarkable, and reachable from ⌘K, voice nav, and the media job-completion hooks — clicking a project navigates to its id'd route, deleting the open project returns to the index, and a stale/deleted id renders a "project not found → back to projects" fallback rather than a blank selection. Establishes the project-wide convention (now documented in `CLAUDE.md`) that every selectable UI element encodes its selection in the URL by id. (`client/src/pages/MusicVideo.jsx`, `client/src/App.jsx`)
diff --git a/client/src/components/meatspace/post/PostDrillConfig.jsx b/client/src/components/meatspace/post/PostDrillConfig.jsx
index 9d9b57050c..593dadd1d9 100644
--- a/client/src/components/meatspace/post/PostDrillConfig.jsx
+++ b/client/src/components/meatspace/post/PostDrillConfig.jsx
@@ -51,49 +51,89 @@ const DRILL_META = {
}
};
+// LLM drill config meta for all 14 generatable types.
+// `count` defaults mirror the server (`server/services/meatspacePostLlm.js`,
+// `config.count || N`); `timeLimitSec` defaults follow the DEFAULT_CONFIG
+// pattern in `server/services/meatspacePost.js`.
+const llmFields = () => [
+ { key: 'count', label: 'Prompts', type: 'number', min: 1, max: 10 },
+ { key: 'timeLimitSec', label: 'Time Limit (sec)', type: 'number', min: 30, max: 300 }
+];
+
const LLM_DRILL_META = {
- 'word-association': {
- label: 'Word Association',
- desc: 'Associate freely with given words — trains lateral thinking',
- fields: [
- { key: 'count', label: 'Prompts', type: 'number', min: 1, max: 10 },
- { key: 'timeLimitSec', label: 'Time Limit (sec)', type: 'number', min: 30, max: 300 }
- ]
- },
- 'story-recall': {
- label: 'Story Recall',
- desc: 'Read a paragraph, then answer questions from memory',
- fields: [
- { key: 'count', label: 'Stories', type: 'number', min: 1, max: 5 },
- { key: 'timeLimitSec', label: 'Time Limit (sec)', type: 'number', min: 60, max: 600 }
- ]
- },
- 'verbal-fluency': {
- label: 'Verbal Fluency',
- desc: 'Name as many items in a category as possible',
- fields: [
- { key: 'count', label: 'Categories', type: 'number', min: 1, max: 5 },
- { key: 'timeLimitSec', label: 'Time Limit (sec)', type: 'number', min: 30, max: 180 }
- ]
- },
- 'wit-comeback': {
- label: 'Wit & Comeback',
- desc: 'Craft witty responses to scenarios — trains verbal agility',
- fields: [
- { key: 'count', label: 'Scenarios', type: 'number', min: 1, max: 10 },
- { key: 'timeLimitSec', label: 'Time Limit (sec)', type: 'number', min: 30, max: 300 }
- ]
- },
- 'pun-wordplay': {
- label: 'Pun & Wordplay',
- desc: 'Create puns and wordplay on given topics',
- fields: [
- { key: 'count', label: 'Challenges', type: 'number', min: 1, max: 10 },
- { key: 'timeLimitSec', label: 'Time Limit (sec)', type: 'number', min: 30, max: 300 }
- ]
- }
+ // --- Wordplay ---
+ 'pun-wordplay': { label: 'Pun & Wordplay', desc: 'Create puns and wordplay on given topics', fields: llmFields() },
+ 'word-association': { label: 'Word Association', desc: 'Associate freely with given words — trains lateral thinking', fields: llmFields() },
+ 'compound-chain': { label: 'Compound Chain', desc: 'Chain compound words/phrases from a seed word', fields: llmFields() },
+ 'bridge-word': { label: 'Bridge Word', desc: 'Find a word that links two others', fields: llmFields() },
+ 'double-meaning': { label: 'Double Meaning', desc: 'Exploit words with two meanings', fields: llmFields() },
+ 'idiom-twist': { label: 'Idiom Twist', desc: 'Twist familiar idioms into new phrases', fields: llmFields() },
+ // --- Verbal Agility ---
+ 'story-recall': { label: 'Story Recall', desc: 'Read a paragraph, then answer questions from memory', fields: llmFields() },
+ 'verbal-fluency': { label: 'Verbal Fluency', desc: 'Name as many items in a category as possible', fields: llmFields() },
+ 'wit-comeback': { label: 'Wit & Comeback', desc: 'Craft witty responses to scenarios — trains verbal agility', fields: llmFields() },
+ // --- Imagination ---
+ 'what-if': { label: 'What If?', desc: 'Explore creative hypothetical scenarios', fields: llmFields() },
+ 'alternative-uses': { label: 'Alternative Uses', desc: 'List unconventional uses for everyday objects', fields: llmFields() },
+ 'story-prompt': { label: 'Story Prompt', desc: 'Spin a short story from a creative prompt', fields: llmFields() },
+ 'invention-pitch': { label: 'Invention Pitch', desc: 'Pitch inventions that solve quirky problems', fields: llmFields() },
+ 'reframe': { label: 'Reframe', desc: 'Reframe a frustrating situation positively or humorously', fields: llmFields() }
};
+// LLM drills grouped by their DOMAINS key for section-headered rendering.
+const LLM_DRILL_GROUPS = [
+ { key: 'wordplay', label: 'Wordplay', types: ['pun-wordplay', 'word-association', 'compound-chain', 'bridge-word', 'double-meaning', 'idiom-twist'] },
+ { key: 'verbal', label: 'Verbal Agility', types: ['story-recall', 'verbal-fluency', 'wit-comeback'] },
+ { key: 'imagination', label: 'Imagination', types: ['what-if', 'alternative-uses', 'story-prompt', 'invention-pitch', 'reframe'] }
+];
+
+const CARD_GRID = 'grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4';
+
+function DrillCard({ meta, drillConfig, enabled, accent, onToggle, onUpdateField }) {
+ const activeBorder = accent === 'accent-2' ? 'border-port-accent-2/30' : 'border-port-border';
+ const toggleBg = accent === 'accent-2' ? 'bg-port-accent-2' : 'bg-port-accent';
+ return (
+ <div className={`bg-port-card border rounded-lg p-4 transition-colors ${
+ enabled ? activeBorder : 'border-port-border/50 opacity-60'
+ }`}>
+ <div className="flex items-center justify-between mb-3">
+ <div>
+ <h3 className="text-white font-medium">{meta.label}</h3>
+ <p className="text-gray-500 text-xs">{meta.desc}</p>
+ </div>
+ <button
+ onClick={onToggle}
+ className={`shrink-0 w-10 h-5 rounded-full transition-colors relative ${
+ enabled ? toggleBg : 'bg-port-border'
+ }`}
+ >
+ <div className={`absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform ${
+ enabled ? 'translate-x-5' : 'translate-x-0.5'
+ }`} />
+ </button>
+ </div>
+
+ {enabled && (
+ <div className="grid grid-cols-2 gap-3">
+ {meta.fields.map(field => (
+ <div key={field.key}>
+ <label className="text-xs text-gray-500 mb-1 block">{field.label}</label>
+ <input
+ type="number"
+ min={field.min}
+ max={field.max}
+ value={drillConfig[field.key] ?? ''}
+ onChange={e => onUpdateField(field.key, e.target.value)}
+ className="w-full bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm text-white focus:border-port-accent focus:outline-none"
+ />
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+}
+
export default function PostDrillConfig({ config, onSaved, onBack }) {
const [drillTypes, setDrillTypes] = useState(
() => config?.mentalMath?.drillTypes || {}
@@ -120,7 +160,7 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {
function toggleDrill(type) {
setDrillTypes(prev => ({
...prev,
- [type]: { ...prev[type], enabled: !prev[type]?.enabled }
+ [type]: { ...prev[type], enabled: !(prev[type]?.enabled !== false) }
}));
}
@@ -175,7 +215,7 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {
}
return (
- <div className="space-y-6 max-w-2xl">
+ <div className="space-y-6">
{/* Header */}
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
@@ -194,64 +234,36 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {
</button>
</div>
- {/* Drill Cards */}
{/* Mental Math Section */}
- <h3 className="text-sm font-medium text-gray-500 uppercase tracking-wider">Mental Math</h3>
- {Object.entries(DRILL_META).map(([type, meta]) => {
- const drillConfig = drillTypes[type] || {};
- const enabled = drillConfig.enabled !== false;
-
- return (
- <div key={type} className={`bg-port-card border rounded-lg p-4 transition-colors ${
- enabled ? 'border-port-border' : 'border-port-border/50 opacity-60'
- }`}>
- <div className="flex items-center justify-between mb-3">
- <div>
- <h3 className="text-white font-medium">{meta.label}</h3>
- <p className="text-gray-500 text-xs">{meta.desc}</p>
- </div>
- <button
- onClick={() => toggleDrill(type)}
- className={`w-10 h-5 rounded-full transition-colors relative ${
- enabled ? 'bg-port-accent' : 'bg-port-border'
- }`}
- >
- <div className={`absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform ${
- enabled ? 'translate-x-5' : 'translate-x-0.5'
- }`} />
- </button>
- </div>
-
- {enabled && (
- <div className="grid grid-cols-3 gap-3">
- {meta.fields.map(field => (
- <div key={field.key}>
- <label className="text-xs text-gray-500 mb-1 block">{field.label}</label>
- <input
- type="number"
- min={field.min}
- max={field.max}
- value={drillConfig[field.key] ?? ''}
- onChange={e => updateField(type, field.key, e.target.value)}
- className="w-full bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm text-white focus:border-port-accent focus:outline-none"
- />
- </div>
- ))}
- </div>
- )}
- </div>
- );
- })}
+ <div className="space-y-3">
+ <h3 className="text-sm font-medium text-gray-500 uppercase tracking-wider">Mental Math</h3>
+ <div className={CARD_GRID}>
+ {Object.entries(DRILL_META).map(([type, meta]) => {
+ const drillConfig = drillTypes[type] || {};
+ return (
+ <DrillCard
+ key={type}
+ meta={meta}
+ drillConfig={drillConfig}
+ enabled={drillConfig.enabled !== false}
+ accent="accent"
+ onToggle={() => toggleDrill(type)}
+ onUpdateField={(key, value) => updateField(type, key, value)}
+ />
+ );
+ })}
+ </div>
+ </div>
{/* LLM Drills Section */}
- <div className="flex items-center justify-between mt-6">
+ <div className="flex items-center justify-between pt-2">
<div className="flex items-center gap-2">
<Brain size={16} className="text-port-accent-2" />
- <h3 className="text-sm font-medium text-gray-500 uppercase tracking-wider">Wit & Memory (LLM)</h3>
+ <h3 className="text-sm font-medium text-gray-500 uppercase tracking-wider">Wit &amp; Memory (LLM)</h3>
</div>
<button
onClick={() => setLlmEnabled(!llmEnabled)}
- className={`w-10 h-5 rounded-full transition-colors relative ${
+ className={`shrink-0 w-10 h-5 rounded-full transition-colors relative ${
llmEnabled ? 'bg-port-accent-2' : 'bg-port-border'
}`}
>
@@ -262,11 +274,11 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {
</div>
{llmEnabled && (
- <>
+ <div className="space-y-6">
{/* Provider & Model Selection */}
<div className="bg-port-card border border-port-accent-2/30 rounded-lg p-4">
<h4 className="text-sm font-medium text-gray-400 mb-3">AI Provider</h4>
- <div className="grid grid-cols-2 gap-3">
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
<div>
<label className="text-xs text-gray-500 mb-1 block">Provider</label>
<select
@@ -296,53 +308,30 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {
</div>
</div>
- {/* LLM Drill Cards */}
- {Object.entries(LLM_DRILL_META).map(([type, meta]) => {
- const drillConfig = llmDrillTypes[type] || {};
- const enabled = drillConfig.enabled !== false;
-
- return (
- <div key={type} className={`bg-port-card border rounded-lg p-4 transition-colors ${
- enabled ? 'border-port-accent-2/30' : 'border-port-border/50 opacity-60'
- }`}>
- <div className="flex items-center justify-between mb-3">
- <div>
- <h3 className="text-white font-medium">{meta.label}</h3>
- <p className="text-gray-500 text-xs">{meta.desc}</p>
- </div>
- <button
- onClick={() => toggleLlmDrill(type)}
- className={`w-10 h-5 rounded-full transition-colors relative ${
- enabled ? 'bg-port-accent-2' : 'bg-port-border'
- }`}
- >
- <div className={`absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform ${
- enabled ? 'translate-x-5' : 'translate-x-0.5'
- }`} />
- </button>
- </div>
-
- {enabled && (
- <div className="grid grid-cols-2 gap-3">
- {meta.fields.map(field => (
- <div key={field.key}>
- <label className="text-xs text-gray-500 mb-1 block">{field.label}</label>
- <input
- type="number"
- min={field.min}
- max={field.max}
- value={drillConfig[field.key] ?? ''}
- onChange={e => updateLlmField(type, field.key, e.target.value)}
- className="w-full bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm text-white focus:border-port-accent focus:outline-none"
- />
- </div>
- ))}
- </div>
- )}
+ {/* LLM Drill Cards grouped by domain */}
+ {LLM_DRILL_GROUPS.map(group => (
+ <div key={group.key} className="space-y-3">
+ <h4 className="text-sm font-medium text-gray-500 uppercase tracking-wider">{group.label}</h4>
+ <div className={CARD_GRID}>
+ {group.types.map(type => {
+ const meta = LLM_DRILL_META[type];
+ const drillConfig = llmDrillTypes[type] || {};
+ return (
+ <DrillCard
+ key={type}
+ meta={meta}
+ drillConfig={drillConfig}
+ enabled={drillConfig.enabled !== false}
+ accent="accent-2"
+ onToggle={() => toggleLlmDrill(type)}
+ onUpdateField={(key, value) => updateLlmField(type, key, value)}
+ />
+ );
+ })}
</div>
- );
- })}
- </>
+ </div>
+ ))}
+ </div>
)}
</div>
);
diff --git a/server/lib/postValidation.test.js b/server/lib/postValidation.test.js
index 56544a8ecf..e487bb4e25 100644
--- a/server/lib/postValidation.test.js
+++ b/server/lib/postValidation.test.js
@@ -1,5 +1,27 @@
import { describe, it, expect } from 'vitest';
-import { postLlmScoreRequestSchema } from './postValidation.js';
+import { postLlmScoreRequestSchema, postConfigUpdateSchema, LLM_DRILL_TYPES } from './postValidation.js';
+
+describe('postConfigUpdateSchema llmDrills', () => {
+ // Regression: the config UI (PostDrillConfig.jsx) exposed only 5 of the 14
+ // LLM drill types. All 14 are generatable server-side and must be persistable
+ // via PUT /post/config, so the schema must accept a per-type config for each.
+ it('accepts a config entry for every LLM drill type', () => {
+ const drillTypes = Object.fromEntries(
+ LLM_DRILL_TYPES.map(type => [type, { enabled: true, count: 3, timeLimitSec: 120 }])
+ );
+ const parsed = postConfigUpdateSchema.parse({
+ llmDrills: { enabled: true, providerId: null, model: null, drillTypes }
+ });
+ expect(Object.keys(parsed.llmDrills.drillTypes)).toHaveLength(14);
+ expect(Object.keys(parsed.llmDrills.drillTypes).sort()).toEqual([...LLM_DRILL_TYPES].sort());
+ });
+
+ it('rejects an unknown LLM drill type key', () => {
+ expect(() => postConfigUpdateSchema.parse({
+ llmDrills: { drillTypes: { 'not-a-drill': { enabled: true } } }
+ })).toThrow();
+ });
+});
describe('postLlmScoreRequestSchema', () => {
// Regression: Zod's default strip mode dropped `questionIndex` from each