File tree Expand file tree Collapse file tree
src/features/votes/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8585 return getRelativeEvaluationLabel (calcGradeDiff (taskResult .grade , latestMedianGrade ));
8686 });
8787
88+ // Whether to show the relative evaluation label (badge + sr-only text).
89+ // Hidden only when showNeutralBadge is false and the label is exactly '±0'.
90+ const shouldShowRelativeEvaluation = $derived (
91+ showNeutralBadge || relativeEvaluationLabel !== ' ±0' ,
92+ );
93+
8894 let isOpening = $state (false );
8995 let votedGrade = $state <TaskGrade | null >(null );
9096 let voteAbortController: AbortController | null = null ;
194200 >
195201 <span class =" sr-only" >
196202 Voted grade: {getTaskGradeLabel (displayGrade )}{relativeEvaluationLabel &&
197- ( showNeutralBadge || relativeEvaluationLabel !== ' ±0 ' )
203+ shouldShowRelativeEvaluation
198204 ? ` , relative evaluation: ${relativeEvaluationLabel } `
199205 : ' ' }{isProvisional ? ' , provisional' : ' ' }
200206 </span >
201207
202208 <GradeLabel taskGrade ={displayGrade } {defaultPadding } {defaultWidth } {reducedWidth } />
203209
204- {#if taskResult .grade !== TaskGrade .PENDING && latestMedianGrade && ( showNeutralBadge || relativeEvaluationLabel !== ' ±0 ' ) }
210+ {#if taskResult .grade !== TaskGrade .PENDING && latestMedianGrade && shouldShowRelativeEvaluation }
205211 <RelativeEvaluationBadge
206212 officialGrade ={taskResult .grade }
207213 medianGrade ={latestMedianGrade }
You can’t perform that action at this time.
0 commit comments