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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
polish([issue-2100]): clamp goal inputs to schema bounds (review nit)
Adam Eivy86d91e92165d
diff --git a/client/src/components/meatspace/post/PostDrillConfig.jsx b/client/src/components/meatspace/post/PostDrillConfig.jsxindex 2aae02a0d6..665cb81826 100644--- a/client/src/components/meatspace/post/PostDrillConfig.jsx+++ b/client/src/components/meatspace/post/PostDrillConfig.jsx@@ -547,9 +547,12 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {const setGoalField = (key, raw) => setGoals(prev => {const next = { ...prev };- const n = parseInt(raw, 10);- if (raw === '' || Number.isNaN(n)) delete next[key];- else next[key] = n;+ let n = parseInt(raw, 10);+ if (raw === '' || Number.isNaN(n)) { delete next[key]; return next; }+ // Clamp into the schema's range so Save can't 400 on an out-of-bounds value.+ const def = GOAL_DEFS.find(d => d.key === key);+ n = Math.max(1, Math.min(def?.max ?? n, n));+ next[key] = n;return next;});const toggleModule = (m) => setSessionModules(prev => (@@ -842,6 +845,7 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {id={`goal-${def.key}`}type="number"min="1"+ max={def.max}inputMode="numeric"value={goals[def.key] ?? ''}onChange={e => setGoalField(def.key, e.target.value)}diff --git a/client/src/components/meatspace/post/constants.js b/client/src/components/meatspace/post/constants.jsindex e177a24432..9ee810ef9e 100644--- a/client/src/components/meatspace/post/constants.js+++ b/client/src/components/meatspace/post/constants.js@@ -155,11 +155,13 @@ export function computeDomainAverages(byDrill = {}) {// Practice goals (issue #2100). A goal is "set" only when its target is a// positive number, so an absent/legacy `goals` object (or `{}`) yields no goal// rows and the UI hides cleanly.+// `max` mirrors postGoalsSchema's bounds (server/lib/postValidation.js) so the+// number inputs can't submit an out-of-range value that would 400 on save.export const GOAL_DEFS = [- { key: 'dailyMinutes', label: 'Minutes today', unit: 'min', metric: 'todayMinutes' },- { key: 'weeklySessions', label: 'Sessions this week', unit: '', metric: 'weekSessions' },- { key: 'streakTarget', label: 'Streak', unit: 'd', metric: 'currentStreak' },- { key: 'morseWpmTarget', label: 'Morse WPM', unit: 'wpm', metric: 'morseWpm' },+ { key: 'dailyMinutes', label: 'Minutes today', unit: 'min', metric: 'todayMinutes', max: 1440 },+ { key: 'weeklySessions', label: 'Sessions this week', unit: '', metric: 'weekSessions', max: 100 },+ { key: 'streakTarget', label: 'Streak', unit: 'd', metric: 'currentStreak', max: 3650 },+ { key: 'morseWpmTarget', label: 'Morse WPM', unit: 'wpm', metric: 'morseWpm', max: 100 },];export function hasGoals(goals) {