From 8dc728ec996decc3a307fb6e8955e5a96ecbd3ec Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 20 Nov 2026 11:07:42 +0100 Subject: [PATCH] show workspace fairness settings and events only when relevant (#12562) * feat: show workspace fairness settings and events only when they can matter The three fairness tuning settings show only while workspace fairness is on, and the Queues drawer's fairness events section hides when fairness is off and there is no history to look back on. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PjsYvvJe56H5vnK7jXVvAp * fix: keep the fairness events section hidden while its events load when fairness is off Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PjsYvvJe56H5vnK7jXVvAp --------- Co-authored-by: Claude Opus 5.5 --- .../src/lib/components/InstanceSetting.svelte | 8 + .../components/WorkspaceFairnessEvents.svelte | 138 ++++++++++-------- 2 files changed, 88 insertions(+), 58 deletions(-) diff --git a/frontend/src/lib/components/InstanceSetting.svelte b/frontend/src/lib/components/InstanceSetting.svelte index c4f6f8b231..32c97f6623 100644 --- a/frontend/src/lib/components/InstanceSetting.svelte +++ b/frontend/src/lib/components/InstanceSetting.svelte @@ -100,6 +100,14 @@ if (setting == 'nsjail_tmpfs_size_mb' && values['nsjail_tmp_backing'] === 'disk') { return false } + if ( + (setting == 'workspace_fairness_max_percent' || + setting == 'workspace_fairness_duration_secs' || + setting == 'workspace_fairness_min_total_jobs') && + values['workspace_fairness_enabled'] !== true + ) { + return false + } return true } diff --git a/frontend/src/lib/components/WorkspaceFairnessEvents.svelte b/frontend/src/lib/components/WorkspaceFairnessEvents.svelte index 4fbaf8f076..509a479dd9 100644 --- a/frontend/src/lib/components/WorkspaceFairnessEvents.svelte +++ b/frontend/src/lib/components/WorkspaceFairnessEvents.svelte @@ -1,5 +1,6 @@ -
- {#snippet action()} -
+ + + {#each events as e} + + + {displayDate(e.timestamp, true)} + + + {#if e.operation === 'workspace_fairness.capped'} + capped + {:else if e.operation === 'workspace_fairness.uncapped'} + uncapped + {:else} + {e.operation} + {/if} + + {e.workspace_id ?? '—'} + {formatParameters(e.parameters)} + + {/each} + + + + {/if} + +{/if}