Fix advancement targets stripped by Zod, remove redundant save bar
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m32s

- Add general settings fields (startupAdvanceCount, conceptAdvanceCount,
  notifyOnEntry, notifyOnAdvance) to ALL round config schemas, not just
  FilteringConfig. Zod was stripping them on save for other round types.
- Replace floating save bar with error-only bar since autosave handles
  all config persistence (800ms debounce)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt
2026-02-18 14:59:23 +01:00
parent 9c19661400
commit cab311fbbb
2 changed files with 32 additions and 35 deletions

View File

@@ -2006,40 +2006,26 @@ export default function RoundDetailPage() {
)}
</Tabs>
{/* Floating save bar — appears when config has unsaved changes */}
{hasUnsavedConfig && (
<div className="fixed bottom-0 left-0 right-0 z-50 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 shadow-[0_-4px_12px_rgba(0,0,0,0.1)]">
{/* Autosave error bar — only shows when save fails */}
{autosaveStatus === 'error' && (
<div className="fixed bottom-0 left-0 right-0 z-50 border-t bg-red-50 dark:bg-red-950/50 shadow-[0_-4px_12px_rgba(0,0,0,0.1)]">
<div className="container flex items-center justify-between py-3 px-4 max-w-5xl mx-auto">
<div className="flex items-center gap-2 text-sm">
<div className="h-2 w-2 rounded-full bg-amber-500 animate-pulse" />
<span className="text-muted-foreground">You have unsaved changes</span>
<div className="flex items-center gap-2 text-sm text-red-700 dark:text-red-300">
<AlertTriangle className="h-4 w-4" />
<span>Auto-save failed</span>
</div>
<div className="flex items-center gap-2">
{autosaveStatus === 'error' && (
<span className="text-xs text-red-500 mr-2">Save failed try again</span>
<Button
size="sm"
onClick={saveConfig}
disabled={updateMutation.isPending}
className="bg-[#de0f1e] hover:bg-[#c00d1a] text-white"
>
{updateMutation.isPending ? (
<><Loader2 className="h-3.5 w-3.5 mr-1.5 animate-spin" />Retrying...</>
) : (
<><Save className="h-3.5 w-3.5 mr-1.5" />Retry Save</>
)}
<Button
size="sm"
variant="outline"
onClick={() => {
setConfig(serverConfig)
}}
>
Discard
</Button>
<Button
size="sm"
onClick={saveConfig}
disabled={updateMutation.isPending}
className="bg-[#de0f1e] hover:bg-[#c00d1a] text-white"
>
{updateMutation.isPending ? (
<><Loader2 className="h-3.5 w-3.5 mr-1.5 animate-spin" />Saving...</>
) : (
<><Save className="h-3.5 w-3.5 mr-1.5" />Save Changes</>
)}
</Button>
</div>
</Button>
</div>
</div>
)}