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

add a POST Practice Library so every test type is findable in one place

[._.]/ Adam Eivyb9e0d0bdff7a
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsx
index 19015d33ea..e6d50f7459 100644
--- a/client/src/components/Layout.jsx
+++ b/client/src/components/Layout.jsx
@@ -56,6 +56,7 @@ import {
ClipboardList,
ListChecks,
Compass,
+ Feather,
Scale,
LayoutDashboard,
Lightbulb,
@@ -367,12 +368,14 @@ const navItems = [
defaultTo: '/post/launcher',
children: [
{ to: '/post/config', label: 'Config', icon: Settings },
+ { to: '/post/explore', label: 'Explore', icon: Compass },
{ to: '/post/history', label: 'History', icon: History },
{ to: '/post/launcher', label: 'Launcher', icon: Play },
{ to: '/post/memory', label: 'Memory', icon: Brain },
{ to: '/post/morse', label: 'Morse', icon: Radio },
{ to: '/post/plan', label: 'Practice Plan', icon: ListChecks },
{ to: '/post/progress', label: 'Progress', icon: TrendingUp },
+ { to: '/post/rhetoric', label: 'Rhetoric', icon: Feather },
{ to: '/post/wordplay', label: 'Wordplay', icon: MessageCircle },
],
},
diff --git a/client/src/components/meatspace/post/BrowseCatalogLink.jsx b/client/src/components/meatspace/post/BrowseCatalogLink.jsx
new file mode 100644
index 0000000000..38656cad84
--- /dev/null
+++ b/client/src/components/meatspace/post/BrowseCatalogLink.jsx
@@ -0,0 +1,28 @@
+import { Link } from 'react-router';
+import { ArrowRight, Compass } from 'lucide-react';
+
+/**
+ * The "there is more than what's on this page" link into the Practice Library.
+ *
+ * Every POST surface that shows a FILTERED view — the launcher's enabled-drill
+ * summaries, the Practice Plan's topic toggles — needs one, because each of them
+ * reads as the complete inventory and isn't. One component so the three call
+ * sites can't drift in prose or styling.
+ */
+export default function BrowseCatalogLink({ label = 'Browse every test type', hint }) {
+ return (
+ <Link
+ to="/post/explore"
+ className="flex items-center justify-between gap-2 px-4 py-2.5 bg-port-card border border-port-border rounded-lg text-sm text-gray-400 hover:text-white hover:border-port-accent/60 transition-colors"
+ >
+ <span className="flex items-center gap-2 min-w-0">
+ <Compass size={14} className="shrink-0 text-port-accent" />
+ <span className="min-w-0">
+ {hint && <span className="text-gray-500">{hint} </span>}
+ {label}
+ </span>
+ </span>
+ <ArrowRight size={14} className="shrink-0" />
+ </Link>
+ );
+}
diff --git a/client/src/components/meatspace/post/MemoryPractice.jsx b/client/src/components/meatspace/post/MemoryPractice.jsx
index de043aea70..473612d541 100644
--- a/client/src/components/meatspace/post/MemoryPractice.jsx
+++ b/client/src/components/meatspace/post/MemoryPractice.jsx
@@ -5,7 +5,10 @@ import ProgressBar from '../../ui/ProgressBar';
import PostCompletionActions from './PostCompletionActions';
import { startRetryableSave } from './completionSave';
-const MODES = [
+// Exported so the Practice Library (practiceCatalog.js) derives its study-mode
+// rows from this list rather than re-typing them — a new mode shows up in the
+// catalog for free, which is the whole point of that page.
+export const MODES = [
{ id: 'learn', label: 'Learn', desc: 'Progressive reveal — read and absorb line by line' },
{ id: 'fill-blank', label: 'Fill in the Blank', desc: 'Fill missing words in partially shown lines' },
{ id: 'sequence', label: 'Sequence Recall', desc: 'Given a line, type what comes next' },
diff --git a/client/src/components/meatspace/post/MorseTrainer.jsx b/client/src/components/meatspace/post/MorseTrainer.jsx
index 7ad56e4c0a..52c847fd6f 100644
--- a/client/src/components/meatspace/post/MorseTrainer.jsx
+++ b/client/src/components/meatspace/post/MorseTrainer.jsx
@@ -4,6 +4,7 @@ import useDrawerTab from '../../../hooks/useDrawerTab';
import useAudioSessionClaim from '../../../hooks/useAudioSessionClaim.js';
import useKeyCapture from '../../../hooks/useKeyCapture';
import { submitTrainingEntry, getTrainingStats, submitMorseRound, getMorseProgress, updateMorseLevel } from '../../../services/api';
+import { DRILL_DESCRIPTIONS } from './constants';
import MorseProgressPanel from './MorseProgressPanel';
import { streakGlyph } from '../../../lib/streakGlyph.js';
import { safeReadJsonStorage, safeWriteStorage } from '../../../lib/safeStorage';
@@ -105,6 +106,8 @@ const DEFAULT_PREFS = { wpm: 18, effectiveWpm: 18, hz: 700, kochLevel: DEFAULT_K
const RAMP_SEC = 0.005;
const TONE_GAIN = 0.25;
+// Mode ids map to the `morse-<id>` drill types, so the blurb lives once in
+// DRILL_DESCRIPTIONS (constants.js) and is read below — no second copy here.
export const MODES = [
{
id: 'copy',
@@ -112,7 +115,6 @@ export const MODES = [
icon: Headphones,
color: 'text-cyan-400',
bgColor: 'bg-cyan-500/20',
- description: 'Listen to Morse, type what you hear',
example: 'Koch progression: K, M → add letters as you hit 90%',
},
{
@@ -121,7 +123,6 @@ export const MODES = [
icon: EyeOff,
color: 'text-purple-400',
bgColor: 'bg-purple-500/20',
- description: 'Audio-only — no on-screen code hints or cheat sheet',
example: 'Same Koch pool, pure recall — nothing to look at',
},
{
@@ -130,7 +131,6 @@ export const MODES = [
icon: Hand,
color: 'text-amber-400',
bgColor: 'bg-amber-500/20',
- description: 'Hold spacebar (or tap) to key dits & dahs',
example: 'Tap short for ·, hold long for —',
},
];
@@ -686,7 +686,9 @@ function SliderRow({ label, value, min, max, step = 1, onChange, suffix = '', hi
);
}
-const REFERENCE_VIEWS = [
+// Exported for the same reason as MODES above: the Practice Library lists the
+// `?ref=` reference charts and must not keep its own copy of this list.
+export const REFERENCE_VIEWS = [
{ id: 'tree', label: 'Tree', icon: GitBranch },
{ id: 'length', label: 'Length', icon: Ruler },
{ id: 'list', label: 'List', icon: ListIcon },
@@ -895,7 +897,7 @@ function ModeGrid({ onPick }) {
<Icon size={18} className={m.color} />
</div>
<div className="text-white font-medium">{m.label}</div>
- <div className="text-xs text-gray-400 mt-1">{m.description}</div>
+ <div className="text-xs text-gray-400 mt-1">{DRILL_DESCRIPTIONS[`morse-${m.id}`]}</div>
<div className="text-[11px] text-gray-500 mt-2 font-mono">{m.example}</div>
</button>
);
diff --git a/client/src/components/meatspace/post/PostDrillConfig.jsx b/client/src/components/meatspace/post/PostDrillConfig.jsx
index c4e33da16f..0c78d8d48e 100644
--- a/client/src/components/meatspace/post/PostDrillConfig.jsx
+++ b/client/src/components/meatspace/post/PostDrillConfig.jsx
@@ -4,7 +4,7 @@ import { updatePostConfig, getProviders, getPostAdaptivePreview, getPostMultipli
import toast from '../../ui/Toast';
import { FormField } from '../../ui/FormField';
import { filterSelectableModels, enabledApiProviderFilter } from '../../../utils/providers';
-import { GOAL_DEFS, POST_TOPICS, MODULE_LABELS, composedSessionDrillTypes } from './constants';
+import { GOAL_DEFS, POST_TOPICS, MODULE_LABELS, DRILL_LABELS, DRILL_DESCRIPTIONS, composedSessionDrillTypes } from './constants';
// Modules a Full/Quick composed session can draw from (issue #2100), DERIVED
// from the shared topic registry so the list has one owner (issue #3252): a
@@ -47,16 +47,12 @@ function describeAdaptive(info) {
const DRILL_META = {
'doubling-chain': {
- label: 'Doubling Chain',
- desc: 'Double a number repeatedly',
fields: [
{ key: 'steps', label: 'Steps', type: 'number', min: 3, max: 20 },
{ key: 'timeLimitSec', label: 'Time Limit (sec)', type: 'number', min: 10, max: 300 }
]
},
'serial-subtraction': {
- label: 'Serial Subtraction',
- desc: 'Subtract a number repeatedly',
fields: [
{ key: 'steps', label: 'Steps', type: 'number', min: 3, max: 30 },
{ key: 'subtrahend', label: 'Subtract By', type: 'number', min: 1, max: 100 },
@@ -64,8 +60,6 @@ const DRILL_META = {
]
},
'multiplication': {
- label: 'Multiplication',
- desc: 'Multiply random numbers',
fields: [
{ key: 'count', label: 'Questions', type: 'number', min: 3, max: 30 },
{ key: 'maxDigits', label: 'Max Digits', type: 'number', min: 1, max: 4 },
@@ -73,8 +67,6 @@ const DRILL_META = {
]
},
'powers': {
- label: 'Powers',
- desc: 'Calculate base^exponent',
fields: [
{ key: 'count', label: 'Questions', type: 'number', min: 3, max: 20 },
{ key: 'maxExponent', label: 'Max Exponent', type: 'number', min: 2, max: 20 },
@@ -82,8 +74,6 @@ const DRILL_META = {
]
},
'estimation': {
- label: 'Estimation',
- desc: 'Approximate arithmetic results',
fields: [
{ key: 'count', label: 'Questions', type: 'number', min: 3, max: 20 },
{ key: 'tolerancePct', label: 'Tolerance %', type: 'number', min: 1, max: 50 },
@@ -91,8 +81,6 @@ const DRILL_META = {
]
},
'applied-numeracy': {
- label: 'Applied Numeracy',
- desc: 'Everyday percentages, ratios, units, rates, and estimation',
fields: [
{ key: 'count', label: 'Questions', type: 'number', min: 1, max: 20 },
{ key: 'difficulty', label: 'Complexity Level', type: 'number', min: 1, max: 3 },
@@ -128,22 +116,22 @@ const llmFields = () => [
const LLM_DRILL_META = {
// --- Wordplay ---
- 'pun-wordplay': { label: 'Pun & Wordplay', desc: 'Create puns and wordplay on given topics', fields: llmFields(), defaults: { enabled: true, count: 5, timeLimitSec: 120 } },
- 'word-association': { label: 'Word Association', desc: 'Associate freely with given words — trains lateral thinking', fields: llmFields(), defaults: { enabled: true, count: 5, timeLimitSec: 120 } },
- 'compound-chain': { label: 'Compound Chain', desc: 'Chain compound words/phrases from a seed word', fields: llmFields(), defaults: { enabled: false, count: 5, timeLimitSec: 120 } },
- 'bridge-word': { label: 'Bridge Word', desc: 'Find a word that links two others', fields: llmFields(), defaults: { enabled: false, count: 5, timeLimitSec: 120 } },
- 'double-meaning': { label: 'Double Meaning', desc: 'Exploit words with two meanings', fields: llmFields(), defaults: { enabled: false, count: 5, timeLimitSec: 120 } },
- 'idiom-twist': { label: 'Idiom Twist', desc: 'Twist familiar idioms into new phrases', fields: llmFields(), defaults: { enabled: false, count: 5, timeLimitSec: 120 } },
+ 'pun-wordplay': { fields: llmFields(), defaults: { enabled: true, count: 5, timeLimitSec: 120 } },
+ 'word-association': { fields: llmFields(), defaults: { enabled: true, count: 5, timeLimitSec: 120 } },
+ 'compound-chain': { fields: llmFields(), defaults: { enabled: false, count: 5, timeLimitSec: 120 } },
+ 'bridge-word': { fields: llmFields(), defaults: { enabled: false, count: 5, timeLimitSec: 120 } },
+ 'double-meaning': { fields: llmFields(), defaults: { enabled: false, count: 5, timeLimitSec: 120 } },
+ 'idiom-twist': { fields: llmFields(), defaults: { enabled: false, count: 5, timeLimitSec: 120 } },
// --- Verbal Agility ---
- 'story-recall': { label: 'Story Recall', desc: 'Read a paragraph, then answer questions from memory', fields: llmFields(), defaults: { enabled: true, count: 3, timeLimitSec: 180 } },
- 'verbal-fluency': { label: 'Verbal Fluency', desc: 'Name as many items in a category as possible', fields: llmFields(), defaults: { enabled: true, count: 3, timeLimitSec: 60 } },
- 'wit-comeback': { label: 'Wit & Comeback', desc: 'Craft witty responses to scenarios — trains verbal agility', fields: llmFields(), defaults: { enabled: true, count: 5, timeLimitSec: 120 } },
+ 'story-recall': { fields: llmFields(), defaults: { enabled: true, count: 3, timeLimitSec: 180 } },
+ 'verbal-fluency': { fields: llmFields(), defaults: { enabled: true, count: 3, timeLimitSec: 60 } },
+ 'wit-comeback': { fields: llmFields(), defaults: { enabled: true, count: 5, timeLimitSec: 120 } },
// --- Imagination ---
- 'what-if': { label: 'What If?', desc: 'Explore creative hypothetical scenarios', fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } },
- 'alternative-uses': { label: 'Alternative Uses', desc: 'List unconventional uses for everyday objects', fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } },
- 'story-prompt': { label: 'Story Prompt', desc: 'Spin a short story from a creative prompt', fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } },
- 'invention-pitch': { label: 'Invention Pitch', desc: 'Pitch inventions that solve quirky problems', fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } },
- 'reframe': { label: 'Reframe', desc: 'Reframe a frustrating situation positively or humorously', fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } }
+ 'what-if': { fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } },
+ 'alternative-uses': { fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } },
+ 'story-prompt': { fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } },
+ 'invention-pitch': { fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } },
+ 'reframe': { fields: llmFields(), defaults: { enabled: false, count: 3, timeLimitSec: 180 } }
};
const LLM_TYPES = Object.keys(LLM_DRILL_META);
@@ -185,8 +173,6 @@ function seedLlmDrillTypes(saved) {
// promised behavior that didn't happen (issue #2008).
const COGNITIVE_DRILL_META = {
'n-back': {
- label: 'N-Back',
- desc: 'Signal when a letter matches the one N steps back — working memory',
// `progressive: true` marks a laddered drill (ProgressiveBadge + toggle
// render). `ladderFields` are the knobs the ladder actually drives per rung
// (server/lib/postProgression.js COGNITIVE_LADDERS) — ONLY these are hidden
@@ -203,8 +189,6 @@ const COGNITIVE_DRILL_META = {
defaults: { enabled: true, progressive: true, n: 2, length: 20, stimulusMs: 2500 },
},
'digit-span': {
- label: 'Digit Span',
- desc: 'Recall a shown digit sequence forward or backward',
progressive: true,
ladderFields: ['direction', 'startLength', 'maxLength'],
fields: [
@@ -219,8 +203,6 @@ const COGNITIVE_DRILL_META = {
defaults: { enabled: true, progressive: true, direction: 'forward', startLength: 3, maxLength: 8, showMs: 1000 },
},
'stroop': {
- label: 'Stroop',
- desc: 'Name the ink color of a color-word — attention & inhibition',
progressive: true,
ladderFields: ['count', 'incongruentPct'],
fields: [
@@ -230,8 +212,6 @@ const COGNITIVE_DRILL_META = {
defaults: { enabled: true, progressive: true, count: 15, incongruentPct: 75 },
},
'schulte-table': {
- label: 'Schulte Table',
- desc: 'Scan a shuffled grid and tap 1, 2, 3... in order — visual attention & speed',
progressive: true,
ladderFields: ['size'],
fields: [
@@ -240,8 +220,6 @@ const COGNITIVE_DRILL_META = {
defaults: { enabled: true, progressive: true, size: 5 },
},
'mental-rotation': {
- label: 'Mental Rotation',
- desc: 'Pick the shape that’s the same, just rotated — spatial reasoning',
progressive: true,
ladderFields: ['count', 'rotationComplexity', 'optionCount'],
fields: [
@@ -256,8 +234,6 @@ const COGNITIVE_DRILL_META = {
defaults: { enabled: true, progressive: true, count: 8, rotationComplexity: 3, optionCount: 4 },
},
'reaction-time': {
- label: 'Reaction Time',
- desc: 'React the instant a stimulus appears — processing speed baseline',
fields: [
{ key: 'mode', label: 'Mode', type: 'select', options: [
{ value: 'simple', label: 'Simple' },
@@ -274,8 +250,6 @@ const COGNITIVE_DRILL_META = {
defaults: { enabled: true, mode: 'simple', count: 15, minDelayMs: 1000, maxDelayMs: 3000, choices: 3 },
},
'task-switching': {
- label: 'Task Switching',
- desc: 'Apply the currently cued rule — focused practice for switching between explicit classifications',
progressive: true,
ladderFields: ['ruleCount', 'switchRatePct', 'cueStimulusIntervalMs', 'incongruentPct', 'responseDeadlineMs'],
fields: [
@@ -289,8 +263,6 @@ const COGNITIVE_DRILL_META = {
defaults: { enabled: false, progressive: true, count: 18, ruleCount: 2, switchRatePct: 50, cueStimulusIntervalMs: 700, incongruentPct: 50, responseDeadlineMs: 2200 },
},
'go-no-go': {
- label: 'Go / No-Go',
- desc: 'Respond to go signals and withhold to lures — focused response-inhibition practice',
progressive: true,
ladderFields: ['noGoPct', 'stimulusMs', 'lureSimilarity', 'responseDeadlineMs'],
fields: [
@@ -306,8 +278,6 @@ const COGNITIVE_DRILL_META = {
defaults: { enabled: false, progressive: true, count: 20, noGoPct: 25, stimulusMs: 600, lureSimilarity: 'low', responseDeadlineMs: 1400 },
},
'flanker': {
- label: 'Flanker Control',
- desc: 'Report the center arrow while ignoring surrounding arrows — narrow interference-control practice',
progressive: true,
ladderFields: ['congruentPct', 'flankerDistance', 'flankerStrength', 'responseDeadlineMs'],
fields: [
@@ -493,7 +463,10 @@ function GroupBulkToggle({ groupLabel, onEnableAll, onDisableAll }) {
);
}
-function DrillCard({ meta, drillConfig, enabled, accent, onToggle, onUpdateField, adaptiveInfo, progressive, onToggleProgressive, progressInfo, managedFieldKeys = [], speedGated = false, managedLabel = 'Manual knobs' }) {
+function DrillCard({ type, meta, drillConfig, enabled, accent, onToggle, onUpdateField, adaptiveInfo, progressive, onToggleProgressive, progressInfo, managedFieldKeys = [], speedGated = false, managedLabel = 'Manual knobs' }) {
+ // Label and description both come from the shared registries in constants.js —
+ // the per-module META objects carry only the knobs, so a drill rename is one edit.
+ const label = DRILL_LABELS[type];
const supportsProgressive = typeof progressive === 'boolean';
// Fields the ladder drives (hidden while progressive is on; shown in manual
// mode). Multiplication hides only Max Digits; a cognitive drill hides every
@@ -508,14 +481,14 @@ function DrillCard({ meta, drillConfig, enabled, accent, onToggle, onUpdateField
}`}>
<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>
+ <h3 className="text-white font-medium">{label}</h3>
+ <p className="text-gray-500 text-xs">{DRILL_DESCRIPTIONS[type]}</p>
</div>
<button
type="button"
role="switch"
aria-checked={enabled}
- aria-label={meta.label}
+ aria-label={label}
onClick={onToggle}
className={`shrink-0 w-10 h-5 rounded-full transition-colors relative ${
enabled ? toggleBg : 'bg-port-border'
@@ -537,7 +510,7 @@ function DrillCard({ meta, drillConfig, enabled, accent, onToggle, onUpdateField
type="button"
role="switch"
aria-checked={progressive}
- aria-label={`Progressive difficulty — ${meta.label}`}
+ aria-label={`Progressive difficulty — ${label}`}
onClick={onToggleProgressive}
className={`shrink-0 w-10 h-5 rounded-full transition-colors relative ${
progressive ? toggleBg : 'bg-port-border'
@@ -1055,6 +1028,7 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {
return (
<DrillCard
key={type}
+ type={type}
meta={meta}
drillConfig={drillConfig}
enabled={drillConfig.enabled !== false}
@@ -1115,6 +1089,7 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {
return (
<DrillCard
key={type}
+ type={type}
meta={meta}
drillConfig={drillConfig}
enabled={drillConfig.enabled !== false}
@@ -1206,6 +1181,7 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {
return (
<DrillCard
key={type}
+ type={type}
meta={meta}
drillConfig={drillConfig}
enabled={drillConfig.enabled !== false}
diff --git a/client/src/components/meatspace/post/PostProgress.jsx b/client/src/components/meatspace/post/PostProgress.jsx
index 9d41de1ed4..e909cd2b75 100644
--- a/client/src/components/meatspace/post/PostProgress.jsx
+++ b/client/src/components/meatspace/post/PostProgress.jsx
@@ -62,6 +62,13 @@ function buildDomainSeries(byDrill) {
return out;
}
+// Routed progress sub-pages (`/post/progress/:subtab`). Exported so the
+// nav-manifest contract test (server/lib/navManifest.test.js) can assert each one
+// is reachable from ⌘K and voice, mirroring MEMORY_SUBROUTES in PostTab.jsx.
+export const PROGRESS_SUBROUTES = [
+ { id: 'sessions', label: 'Sessions' },
+];
+
export default function PostProgress({ subtab, onBack }) {
const navigate = useNavigate();
const chartColors = useChartColors();
@@ -465,8 +472,9 @@ const RETENTION_STATE_LABEL = {
function ProgressTabs({ subtab, navigate }) {
const tabs = [
+ // Trends is the bare `/post/progress`, so it has no sub-route id.
{ id: undefined, label: 'Trends', to: '/post/progress' },
- { id: 'sessions', label: 'Sessions', to: '/post/progress/sessions' },
+ ...PROGRESS_SUBROUTES.map(t => ({ ...t, to: `/post/progress/${t.id}` })),
];
return (
<div className="flex gap-1 border-b border-port-border">
diff --git a/client/src/components/meatspace/post/PostSessionLauncher.jsx b/client/src/components/meatspace/post/PostSessionLauncher.jsx
index b63480575e..3c87762b17 100644
--- a/client/src/components/meatspace/post/PostSessionLauncher.jsx
+++ b/client/src/components/meatspace/post/PostSessionLauncher.jsx
@@ -1,12 +1,15 @@
import { useState, useEffect, useRef } from 'react';
import { Link } from 'react-router';
-import { Zap, History, Settings, Play, Brain, BookOpen, Dumbbell, Timer, Radio, Target, TrendingUp, TrendingDown, Minus, Compass, ArrowRight, ChevronRight, Layers } from 'lucide-react';
+import { Zap, Play, Brain, Dumbbell, Timer, Target, TrendingUp, TrendingDown, Minus, Compass, ArrowRight, ChevronRight, Layers } from 'lucide-react';
import { getPostReviewReps, getPostRecommendations, getMorseProgress, getPostProgress, getPostBenchmarkProtocol, getMemoryItems, updatePostConfig } from '../../../services/api';
import { FormField } from '../../ui/FormField';
import Pill from '../../ui/Pill';
import { enabledApiProviderFilter } from '../../../utils/providers';
import useProviderModels from '../../../hooks/useProviderModels.js';
import { DOMAINS, DRILL_TO_DOMAIN, DRILL_LABELS, computeDomainAverages, computeGoalProgress, isTopicEnabled, selectMemoryItemForDrill, resolveTopicForDrillType } from './constants';
+import { otherPostSections, TOPIC_SURFACE_SECTIONS } from './practiceCatalog';
+import { postIcon } from './postIcons';
+import BrowseCatalogLink from './BrowseCatalogLink';
import { streakGlyph } from '../../../lib/streakGlyph.js';
import useUserTimezone from '../../../hooks/useUserTimezone.js';
import { todayKeyInTimezone } from '../../../utils/timezone.js';
@@ -18,6 +21,19 @@ import {
composeQuickSession,
} from '../../../lib/postQuickSession.js';
+// The launcher header's links to the rest of POST. These used to be four
+// `onView*` callback props, so the launcher could only offer whatever PostTab
+// happened to wire up — Practice Plan, Progress, and the Practice Library had no
+// link here at all. Now they're DERIVED: the section rows come from the shared
+// `POST_SECTIONS` (minus the launcher itself) and the per-topic shortcuts from
+// the catalog's topic groups, so a new POST page or topic tab gets a header link
+// without editing this file. Explore leads, styled as the primary action.
+const LAUNCHER_LINKS = [
+ ...otherPostSections('launcher').filter(s => s.id === 'explore').map(s => ({ ...s, primary: true })),
+ ...TOPIC_SURFACE_SECTIONS,
+ ...otherPostSections('launcher').filter(s => s.id !== 'explore'),
+];
+
// Canonical domain visiting order for interleaved "Full POST" composition
// (issue #2100): alternate domains — math → cognitive → memory → verbal — so a
// session is spaced/varied rather than blocked (all math, then all cognitive).
@@ -119,10 +135,6 @@ export default function PostSessionLauncher({
stats,
statsWeek,
onStart,
- onViewHistory,
- onViewConfig,
- onViewMemory,
- onViewMorse,
autoStartRecommendationId,
onAutoStartConsumed,
onNavigate,
@@ -706,36 +718,25 @@ export default function PostSessionLauncher({
<Zap size={24} className="text-port-accent" />
<h2 className="text-xl font-bold text-white">Power On Self Test</h2>
</div>
- <div className="flex flex-wrap gap-2">
- <button
- onClick={onViewMemory}
- className="flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-400 hover:text-white bg-port-card border border-port-border rounded-lg transition-colors"
- >
- <BookOpen size={14} />
- Memory
- </button>
- <button
- onClick={onViewMorse}
- className="flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-400 hover:text-white bg-port-card border border-port-border rounded-lg transition-colors"
- >
- <Radio size={14} />
- Morse
- </button>
- <button
- onClick={onViewHistory}
- className="flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-400 hover:text-white bg-port-card border border-port-border rounded-lg transition-colors"
- >
- <History size={14} />
- History
- </button>
- <button
- onClick={onViewConfig}
- className="flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-400 hover:text-white bg-port-card border border-port-border rounded-lg transition-colors"
- >
- <Settings size={14} />
- Config
- </button>
- </div>
+ <nav aria-label="POST sections" className="flex flex-wrap gap-2">
+ {LAUNCHER_LINKS.map(({ to, label, icon, primary }) => {
+ const Icon = postIcon(icon);
+ return (
+ <Link
+ key={to}
+ to={to}
+ className={`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border transition-colors ${
+ primary
+ ? 'text-port-accent bg-port-accent/10 border-port-accent/40 hover:bg-port-accent/20'
+ : 'text-gray-400 hover:text-white bg-port-card border-port-border'
+ }`}
+ >
+ <Icon size={14} />
+ {label}
+ </Link>
+ );
+ })}
+ </nav>
</div>
{/* Main + sidebar: primary session flow on the left, drill summaries + history on the right */}
@@ -1171,12 +1172,22 @@ export default function PostSessionLauncher({
</div>
)}
+ {/* These cards list only the drills you have switched ON, so with
+ nothing enabled the sidebar would be blank and POST would look
+ empty. Point at the catalog and the plan, not just "configure". */}
{!hasAnyDrills && (
- <div className="bg-port-card border border-port-border rounded-lg p-4">
- <p className="text-gray-500 text-sm">No drills enabled. Configure drills to get started.</p>
+ <div className="bg-port-card border border-port-border rounded-lg p-4 space-y-2">
+ <p className="text-gray-500 text-sm">No drills enabled yet.</p>
+ <BrowseCatalogLink />
+ <p className="text-xs text-gray-500">
+ Then switch on what you want in{' '}
+ <Link to="/post/plan" className="text-port-accent hover:underline">Practice Plan</Link>.
+ </p>
</div>
)}
+ {hasAnyDrills && <BrowseCatalogLink />}
+
{/* Recent Scores */}
{lastThree.length > 0 && (
<div className="bg-port-card border border-port-border rounded-lg p-4">
diff --git a/client/src/components/meatspace/post/PostSessionLauncher.test.jsx b/client/src/components/meatspace/post/PostSessionLauncher.test.jsx
index c6a492ff55..4cfa8f97a0 100644
--- a/client/src/components/meatspace/post/PostSessionLauncher.test.jsx
+++ b/client/src/components/meatspace/post/PostSessionLauncher.test.jsx
@@ -1,5 +1,5 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
-import { render, screen, waitFor, fireEvent } from '@testing-library/react';
+import { render, screen, waitFor, fireEvent, act } from '@testing-library/react';
import { MemoryRouter } from 'react-router';
// Mock the API surface the launcher touches on mount (providers + review reps +
@@ -36,6 +36,7 @@ vi.mock('../../../services/api', () => ({
}));
import PostSessionLauncher, { buildCleanConditions, cognitiveSummary, interleaveByDomain } from './PostSessionLauncher';
+import { otherPostSections, TOPIC_SURFACE_SECTIONS } from './practiceCatalog';
import { getPostRecommendations, getMorseProgress, getPostProgress, getPostReviewReps, getPostBenchmarkProtocol, getMemoryItems, updatePostConfig } from '../../../services/api';
// Pure-function tests for PostSessionLauncher's pre-submit helpers (issue
@@ -160,10 +161,6 @@ describe('PostSessionLauncher render (issue #2100)', () => {
stats={stats}
statsWeek={{ sessionCount: 2 }}
onStart={vi.fn()}
- onViewHistory={vi.fn()}
- onViewConfig={vi.fn()}
- onViewMemory={vi.fn()}
- onViewMorse={vi.fn()}
{...props}
/>
</MemoryRouter>,
@@ -451,10 +448,6 @@ describe('PostSessionLauncher — Start card (issue #3249)', () => {
stats={stats}
statsWeek={{ sessionCount: 2 }}
onStart={vi.fn()}
- onViewHistory={vi.fn()}
- onViewConfig={vi.fn()}
- onViewMemory={vi.fn()}
- onViewMorse={vi.fn()}
{...props}
/>
</MemoryRouter>,
@@ -572,10 +565,6 @@ describe('PostSessionLauncher topic gating (issue #3252)', () => {
stats={{ sessionCount: 1, overall: 70, currentStreak: 1, longestStreak: 1, byDrill: {} }}
statsWeek={{ sessionCount: 1 }}
onStart={onStart}
- onViewHistory={vi.fn()}
- onViewConfig={vi.fn()}
- onViewMemory={vi.fn()}
- onViewMorse={vi.fn()}
/>
</MemoryRouter>,
);
@@ -651,10 +640,6 @@ describe('PostSessionLauncher review-rep topic gating (issue #3252)', () => {
stats={{ sessionCount: 1, overall: 70, currentStreak: 1, longestStreak: 1, byDrill: {} }}
statsWeek={{ sessionCount: 1 }}
onStart={onStart}
- onViewHistory={vi.fn()}
- onViewConfig={vi.fn()}
- onViewMemory={vi.fn()}
- onViewMorse={vi.fn()}
/>
</MemoryRouter>,
);
@@ -717,10 +702,6 @@ describe('PostSessionLauncher honors the mentalMath module flag (issue #3252)',
stats={{ sessionCount: 1, overall: 70, currentStreak: 1, longestStreak: 1, byDrill: {} }}
statsWeek={{ sessionCount: 1 }}
onStart={onStart}
- onViewHistory={vi.fn()}
- onViewConfig={vi.fn()}
- onViewMemory={vi.fn()}
- onViewMorse={vi.fn()}
/>
</MemoryRouter>,
);
@@ -756,10 +737,6 @@ describe('PostSessionLauncher composed memory drills (issue #3254)', () => {
stats={{ sessionCount: 1, overall: 70, currentStreak: 1, longestStreak: 1, byDrill: {} }}
statsWeek={{ sessionCount: 1 }}
onStart={onStart}
- onViewHistory={vi.fn()}
- onViewConfig={vi.fn()}
- onViewMemory={vi.fn()}
- onViewMorse={vi.fn()}
/>
</MemoryRouter>,
);
@@ -902,3 +879,58 @@ describe('PostSessionLauncher composed memory drills (issue #3254)', () => {
]));
});
});
+
+describe('PostSessionLauncher — POST section discoverability', () => {
+ const config = {
+ mentalMath: { enabled: true, drillTypes: { multiplication: { enabled: true } } },
+ llmDrills: { enabled: false, drillTypes: {} },
+ cognitive: { enabled: false, drillTypes: {} },
+ };
+
+ const hrefs = (root) => [...root.querySelectorAll('a')].map(a => a.getAttribute('href'));
+
+ const renderIt = (props = {}) => render(
+ <MemoryRouter>
+ <PostSessionLauncher
+ config={config}
+ recentSessions={[]}
+ stats={null}
+ statsWeek={null}
+ onStart={vi.fn()}
+ {...props}
+ />
+ </MemoryRouter>,
+ );
+
+ it('links to every other POST section and every topic tab from the header', async () => {
+ renderIt();
+ // The launcher fetches providers/recs/progress on mount; settle them so the
+ // resulting state updates land inside act().
+ await act(async () => {});
+ const links = hrefs(screen.getByLabelText('POST sections'));
+ // Derived from the shared registries, not re-listed here: a POST page or a
+ // topic tab added to the catalog must show up in the header, and the
+ // launcher must not link at itself.
+ const expected = [
+ ...otherPostSections('launcher').map(s => s.to),
+ ...TOPIC_SURFACE_SECTIONS.map(s => s.to),
+ ];
+ expect(links.filter(to => !expected.includes(to))).toEqual([]);
+ expect(expected.filter(to => !links.includes(to))).toEqual([]);
+ expect(links).not.toContain('/post/launcher');
+ // Explore is the primary action, so it leads.
+ expect(links[0]).toBe('/post/explore');
+ });
+
+ it('offers the catalog alongside the enabled-drill summaries', async () => {
+ const { container } = renderIt();
+ await waitFor(() => expect(hrefs(container)).toContain('/post/explore'));
+ expect(screen.getByText('Browse every test type')).toBeInTheDocument();
+ });
+
+ it('points an install with nothing enabled at the catalog, not just Config', async () => {
+ const { container } = renderIt({ config: { mentalMath: { drillTypes: {} }, llmDrills: { drillTypes: {} }, cognitive: { drillTypes: {} } } });
+ await waitFor(() => expect(screen.getByText('No drills enabled yet.')).toBeInTheDocument());
+ expect(hrefs(container)).toEqual(expect.arrayContaining(['/post/explore', '/post/plan']));
+ });
+});
diff --git a/client/src/components/meatspace/post/PracticeLibrary.jsx b/client/src/components/meatspace/post/PracticeLibrary.jsx
new file mode 100644
index 0000000000..b0d617cf9f
--- /dev/null
+++ b/client/src/components/meatspace/post/PracticeLibrary.jsx
@@ -0,0 +1,147 @@
+import { memo, useMemo, useState } from 'react';
+import { Link } from 'react-router';
+import { ArrowLeft, ArrowRight, Compass, Search } from 'lucide-react';
+import Pill from '../../ui/Pill';
+import { filterPracticeGroups, otherPostSections, PRACTICE_ENTRIES, TAG_LABELS } from './practiceCatalog';
+import { postIcon } from './postIcons';
+import { composedSessionDrillTypes } from './constants';
+
+// The rest of POST, minus this page — rendered as a quick-links row so the
+// Practice Library doubles as the section's table of contents.
+const SECTIONS = otherPostSections('explore');
+
+const TAG_TONE = { session: 'muted', standalone: 'accent', ai: 'warning', reference: 'note' };
+
+// Memoized: entry identity is stable across filter calls (the catalog builds each
+// entry once at module load), so a keystroke re-renders only the cards whose
+// membership actually changed rather than all ~55.
+const EntryCard = memo(function EntryCard({ entry, inPlan }) {
+ const body = (
+ <>
+ <div className="flex items-start justify-between gap-2">
+ <span className="text-sm font-medium text-white">{entry.label}</span>
+ {entry.to && <ArrowRight size={14} className="mt-0.5 shrink-0 text-gray-600 group-hover:text-port-accent" />}
+ </div>
+ {entry.description && <p className="mt-1 text-xs text-gray-400">{entry.description}</p>}
+ <div className="mt-2 flex flex-wrap gap-1.5">
+ {entry.tags.map(tag => (
+ <Pill key={tag} tone={TAG_TONE[tag] || 'context'} size="xs">{TAG_LABELS[tag] || tag}</Pill>
+ ))}
+ {inPlan && <Pill tone="success" size="xs">In your plan</Pill>}
+ </div>
+ </>
+ );
+ const shell = 'block text-left bg-port-bg border border-port-border rounded-lg p-3 min-w-0';
+ // Session-only drills have no standalone surface to open — they run inside a
+ // composed session — so they render as a plain card, not a dead link.
+ if (!entry.to) return <div className={shell}>{body}</div>;
+ return (
+ <Link to={entry.to} className={`${shell} group hover:border-port-accent/60 transition-colors`}>
+ {body}
+ </Link>
+ );
+});
+
+/**
+ * `/post/explore` — one browsable page listing every POST test type and every
+ * piece of practice material, grouped by topic, with a direct link wherever a
+ * standalone surface exists (issue: POST navigation audit).
+ */
+export default function PracticeLibrary({ config, onBack }) {
+ const [query, setQuery] = useState('');
+ const groups = useMemo(() => filterPracticeGroups(query), [query]);
+ // Which session drills the user's saved plan would actually run today, so the
+ // catalog can distinguish "exists" from "you have it switched on". Keyed on
+ // config, not on the query, so typing doesn't re-walk the topic registry.
+ const planned = useMemo(
+ () => new Set(Object.values(composedSessionDrillTypes(config)).flat()),
+ [config],
+ );
+
+ return (
+ <div className="space-y-6 max-w-6xl mx-auto">
+ <div className="flex flex-wrap items-start justify-between gap-3">
+ <div className="flex items-start gap-3">
+ <button aria-label="Back" onClick={onBack} className="mt-1 text-gray-400 hover:text-white transition-colors">
+ <ArrowLeft size={20} />
+ </button>
+ <div>
+ <div className="flex items-center gap-2">
+ <Compass size={22} className="text-port-accent" />
+ <h2 className="text-xl font-bold text-white">Practice Library</h2>
+ </div>
+ <p className="mt-1 text-sm text-gray-500">
+ Every test and study surface POST offers — {PRACTICE_ENTRIES.length} in total. Switch what runs in your daily
+ session under <Link to="/post/plan" className="text-port-accent hover:underline">Practice Plan</Link>.
+ </p>
+ </div>
+ </div>
+ <div className="relative w-full sm:w-72">
+ <Search size={14} className="absolute left-3 top-1/2 -translate-y-1/2 text-gray-500" />
+ <label htmlFor="practice-library-search" className="sr-only">Search practice</label>
+ <input
+ id="practice-library-search"
+ type="search"
+ value={query}
+ onChange={(e) => setQuery(e.target.value)}
+ placeholder="Search tests and practice…"
+ className="w-full bg-port-card border border-port-border rounded-lg pl-8 pr-3 py-2 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-port-accent"
+ />
+ </div>
+ </div>
+
+ {/* Section table of contents — the rest of POST, one click away. */}
+ <nav aria-label="POST sections" className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-2">
+ {SECTIONS.map(({ to, label, icon, hint }) => {
+ const Icon = postIcon(icon);
+ return (
+ <Link
+ key={to}
+ to={to}
+ className="flex items-center gap-2 px-3 py-2 bg-port-card border border-port-border rounded-lg hover:border-port-accent/60 transition-colors min-w-0"
+ >
+ <Icon size={16} className="shrink-0 text-port-accent" />
+ <span className="min-w-0">
+ <span className="block text-sm text-white truncate">{label}</span>
+ <span className="block text-xs text-gray-500 truncate">{hint}</span>
+ </span>
+ </Link>
+ );
+ })}
+ </nav>
+
+ {groups.length === 0 && (
+ <p className="text-sm text-gray-500">Nothing matches “{query}”.</p>
+ )}
+
+ {groups.map(group => {
+ const Icon = postIcon(group.icon);
+ return (
+ <section key={group.id} className="bg-port-card border border-port-border rounded-lg p-4">
+ <div className="flex flex-wrap items-center justify-between gap-2 mb-3">
+ <div className="flex items-center gap-2 min-w-0">
+ <span className={`rounded-lg p-1.5 ${group.bgColor || 'bg-port-bg'}`}>
+ <Icon size={16} className={group.color || 'text-port-accent'} />
+ </span>
+ <div className="min-w-0">
+ <h3 className="text-sm font-semibold text-white">{group.label}</h3>
+ <p className="text-xs text-gray-500">{group.description}</p>
+ </div>
+ </div>
+ {group.to && (
+ <Link to={group.to} className="flex items-center gap-1 text-xs text-port-accent hover:underline shrink-0">
+ Open {group.label} <ArrowRight size={12} />
+ </Link>
+ )}
+ </div>
+ <div className="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-3">
+ {group.entries.map(entry => (
+ <EntryCard key={entry.id} entry={entry} inPlan={!!entry.drillType && planned.has(entry.drillType)} />
+ ))}
+ </div>
+ </section>
+ );
+ })}
+ </div>
+ );
+}
diff --git a/client/src/components/meatspace/post/PracticeLibrary.test.jsx b/client/src/components/meatspace/post/PracticeLibrary.test.jsx
new file mode 100644
index 0000000000..311c090ede
--- /dev/null
+++ b/client/src/components/meatspace/post/PracticeLibrary.test.jsx
@@ -0,0 +1,81 @@
+import { describe, it, expect } from 'vitest';
+import { render, screen, fireEvent, within } from '@testing-library/react';
+import { MemoryRouter } from 'react-router';
+import PracticeLibrary from './PracticeLibrary';
+import { otherPostSections, PRACTICE_ENTRIES } from './practiceCatalog';
+
+// A config with math switched on and everything else off, so the "In your plan"
+// badge has something to be right AND something to be wrong about.
+const config = {
+ mentalMath: { enabled: true, drillTypes: { multiplication: { enabled: true }, powers: { enabled: false } } },
+ llmDrills: { enabled: false, drillTypes: {} },
+ cognitive: { enabled: false, drillTypes: {} },
+ memory: { enabled: false, drillTypes: {} },
+};
+
+const renderLibrary = (props = {}) => render(
+ <MemoryRouter>
+ <PracticeLibrary config={config} onBack={() => {}} {...props} />
+ </MemoryRouter>,
+);
+
+// `getByRole('link')` walks every anchor on a ~60-link page and times out under
+// jsdom, so links are asserted by href instead — which is what actually matters.
+const hrefs = (container) => [...container.querySelectorAll('a')].map(a => a.getAttribute('href'));
+
+describe('PracticeLibrary', () => {
+ it('renders every catalogued practice entry', () => {
+ const { container } = renderLibrary();
+ // Session-only drills render as plain cards; standalone ones render as
+ // links. Both must be on the page.
+ expect(screen.getByText('Multiplication')).toBeInTheDocument();
+ expect(screen.getByText('Schulte Table')).toBeInTheDocument();
+ expect(screen.getByText('Iambic Pentameter')).toBeInTheDocument();
+
+ const linked = new Set(hrefs(container));
+ const missing = PRACTICE_ENTRIES.map(e => e.to).filter(to => to && !linked.has(to));
+ expect([...new Set(missing)]).toEqual([]);
+ });
+
+ it('states how many practice surfaces exist', () => {
+ renderLibrary();
+ expect(screen.getByText(new RegExp(`${PRACTICE_ENTRIES.length} in total`))).toBeInTheDocument();
+ });
+
+ it('links to the rest of the POST section, and never at itself', () => {
+ renderLibrary();
+ // Derived: a POST page added to the shared registry must appear here.
+ expect(hrefs(screen.getByLabelText('POST sections')))
+ .toEqual(otherPostSections('explore').map(s => s.to));
+ expect(hrefs(screen.getByLabelText('POST sections'))).not.toContain('/post/explore');
+ });
+
+ it('filters to matching entries as the user searches', () => {
+ renderLibrary();
+ fireEvent.change(screen.getByLabelText('Search practice'), { target: { value: 'iambic' } });
+ expect(screen.getByText('Iambic Pentameter')).toBeInTheDocument();
+ expect(screen.queryByText('Multiplication')).not.toBeInTheDocument();
+ expect(screen.queryByText('Schulte Table')).not.toBeInTheDocument();
+ });
+
+ it('says so when nothing matches', () => {
+ renderLibrary();
+ fireEvent.change(screen.getByLabelText('Search practice'), { target: { value: 'zzzznotathing' } });
+ expect(screen.getByText(/Nothing matches/)).toBeInTheDocument();
+ });
+
+ it('badges only the drills the saved plan would actually run', () => {
+ renderLibrary();
+ const mathSection = screen.getByText('Mental Math').closest('section');
+ const card = (label) => within(mathSection).getByText(label).closest('.rounded-lg');
+ expect(within(card('Multiplication')).getByText('In your plan')).toBeInTheDocument();
+ // `powers` is enabled: false in the config, so it must NOT be badged.
+ expect(within(card('Powers')).queryByText('In your plan')).toBeNull();
+ });
+
+ it('renders without a config (cold load) and badges nothing', () => {
+ renderLibrary({ config: null });
+ expect(screen.getByText('Multiplication')).toBeInTheDocument();
+ expect(screen.queryByText('In your plan')).toBeNull();
+ });
+});
diff --git a/client/src/components/meatspace/post/PracticePlan.jsx b/client/src/components/meatspace/post/PracticePlan.jsx
index e57aface1b..6582e4b260 100644
--- a/client/src/components/meatspace/post/PracticePlan.jsx
+++ b/client/src/components/meatspace/post/PracticePlan.jsx
@@ -1,5 +1,6 @@
import { useState, useEffect } from 'react';
import { ArrowLeft, Save, ChevronRight, ChevronDown, ListChecks, Loader } from 'lucide-react';
+import BrowseCatalogLink from './BrowseCatalogLink';
import { updatePostConfig, getMemoryItems } from '../../../services/api';
import toast from '../../ui/Toast';
import {
@@ -311,6 +312,11 @@ export default function PracticePlan({ config, onSaved, onBack }) {
)}
</div>
+ {/* Rhetoric and the standalone study surfaces aren't topics, so they never
+ appear in the toggle list above — without this the plan reads as the
+ complete inventory of what POST offers, and it isn't. */}
+ <BrowseCatalogLink hint="Looking for something else?" />
+
{MODULE_GROUPS.map(group => {
const groupTopics = POST_TOPICS.filter(t => t.module === group.module);
if (!groupTopics.length) return null;
diff --git a/client/src/components/meatspace/post/PracticePlan.test.jsx b/client/src/components/meatspace/post/PracticePlan.test.jsx
index 21287d83c9..0d2678a6d5 100644
--- a/client/src/components/meatspace/post/PracticePlan.test.jsx
+++ b/client/src/components/meatspace/post/PracticePlan.test.jsx
@@ -1,5 +1,6 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, waitFor, fireEvent, within, act } from '@testing-library/react';
+import { MemoryRouter } from 'react-router';
vi.mock('../../../services/api', () => ({
updatePostConfig: vi.fn(),
@@ -57,7 +58,12 @@ const MEMORY_ITEMS = [
// Settle the mount-time memory-items fetch inside act() so the strict act()
// guard in src/test/setup.js doesn't fail the test on a post-mount state update.
async function renderPlan(config = baseConfig(), props = {}) {
- const result = render(<PracticePlan config={config} onSaved={() => {}} onBack={() => {}} {...props} />);
+ // Wrapped: the plan links out to the Practice Library, and <Link> needs a router.
+ const result = render(
+ <MemoryRouter>
+ <PracticePlan config={config} onSaved={() => {}} onBack={() => {}} {...props} />
+ </MemoryRouter>,
+ );
await act(async () => {});
return result;
}
@@ -242,3 +248,11 @@ describe('PracticePlan two-flags-one-control seeding (issue #3252)', () => {
expect(patch.memory.enabled).toBe(false);
});
});
+
+describe('PracticePlan — pointing beyond the topic list', () => {
+ it('links to the Practice Library, which covers what topics do not', async () => {
+ await renderPlan();
+ const link = screen.getByText(/Browse every test type/).closest('a');
+ expect(link).toHaveAttribute('href', '/post/explore');
+ });
+});
diff --git a/client/src/components/meatspace/post/WordplayTrainer.jsx b/client/src/components/meatspace/post/WordplayTrainer.jsx
index bd8596c760..e788b37a5b 100644
--- a/client/src/components/meatspace/post/WordplayTrainer.jsx
+++ b/client/src/components/meatspace/post/WordplayTrainer.jsx
@@ -9,7 +9,7 @@ import ProviderModelSelector from '../../ProviderModelSelector';
import Modal from '../../ui/Modal';
import toast from '../../ui/Toast';
import { AILoadingIndicator, MissedExamplesDisplay, CompoundChainUI, BridgeWordUI, DoubleMeaningUI, IdiomTwistUI, ProgressBar, scoreWordplayResponse } from './WordplayDrillUI';
-import { countLlmCorrect, LLM_TRAINING_CORRECT_THRESHOLD } from './constants';
+import { countLlmCorrect, DRILL_DESCRIPTIONS, LLM_TRAINING_CORRECT_THRESHOLD } from './constants';
import PostCompletionActions from './PostCompletionActions';
import { startRetryableSave } from './completionSave';
@@ -23,14 +23,20 @@ const TRAINING_MODULE = 'llm-drills';
// standalone tab has no session-configured timeLimitSec of its own.
const SCORE_TIMEOUT_MS = 120000;
-const GAME_MODES = [
+// Exported so the nav-manifest contract test (server/lib/navManifest.test.js)
+// can assert one `/post/wordplay/:mode` nav command per game mode — the same
+// guard Morse MODES and Elements PRACTICE_MODES already carry.
+//
+// Mode ids ARE drill types here, so the blurb comes from DRILL_DESCRIPTIONS
+// rather than a second copy: Drill Config, the Practice Library, and this grid
+// previously described the same drill three different ways.
+export const GAME_MODES = [
{
id: 'compound-chain',
label: 'Compound Chain',
icon: Link,
color: 'text-purple-400',
bgColor: 'bg-purple-500/20',
- description: 'List compound words using a root word',
example: 'fire → firehouse, firewall, campfire...',
},
{
@@ -39,7 +45,6 @@ const GAME_MODES = [
icon: Puzzle,
color: 'text-cyan-400',
bgColor: 'bg-cyan-500/20',
- description: 'Find the word connecting multiple phrases',
example: 'news___, ___back, ___weight → paper',
},
{
@@ -48,7 +53,6 @@ const GAME_MODES = [
icon: BookOpen,
color: 'text-amber-400',
bgColor: 'bg-amber-500/20',
- description: 'Use both meanings of a word in one sentence',
example: 'bark: tree covering + dog sound',
},
{
@@ -57,7 +61,6 @@ const GAME_MODES = [
icon: Shuffle,
color: 'text-green-400',
bgColor: 'bg-green-500/20',
- description: 'Adapt idioms to new domains with wordplay',
example: '"Don\'t put all eggs in one basket" → programming',
},
];
@@ -441,7 +444,7 @@ export default function WordplayTrainer({ onBack, onContinue, config, onConfigUp
<span className="text-white font-medium group-hover:text-port-accent transition-colors">{mode.label}</span>
<ChevronRight size={16} className="text-gray-600 ml-auto group-hover:text-port-accent transition-colors" />
</div>
- <p className="text-sm text-gray-400 mb-1">{mode.description}</p>
+ <p className="text-sm text-gray-400 mb-1">{DRILL_DESCRIPTIONS[mode.id]}</p>
<p className="text-xs text-gray-600 font-mono">{mode.example}</p>
</button>
);
diff --git a/client/src/components/meatspace/post/constants.js b/client/src/components/meatspace/post/constants.js
index 3f0cda97bb..3b2c17e495 100644
--- a/client/src/components/meatspace/post/constants.js
+++ b/client/src/components/meatspace/post/constants.js
@@ -295,6 +295,74 @@ export const DRILL_LABELS = {
'task-switching': 'Task Switching',
'go-no-go': 'Go / No-Go',
'flanker': 'Flanker Control',
+ // Morse types are owned by the `morse` topic and never compose into a POST
+ // session, but they ARE drill types — the Practice Library and the Practice
+ // Plan both name them, so they need a label like every other type.
+ 'morse-copy': 'Morse Copy',
+ 'morse-head-copy': 'Morse Head Copy',
+ 'morse-send': 'Morse Send',
+};
+
+// One-line "what is this test?" copy for every drill type POST offers — the
+// single source shared by Drill Config's cards and the Practice Library
+// (`/post/explore`). Before this existed the prose lived only inside
+// PostDrillConfig's private meta registries, so a drill the user had never
+// enabled had no description anywhere they could browse.
+// `practiceCatalog.test.js` asserts one entry per DRILL_LABELS key (and no
+// orphan the other way), so a new drill type can't ship label-only.
+export const DRILL_DESCRIPTIONS = {
+ 'doubling-chain': 'Double a number repeatedly',
+ 'serial-subtraction': 'Subtract a number repeatedly',
+ 'multiplication': 'Multiply random numbers',
+ 'powers': 'Calculate base^exponent',
+ 'estimation': 'Approximate arithmetic results',
+ 'applied-numeracy': 'Everyday percentages, ratios, units, rates, and estimation',
+ 'word-association': 'Associate freely with given words — trains lateral thinking',
+ 'story-recall': 'Read a paragraph, then answer questions from memory',
+ 'verbal-fluency': 'Name as many items in a category as possible',
+ 'wit-comeback': 'Craft witty responses to scenarios — trains verbal agility',
+ 'pun-wordplay': 'Create puns and wordplay on given topics',
+ 'compound-chain': 'Chain compound words/phrases from a seed word',
+ 'bridge-word': 'Find a word that links two others',
+ 'double-meaning': 'Exploit words with two meanings',
+ 'idiom-twist': 'Twist familiar idioms into new phrases',
+ 'memory-fill-blank': 'Fill missing words in partially shown lines of a text you are memorizing',
+ 'memory-sequence': 'Given a line, type what comes next',
+ 'memory-element-flash': 'Name elements from symbols or vice versa',
+ 'memory-element-study': 'Study element name ↔ symbol pairings',
+ 'what-if': 'Explore creative hypothetical scenarios',
+ 'alternative-uses': 'List unconventional uses for everyday objects',
+ 'story-prompt': 'Spin a short story from a creative prompt',
+ 'invention-pitch': 'Pitch inventions that solve quirky problems',
+ 'reframe': 'Reframe a frustrating situation positively or humorously',
+ 'n-back': 'Signal when a letter matches the one N steps back — working memory',
+ 'digit-span': 'Recall a shown digit sequence forward or backward',
+ 'stroop': 'Name the ink color of a color-word — attention & inhibition',
+ 'schulte-table': 'Scan a shuffled grid and tap 1, 2, 3... in order — visual attention & speed',
+ 'mental-rotation': 'Pick the shape that’s the same, just rotated — spatial reasoning',
+ 'reaction-time': 'React the instant a stimulus appears — processing speed baseline',
+ 'task-switching': 'Apply the currently cued rule — focused practice for switching between explicit classifications',
+ 'go-no-go': 'Respond to go signals and withhold to lures — focused response-inhibition practice',
+ 'flanker': 'Report the center arrow while ignoring surrounding arrows — narrow interference-control practice',
+ 'morse-copy': 'Listen to Morse, type what you hear',
+ 'morse-head-copy': 'Audio-only — no on-screen code hints or cheat sheet',
+ 'morse-send': 'Hold spacebar (or tap) to key dits & dahs',
+};
+
+// Drill types that ALSO have a dedicated standalone trainer route, so the
+// Practice Library can offer "practice this one now" instead of only telling
+// the user which session it composes into. Keyed by drill type; the value is
+// the same deep link the recommendation engine hands back for that drill.
+export const DRILL_PRACTICE_LINKS = {
+ 'compound-chain': '/post/wordplay/compound-chain',
+ 'bridge-word': '/post/wordplay/bridge-word',
+ 'double-meaning': '/post/wordplay/double-meaning',
+ 'idiom-twist': '/post/wordplay/idiom-twist',
+ 'memory-element-flash': '/post/memory/elements/element-flash',
+ 'memory-element-study': '/post/memory/elements/element-study',
+ 'morse-copy': '/post/morse/copy',
+ 'morse-head-copy': '/post/morse/head-copy',
+ 'morse-send': '/post/morse/send',
};
function parseAppliedNumeracyInput(value, question) {
diff --git a/client/src/components/meatspace/post/postIcons.js b/client/src/components/meatspace/post/postIcons.js
new file mode 100644
index 0000000000..de3616b114
--- /dev/null
+++ b/client/src/components/meatspace/post/postIcons.js
@@ -0,0 +1,23 @@
+/**
+ * Name → lucide component for POST's data-driven surfaces.
+ *
+ * `TOPIC_UI` (constants.js) and `practiceCatalog.js` both carry icons as NAMES so
+ * the registries stay JSX-free and server-mirrorable; this is the one place that
+ * turns a name back into a component. Without it every renderer grows its own
+ * copy of the same map.
+ */
+
+import {
+ Atom, BookMarked, BookOpen, Brain, Calculator, Compass, Feather, History,
+ Library, ListChecks, MessageCircle, Mic, Play, Radio, Settings, Sparkles, TrendingUp,
+} from 'lucide-react';
+
+const ICONS = {
+ Atom, BookMarked, BookOpen, Brain, Calculator, Compass, Feather, History,
+ Library, ListChecks, MessageCircle, Mic, Play, Radio, Settings, Sparkles, TrendingUp,
+};
+
+/** The component for an icon name, falling back to Compass for an unmapped one. */
+export const postIcon = (name) => ICONS[name] || Compass;
+
+export const POST_ICON_NAMES = Object.keys(ICONS);
diff --git a/client/src/components/meatspace/post/practiceCatalog.js b/client/src/components/meatspace/post/practiceCatalog.js
new file mode 100644
index 0000000000..f5df894c52
--- /dev/null
+++ b/client/src/components/meatspace/post/practiceCatalog.js
@@ -0,0 +1,237 @@
+/**
+ * The enumerable answer to "what can I actually practice in POST?" — the data
+ * behind the Practice Library at `/post/explore`.
+ *
+ * Before this existed, a test type was only discoverable if it happened to be
+ * enabled (the launcher's sidebar lists ONLY enabled drills), if the user opened
+ * Drill Config, or if they already knew a URL: the Rhetoric trainer had no link
+ * anywhere in the app, and the standalone Wordplay/Morse/Elements modes were
+ * reachable only from inside their own tabs.
+ *
+ * EVERYTHING here is derived, never re-typed: topic groups come from
+ * `POST_TOPICS` (server-owned, mirrored into `constants.js`), and the surfaces
+ * that aren't POST drill types come from each trainer's own exported mode list.
+ * That is the point — a page whose job is "nothing is undiscoverable" must not
+ * be the one place that has to be remembered when a mode is added.
+ *
+ * Data only (no JSX, icons carried as NAMES the way `TOPIC_UI` does), so the
+ * coverage tests read like data assertions rather than render assertions.
+ */
+
+import {
+ POST_TOPICS,
+ TOPIC_UI,
+ DRILL_LABELS,
+ DRILL_DESCRIPTIONS,
+ DRILL_PRACTICE_LINKS,
+} from './constants';
+// The trainers own their own mode lists; the catalog derives from them rather
+// than keeping a second copy. These are plain data arrays — importing them pulls
+// in the trainer modules, which PostTab already loads on this route, so nothing
+// new lands in the bundle. Consequence for tests: a suite that `vi.mock`s one of
+// these trainers must also return its mode array, or this module fails to load
+// (see PostTab.continueRoutine.test.jsx).
+import { RHETORIC_MODES } from './RhetoricTrainer';
+import { MODES as MEMORY_PRACTICE_MODES } from './MemoryPractice';
+import { PRACTICE_MODES as ELEMENTS_PRACTICE_MODES } from './ElementsSong';
+import { REFERENCE_VIEWS as MORSE_REFERENCE_VIEWS } from './MorseTrainer';
+import { tokenizeQuery, matchHaystack } from '../../../lib/mediaSearch.js';
+
+// One line per Morse reference chart. The chart list itself comes from
+// MorseTrainer; only this "what am I looking at" copy is catalog-owned, because
+// the trainer's tab bar has room for a one-word label and nothing more.
+const MORSE_REFERENCE_DESCRIPTIONS = {
+ tree: 'The dichotomic dit/dah binary tree.',
+ length: 'Characters grouped by symbol count.',
+ list: 'The full character table.',
+};
+
+// Badges a catalog entry can carry. Kept as ids (not prose) so the page owns the
+// styling and this module stays JSX-free.
+export const TAG_LABELS = {
+ session: 'In POST sessions',
+ standalone: 'Practice on its own',
+ ai: 'Needs an AI provider',
+ reference: 'Reference',
+};
+
+// Where a topic's own tab lives, for topics that have one. A topic absent here
+// composes into sessions only, so its group header links at the launcher.
+const TOPIC_SURFACE_LINKS = {
+ memory: '/post/memory',
+ wordplay: '/post/wordplay',
+ morse: '/post/morse',
+};
+
+function topicEntry(topic, type) {
+ const to = DRILL_PRACTICE_LINKS[type] || null;
+ const tags = [];
+ if (topic.surface === 'session') tags.push('session');
+ if (to) tags.push('standalone');
+ if (topic.module === 'llm-drills') tags.push('ai');
+ return {
+ id: type,
+ drillType: type,
+ label: DRILL_LABELS[type],
+ description: DRILL_DESCRIPTIONS[type],
+ to,
+ tags,
+ };
+}
+
+const TOPIC_GROUPS = POST_TOPICS.map(topic => ({
+ id: topic.id,
+ label: topic.label,
+ topicId: topic.id,
+ description: topic.surface === 'session'
+ ? 'Composes into Full POST and Quick sessions.'
+ : 'Practiced from its own tab, outside a composed session.',
+ icon: TOPIC_UI[topic.id]?.icon,
+ color: TOPIC_UI[topic.id]?.color,
+ bgColor: TOPIC_UI[topic.id]?.bgColor,
+ to: TOPIC_SURFACE_LINKS[topic.id] || null,
+ entries: topic.drillTypes.map(type => topicEntry(topic, type)),
+}));
+
+// Practice material that is NOT a POST drill type, and therefore has no topic
+// registry to derive from. Each group maps the trainer's OWN exported mode list,
+// so a mode added to a trainer appears here without touching this file — the
+// rot this page exists to prevent (a trainer nobody can find) can't come back
+// one mode at a time.
+const EXTRA_GROUPS = [
+ {
+ id: 'rhetoric',
+ label: 'Rhetoric',
+ description: 'Five prompts per round, a craft checklist, and a self-scored attempt.',
+ icon: 'Feather',
+ color: 'text-orange-400',
+ bgColor: 'bg-orange-500/20',
+ to: '/post/rhetoric',
+ entries: RHETORIC_MODES.map(mode => ({
+ id: mode.id,
+ label: mode.label,
+ description: mode.description,
+ to: `/post/rhetoric/${mode.id}`,
+ tags: ['standalone'],
+ })),
+ },
+ {
+ id: 'memorization',
+ label: 'Memorization Studio',
+ description: 'Study modes for the texts you are committing to memory.',
+ icon: 'Library',
+ color: 'text-emerald-400',
+ bgColor: 'bg-emerald-500/20',
+ to: '/post/memory',
+ entries: [
+ { id: 'memory-builder', label: 'Memory Builder', description: 'Add and manage the texts you are memorizing, and see mastery per item.', to: '/post/memory', tags: ['standalone'] },
+ // The per-item practice modes live at /post/memory/:itemId/:mode, so they
+ // have no static link — the item list is the entry point, which the
+ // suffix says out loud.
+ ...MEMORY_PRACTICE_MODES.map(mode => ({
+ id: mode.id,
+ label: mode.label,
+ description: `${mode.desc}. Pick a text from Memory Builder.`,
+ to: '/post/memory',
+ tags: ['standalone'],
+ })),
+ ],
+ },
+ {
+ id: 'elements',
+ label: 'Elements Song',
+ description: 'The built-in periodic-table item, with its own study surface.',
+ icon: 'Atom',
+ color: 'text-lime-400',
+ bgColor: 'bg-lime-500/20',
+ to: '/post/memory/elements',
+ entries: ELEMENTS_PRACTICE_MODES.map(mode => ({
+ id: `elements-${mode.id}`,
+ label: mode.label,
+ description: mode.desc,
+ to: `/post/memory/elements/${mode.id}`,
+ // element-flash doubles as a scored session drill; the rest are study-only.
+ tags: mode.id === 'element-flash' ? ['standalone', 'session'] : ['standalone'],
+ })),
+ },
+ {
+ id: 'reference',
+ label: 'Reference Charts',
+ description: 'Look-up material — nothing is scored here.',
+ icon: 'BookMarked',
+ color: 'text-slate-300',
+ bgColor: 'bg-slate-500/20',
+ to: '/post/morse?ref=list',
+ entries: MORSE_REFERENCE_VIEWS.map(view => ({
+ id: `morse-${view.id}`,
+ label: `Morse ${view.label}`,
+ description: MORSE_REFERENCE_DESCRIPTIONS[view.id],
+ to: `/post/morse?ref=${view.id}`,
+ tags: ['reference'],
+ })),
+ },
+];
+
+export const PRACTICE_GROUPS = [...TOPIC_GROUPS, ...EXTRA_GROUPS].map(group => ({
+ ...group,
+ entries: group.entries.map(entry => ({
+ ...entry,
+ groupId: group.id,
+ groupLabel: group.label,
+ search: [entry.label, entry.description, entry.drillType, group.label]
+ .filter(Boolean).join(' ').toLowerCase(),
+ })),
+}));
+
+// POST's section-level surfaces — everything that ISN'T a test. One list, shared
+// by the launcher header and the Practice Library's table of contents, each
+// filtering out the page it is already on. Before this, the two kept separate
+// lists that shipped divergent on day one (different labels for /post/config,
+// different subsets). Icons are NAMES; `postIcons.js` resolves them.
+export const POST_SECTIONS = [
+ { id: 'explore', to: '/post/explore', label: 'Explore', hint: 'Every test type', icon: 'Compass' },
+ { id: 'launcher', to: '/post/launcher', label: 'Launcher', hint: 'Start a session', icon: 'Play' },
+ { id: 'plan', to: '/post/plan', label: 'Practice Plan', hint: 'Choose what you study', icon: 'ListChecks' },
+ { id: 'config', to: '/post/config', label: 'Drill Config', hint: 'Tune difficulty', icon: 'Settings' },
+ { id: 'progress', to: '/post/progress', label: 'Progress', hint: 'Trends and streaks', icon: 'TrendingUp' },
+ { id: 'history', to: '/post/history', label: 'History', hint: 'Past sessions', icon: 'History' },
+];
+
+/** `POST_SECTIONS` minus the page doing the rendering. */
+export const otherPostSections = (currentId) => POST_SECTIONS.filter(s => s.id !== currentId);
+
+/**
+ * Topic tabs that have a surface of their own (Memory, Wordplay, Morse) — the
+ * launcher's per-topic shortcuts, derived from the catalog so a topic that gains
+ * a tab gets a shortcut for free.
+ */
+export const TOPIC_SURFACE_SECTIONS = PRACTICE_GROUPS
+ .filter(group => group.topicId && group.to)
+ .map(group => ({ id: group.id, to: group.to, label: group.label, hint: group.description, icon: group.icon }));
+
+/**
+ * Every catalog entry, flat, with the group it came from and a precomputed
+ * lowercase haystack. Built ONCE at module load and shared by reference with
+ * `PRACTICE_GROUPS` — so filtering is a set of `includes()` calls with no
+ * per-keystroke allocation, and entry identity stays stable across filters.
+ */
+export const PRACTICE_ENTRIES = PRACTICE_GROUPS.flatMap(group => group.entries);
+
+/**
+ * True when every whitespace-separated token of `query` appears somewhere in the
+ * entry's label, description, drill type, or group label — AND semantics, any
+ * order, so "morse copy" and "copy morse" both match. An empty query matches
+ * everything. Pure.
+ */
+export function entryMatchesQuery(entry, query) {
+ return matchHaystack(entry?.search || '', tokenizeQuery(query));
+}
+
+/** `PRACTICE_GROUPS` with non-matching entries removed and empty groups dropped. */
+export function filterPracticeGroups(query) {
+ const tokens = tokenizeQuery(query);
+ if (tokens.length === 0) return PRACTICE_GROUPS;
+ return PRACTICE_GROUPS
+ .map(group => ({ ...group, entries: group.entries.filter(e => matchHaystack(e.search, tokens)) }))
+ .filter(group => group.entries.length > 0);
+}
diff --git a/client/src/components/meatspace/post/practiceCatalog.test.js b/client/src/components/meatspace/post/practiceCatalog.test.js
new file mode 100644
index 0000000000..c6e691f96a
--- /dev/null
+++ b/client/src/components/meatspace/post/practiceCatalog.test.js
@@ -0,0 +1,148 @@
+import { describe, it, expect } from 'vitest';
+import {
+ PRACTICE_GROUPS,
+ PRACTICE_ENTRIES,
+ TAG_LABELS,
+ entryMatchesQuery,
+ filterPracticeGroups,
+} from './practiceCatalog';
+import { POST_TOPICS, DRILL_LABELS, DRILL_DESCRIPTIONS, DRILL_PRACTICE_LINKS } from './constants';
+import { RHETORIC_MODES } from './RhetoricTrainer';
+import { MODES as MEMORY_PRACTICE_MODES } from './MemoryPractice';
+import { PRACTICE_MODES as ELEMENTS_PRACTICE_MODES } from './ElementsSong';
+import { MODES as MORSE_MODES, REFERENCE_VIEWS as MORSE_REFERENCE_VIEWS } from './MorseTrainer';
+
+describe('practice catalog coverage', () => {
+ // The whole point of the library is that NOTHING is undiscoverable. If a topic
+ // gains a drill type and the catalog is derived correctly, this passes for
+ // free; if someone hand-lists entries instead, it fails.
+ it('lists every drill type owned by every registered topic', () => {
+ const catalogued = new Set(PRACTICE_ENTRIES.map(e => e.drillType).filter(Boolean));
+ const missing = POST_TOPICS.flatMap(t => t.drillTypes).filter(type => !catalogued.has(type));
+ expect(missing).toEqual([]);
+ });
+
+ it('gives every drill-type entry a human label and a description', () => {
+ const bare = PRACTICE_ENTRIES
+ .filter(e => e.drillType)
+ .filter(e => !e.label || e.label === e.drillType || !e.description);
+ expect(bare.map(e => e.drillType)).toEqual([]);
+ });
+
+ // Rhetoric is the reason this page exists — it shipped with no link anywhere in
+ // the app. This asserts the whole surface, not just that one group: every mode
+ // every standalone trainer serves must be linked from the library, so the same
+ // bug can't come back one mode at a time.
+ it.each([
+ ['rhetoric', RHETORIC_MODES, (id) => `/post/rhetoric/${id}`],
+ ['elements', ELEMENTS_PRACTICE_MODES, (id) => `/post/memory/elements/${id}`],
+ ['morse', MORSE_MODES, (id) => `/post/morse/${id}`],
+ ['reference', MORSE_REFERENCE_VIEWS, (id) => `/post/morse?ref=${id}`],
+ ])('links every mode the %s trainer serves', (_name, modes, href) => {
+ const linked = new Set(PRACTICE_ENTRIES.map(e => e.to));
+ expect(modes.map(m => href(m.id)).filter(to => !linked.has(to))).toEqual([]);
+ });
+
+ it('lists every memorization study mode, which has no per-mode URL of its own', () => {
+ const memorization = PRACTICE_GROUPS.find(g => g.id === 'memorization');
+ const labels = memorization.entries.map(e => e.label);
+ expect(MEMORY_PRACTICE_MODES.map(m => m.label).filter(l => !labels.includes(l))).toEqual([]);
+ });
+
+ it('links every drill type that has a standalone trainer', () => {
+ for (const [type, to] of Object.entries(DRILL_PRACTICE_LINKS)) {
+ const entry = PRACTICE_ENTRIES.find(e => e.drillType === type);
+ // memory-element-study has no topic entry (it is not a session drill), so
+ // only assert the link when the type is catalogued as a drill.
+ if (entry) expect(entry.to, type).toBe(to);
+ }
+ });
+
+ it('tags a session drill as in-session and an AI drill as needing a provider', () => {
+ const multiplication = PRACTICE_ENTRIES.find(e => e.drillType === 'multiplication');
+ expect(multiplication.tags).toContain('session');
+ expect(multiplication.tags).not.toContain('ai');
+ expect(multiplication.to).toBeNull();
+
+ const bridge = PRACTICE_ENTRIES.find(e => e.drillType === 'bridge-word');
+ expect(bridge.tags).toEqual(expect.arrayContaining(['session', 'standalone', 'ai']));
+ });
+
+ it('uses only declared tags', () => {
+ const unknown = PRACTICE_ENTRIES.flatMap(e => e.tags).filter(tag => !TAG_LABELS[tag]);
+ expect([...new Set(unknown)]).toEqual([]);
+ });
+
+ it('has unique entry ids within each group', () => {
+ for (const group of PRACTICE_GROUPS) {
+ const ids = group.entries.map(e => e.id);
+ expect(new Set(ids).size, group.id).toBe(ids.length);
+ }
+ });
+});
+
+describe('entryMatchesQuery', () => {
+ // A real catalog entry, so the test exercises the haystack the catalog builds
+ // rather than a hand-shaped stand-in.
+ const entry = PRACTICE_ENTRIES.find(e => e.drillType === 'memory-element-flash');
+
+ it('matches everything on an empty or whitespace query', () => {
+ expect(entryMatchesQuery(entry, '')).toBe(true);
+ expect(entryMatchesQuery(entry, ' ')).toBe(true);
+ });
+
+ it('matches label, description, drill type, and group label case-insensitively', () => {
+ expect(entryMatchesQuery(entry, 'ELEMENT')).toBe(true);
+ expect(entryMatchesQuery(entry, 'symbols')).toBe(true);
+ expect(entryMatchesQuery(entry, 'memory-element')).toBe(true);
+ expect(entryMatchesQuery(entry, 'memory')).toBe(true);
+ });
+
+ it('ANDs the tokens, so word order does not matter', () => {
+ expect(entryMatchesQuery(entry, 'flash element')).toBe(true);
+ expect(entryMatchesQuery(entry, 'element flash')).toBe(true);
+ expect(entryMatchesQuery(entry, 'element morse')).toBe(false);
+ });
+
+ it('rejects a non-match', () => {
+ expect(entryMatchesQuery(entry, 'morse')).toBe(false);
+ });
+});
+
+describe('filterPracticeGroups', () => {
+ it('returns every group unchanged for an empty query', () => {
+ const all = filterPracticeGroups('');
+ expect(all).toHaveLength(PRACTICE_GROUPS.length);
+ expect(all.flatMap(g => g.entries)).toHaveLength(PRACTICE_ENTRIES.length);
+ });
+
+ it('drops groups with no surviving entries', () => {
+ const groups = filterPracticeGroups('iambic');
+ expect(groups.map(g => g.id)).toEqual(['rhetoric']);
+ expect(groups[0].entries.map(e => e.label)).toEqual(['Iambic Pentameter']);
+ });
+
+ it('matches a group by its own label so "morse" finds the trainers and the charts', () => {
+ const ids = filterPracticeGroups('morse').map(g => g.id);
+ expect(ids).toContain('morse');
+ expect(ids).toContain('reference');
+ });
+
+ it('returns nothing for a query that matches no practice', () => {
+ expect(filterPracticeGroups('zzzznotathing')).toEqual([]);
+ });
+});
+
+describe('drill description coverage', () => {
+ // A drill type that ships a label but no description renders a blank card in
+ // the library AND a blank subtitle in Drill Config, which both read the map.
+ it('describes every labelled drill type', () => {
+ const missing = Object.keys(DRILL_LABELS).filter(type => !DRILL_DESCRIPTIONS[type]);
+ expect(missing).toEqual([]);
+ });
+
+ it('does not describe a type that has no label', () => {
+ const orphans = Object.keys(DRILL_DESCRIPTIONS).filter(type => !DRILL_LABELS[type]);
+ expect(orphans).toEqual([]);
+ });
+});
diff --git a/client/src/components/meatspace/tabs/PostTab.continueRoutine.test.jsx b/client/src/components/meatspace/tabs/PostTab.continueRoutine.test.jsx
index 06f0295caa..acd226e577 100644
--- a/client/src/components/meatspace/tabs/PostTab.continueRoutine.test.jsx
+++ b/client/src/components/meatspace/tabs/PostTab.continueRoutine.test.jsx
@@ -57,20 +57,32 @@ function SurfaceStub({ label, onContinue }) {
);
}
+// Each trainer OWNS its mode list and the Practice Library derives from it, so a
+// mock that stubs a trainer must also supply that list — PostTab pulls in
+// PracticeLibrary → practiceCatalog, which reads these at module load.
vi.mock('../post/MorseTrainer', () => ({
default: ({ onContinue }) => <SurfaceStub label="Morse" onContinue={onContinue} />,
MORSE_MODE_IDS: ['copy', 'head-copy', 'send'],
+ MODES: [{ id: 'copy', label: 'Copy' }, { id: 'head-copy', label: 'Head Copy' }, { id: 'send', label: 'Send' }],
+ REFERENCE_VIEWS: [{ id: 'tree', label: 'Tree' }, { id: 'length', label: 'Length' }, { id: 'list', label: 'List' }],
}));
vi.mock('../post/WordplayTrainer', () => ({
default: ({ onContinue }) => <SurfaceStub label="Wordplay" onContinue={onContinue} />,
+ GAME_MODES: [{ id: 'compound-chain', label: 'Compound Chain' }],
}));
vi.mock('../post/MemoryPractice', () => ({
default: ({ onContinue }) => <SurfaceStub label="Memory" onContinue={onContinue} />,
MEMORY_PRACTICE_MODE_IDS: ['spaced', 'sequence'],
+ MODES: [{ id: 'spaced', label: 'Spaced Repetition', desc: 'Weakest chunks first' }],
}));
vi.mock('../post/ElementsSong', () => ({
default: ({ onContinue }) => <SurfaceStub label="Elements" onContinue={onContinue} />,
ELEMENTS_MODE_IDS: ['learn', 'element-study', 'element-flash', 'fill-blank'],
+ PRACTICE_MODES: [{ id: 'learn', label: 'Learn Lyrics', desc: 'Verse by verse' }],
+}));
+vi.mock('../post/RhetoricTrainer', () => ({
+ default: ({ onContinue }) => <SurfaceStub label="Rhetoric" onContinue={onContinue} />,
+ RHETORIC_MODES: [{ id: 'meter', label: 'Iambic Pentameter', description: 'Ten syllables' }],
}));
// PostTab's remaining imports are unreachable on the routes exercised here, but
// they still have to resolve — stub the ones that pull in heavy dependencies.
diff --git a/client/src/components/meatspace/tabs/PostTab.jsx b/client/src/components/meatspace/tabs/PostTab.jsx
index 34cc0a2a16..76785e983a 100644
--- a/client/src/components/meatspace/tabs/PostTab.jsx
+++ b/client/src/components/meatspace/tabs/PostTab.jsx
@@ -14,6 +14,7 @@ import PostHistory from '../post/PostHistory';
import PostProgress from '../post/PostProgress';
import PostDrillConfig from '../post/PostDrillConfig';
import PracticePlan from '../post/PracticePlan';
+import PracticeLibrary from '../post/PracticeLibrary';
import MemoryBuilder from '../post/MemoryBuilder';
import MemoryPractice, { MEMORY_PRACTICE_MODE_IDS } from '../post/MemoryPractice';
import ElementsSong, { ELEMENTS_MODE_IDS } from '../post/ElementsSong';
@@ -259,6 +260,11 @@ export default function PostTab({ tab = 'launcher', subtab, mode }) {
) : (
<div className="text-gray-500">Loading configuration...</div>
);
+ case 'explore':
+ // The browsable catalog of every test type and study surface. Renders
+ // without waiting on `config` — an unloaded config just means no "In your
+ // plan" badges, and the catalog itself is static.
+ return <PracticeLibrary config={config} onBack={() => navigate('/post/launcher')} />;
case 'plan':
// Practice Plan owns "what am I studying" (issue #3252). Same null guard
// as `config`: the editor seeds its draft state once from the loaded
@@ -379,10 +385,6 @@ export default function PostTab({ tab = 'launcher', subtab, mode }) {
stats={stats}
statsWeek={statsWeek}
onStart={handleStart}
- onViewHistory={() => navigate('/post/history')}
- onViewConfig={() => navigate('/post/config')}
- onViewMemory={() => navigate('/post/memory')}
- onViewMorse={() => navigate('/post/morse')}
autoStartRecommendationId={new URLSearchParams(location.search).get('continue')}
onAutoStartConsumed={() => navigate('/post/launcher', { replace: true })}
onNavigate={navigate}
diff --git a/server/lib/navManifest.js b/server/lib/navManifest.js
index 9855d2a07d..603b801ca5 100644
--- a/server/lib/navManifest.js
+++ b/server/lib/navManifest.js
@@ -232,6 +232,7 @@ export const NAV_COMMANDS = [
{ id: 'nav.post.launcher', path: '/post/launcher', label: 'Launcher', section: 'POST', aliases: ['post', 'post-launcher'] },
{ id: 'nav.post.config', path: '/post/config', label: 'Config', section: 'POST', aliases: ['post-config'] },
+ { id: 'nav.post.explore', path: '/post/explore', label: 'Explore', section: 'POST', aliases: ['post-explore', 'practice-library', 'practice library', 'explore-post', 'all-drills', 'all drills', 'browse-practice'], keywords: ['catalog', 'library', 'browse', 'directory', 'what can i practice', 'test types', 'every drill', 'find a drill'] },
{ id: 'nav.post.history', path: '/post/history', label: 'History', section: 'POST', aliases: ['post-history'] },
{ id: 'nav.post.memory', path: '/post/memory', label: 'Memory', section: 'POST', aliases: ['post-memory'] },
{ id: 'nav.post.memory.elements', path: '/post/memory/elements', label: 'Elements', section: 'POST', aliases: ['post-elements', 'elements', 'periodic-table', 'elements-song'], keywords: ['periodic table', 'chemistry', 'symbols', 'flash cards', 'tom lehrer', 'atomic number'] },
@@ -252,8 +253,18 @@ export const NAV_COMMANDS = [
{ id: 'nav.post.morse.length', path: '/post/morse?ref=length', label: 'Morse Length', section: 'POST', aliases: ['morse-length', 'morse length', 'morse-by-length'], keywords: ['cw', 'reference', 'symbol length', 'chart'] },
{ id: 'nav.post.morse.list', path: '/post/morse?ref=list', label: 'Morse List', section: 'POST', aliases: ['morse-list', 'morse list', 'morse-table', 'morse-alphabet'], keywords: ['cw', 'reference', 'alphabet', 'table', 'chart'] },
{ id: 'nav.post.progress', path: '/post/progress', label: 'Progress', section: 'POST', aliases: ['post-progress', 'progress'], keywords: ['trends', 'stats', 'streak', 'dashboard', 'time in training', 'accuracy', 'speed'] },
+ { id: 'nav.post.progress.sessions', path: '/post/progress/sessions', label: 'Progress Sessions', section: 'POST', aliases: ['post-progress-sessions', 'progress-sessions', 'progress sessions', 'session-log'], keywords: ['session list', 'log', 'past runs', 'per-session', 'scores'] },
{ id: 'nav.post.rhetoric', path: '/post/rhetoric', label: 'Rhetoric', section: 'POST', aliases: ['post-rhetoric', 'rhetoric', 'rhetorical practice'], keywords: ['writing', 'brainstorming', 'iambic pentameter', 'diacope', 'chiasmus', 'progressia', 'figures of speech'] },
+ { id: 'nav.post.rhetoric.meter', path: '/post/rhetoric/meter', label: 'Rhetoric Iambic Pentameter', section: 'POST', aliases: ['rhetoric-meter', 'iambic-pentameter', 'iambic pentameter', 'meter'], keywords: ['ten syllables', 'da-dum', 'verse', 'poetry', 'line'] },
+ { id: 'nav.post.rhetoric.diacope', path: '/post/rhetoric/diacope', label: 'Rhetoric Diacope', section: 'POST', aliases: ['rhetoric-diacope', 'diacope'], keywords: ['repetition', 'emphasis', 'figure of speech'] },
+ { id: 'nav.post.rhetoric.chiasmus', path: '/post/rhetoric/chiasmus', label: 'Rhetoric Chiasmus', section: 'POST', aliases: ['rhetoric-chiasmus', 'chiasmus'], keywords: ['reversal', 'mirror', 'crossed', 'figure of speech'] },
+ { id: 'nav.post.rhetoric.progressia', path: '/post/rhetoric/progressia', label: 'Rhetoric Progressia', section: 'POST', aliases: ['rhetoric-progressia', 'progressia'], keywords: ['escalation', 'build', 'climax', 'figure of speech'] },
+ { id: 'nav.post.rhetoric.brainstorm', path: '/post/rhetoric/brainstorm', label: 'Rhetorical Brainstorm', section: 'POST', aliases: ['rhetoric-brainstorm', 'rhetorical brainstorm', 'brainstorm'], keywords: ['angles', 'ideation', 'openings', 'metaphors'] },
{ id: 'nav.post.wordplay', path: '/post/wordplay', label: 'Wordplay', section: 'POST', aliases: ['post-wordplay'] },
+ { id: 'nav.post.wordplay.compound-chain', path: '/post/wordplay/compound-chain', label: 'Compound Chain', section: 'POST', aliases: ['wordplay-compound-chain', 'compound-chain', 'compound chain'], keywords: ['compound words', 'seed word', 'chain'] },
+ { id: 'nav.post.wordplay.bridge-word', path: '/post/wordplay/bridge-word', label: 'Bridge Word', section: 'POST', aliases: ['wordplay-bridge-word', 'bridge-word', 'bridge word'], keywords: ['linking word', 'connector', 'puzzle'] },
+ { id: 'nav.post.wordplay.double-meaning', path: '/post/wordplay/double-meaning', label: 'Double Meaning', section: 'POST', aliases: ['wordplay-double-meaning', 'double-meaning', 'double meaning'], keywords: ['homonym', 'two meanings', 'pun'] },
+ { id: 'nav.post.wordplay.idiom-twist', path: '/post/wordplay/idiom-twist', label: 'Idiom Twist', section: 'POST', aliases: ['wordplay-idiom-twist', 'idiom-twist', 'idiom twist'], keywords: ['idiom', 'phrase', 'twist', 'domain swap'] },
{ id: 'nav.settings.ai-assignments', path: '/settings/ai-assignments', label: 'AI Assignments', section: 'Settings', aliases: ['ai-assignments', 'assignments', 'settings-ai-assignments', 'ai-inventory'], keywords: ['provider', 'model', 'pin', 'inventory', 'migration', 'llm'] },
{ id: 'nav.settings.api-access', path: '/settings/api-access', label: 'API Access', section: 'Settings', aliases: ['api-access', 'settings-api-access', 'public-api', 'swagger', 'openapi'], keywords: ['rest', 'external', 'tts api', 'sdapi', 'voice api', 'docs', 'curl', 'expose', 'passwordless', 'auth gating'] },
diff --git a/server/lib/navManifest.test.js b/server/lib/navManifest.test.js
index 6b1182a5ff..79c7153d31 100644
--- a/server/lib/navManifest.test.js
+++ b/server/lib/navManifest.test.js
@@ -50,6 +50,9 @@ const TABBED_PAGES = [
{ parent: 'morse', file: 'client/src/components/meatspace/post/MorseTrainer.jsx', constName: 'MODES' },
{ parent: 'memory', file: 'client/src/components/meatspace/tabs/PostTab.jsx', constName: 'MEMORY_SUBROUTES' },
{ parent: 'memory/elements', file: 'client/src/components/meatspace/post/ElementsSong.jsx', constName: 'PRACTICE_MODES' },
+ { parent: 'wordplay', file: 'client/src/components/meatspace/post/WordplayTrainer.jsx', constName: 'GAME_MODES' },
+ { parent: 'rhetoric', file: 'client/src/components/meatspace/post/RhetoricTrainer.jsx', constName: 'RHETORIC_MODES' },
+ { parent: 'progress', file: 'client/src/components/meatspace/post/PostProgress.jsx', constName: 'PROGRESS_SUBROUTES' },
] },
];
@@ -506,3 +509,40 @@ describe('nav coverage — every navigable App.jsx route has a manifest entry',
expect(stale).toEqual([]);
});
});
+
+// The POST Practice Library (`/post/explore`) is a page of hard-coded deep links
+// into every POST test surface — the one place a user can browse what exists.
+// A typo or a renamed mode there produces a card that opens a blank tab, and
+// nothing else in the app would notice. Every link it ships must therefore be a
+// path the nav manifest already registers, which is also what makes each of
+// those surfaces reachable from ⌘K and voice.
+describe('nav contract — POST Practice Library links are registered destinations', () => {
+ const CATALOG_FILES = [
+ // Owns DRILL_PRACTICE_LINKS — where most catalog cards get their href, so
+ // scanning only the catalog would leave the DERIVED half unguarded.
+ 'client/src/components/meatspace/post/constants.js',
+ 'client/src/components/meatspace/post/practiceCatalog.js',
+ 'client/src/components/meatspace/post/PracticeLibrary.jsx',
+ 'client/src/components/meatspace/post/PostSessionLauncher.jsx',
+ 'client/src/components/meatspace/post/BrowseCatalogLink.jsx',
+ // The sidebar's POST section — a link there that no command registers is
+ // unreachable from ⌘K and voice.
+ 'client/src/components/Layout.jsx',
+ ];
+ const navPaths = new Set(NAV_COMMANDS.map((c) => c.path));
+
+ for (const file of CATALOG_FILES) {
+ it(`${file} links only at registered POST paths`, () => {
+ const src = fs.readFileSync(path.join(REPO_ROOT, file), 'utf8');
+ // Both quote styles: JS object values use single quotes, JSX `to="…"` uses
+ // double. Route PARAMS (`:id`) are excluded — those are dynamic detail
+ // routes that deliberately carry no manifest entry.
+ const links = [...src.matchAll(/['"](\/post\/[^'"${}]*)['"]/g)]
+ .map((m) => m[1])
+ .filter((p) => !p.includes(':'));
+ expect(links.length).toBeGreaterThan(0);
+ const unregistered = [...new Set(links)].filter((p) => !navPaths.has(p));
+ expect(unregistered).toEqual([]);
+ });
+ }
+});