fix(heuristic): disable submit button until evaluation progress reaches 100%#1879
Conversation
…es 100% The FAB submit button used ':disabled="calculateProgress < 100"' where calculateProgress is a plain function reference. In Vue 3 templates a function reference is always truthy, so the comparison evaluates to false unconditionally, leaving the button permanently enabled regardless of how many questions the evaluator has answered. Fix: replace with the reactive ref 'calculatedProgress' that is updated by calculateProgress() after every answer change, restoring the intended guard that prevents submission before all questions are answered. Signed-off-by: Aaradhy Chinche Signed-off-by: Aaradhy Chinche <aaradhychinche@gmail.com>
There was a problem hiding this comment.
Pull request overview
Fixes heuristic evaluation submit FAB disabling logic by binding the :disabled condition to the reactive progress ref (calculatedProgress) instead of the calculateProgress function reference, preventing premature submission.
Changes:
- Update submit button
:disabledbinding to usecalculatedProgress < 100.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SonarCloud reported 3 maintainability issues (L1046, L1096, L1128) in HeuristicTestView.vue: caught 'error' variables were not used. Add console.error() calls in each catch block so the exception is both handled and surfaced for debugging. Signed-off-by: Aaradhy Chinche Signed-off-by: Aaradhy Chinche <aaradhychinche@gmail.com>
|
There was a problem hiding this comment.
Pull request overview
Fixes heuristic evaluation UI logic so the Submit FAB is disabled until the reactive progress value reaches 100%, preventing incomplete submissions (issue #1873).
Changes:
- Update Submit button
:disabledbinding to usecalculatedProgress(reactive value) instead ofcalculateProgress(function reference). - Add console error logging in
autoSaveAnswer,manualSaveAnswer, andsubmitAnswererror paths (currently introduces a syntax error due to duplicatecatchblocks).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }, 1500) | ||
| } catch (error) { | ||
| console.error('Submit answer failed:', error) | ||
| } catch { |
| } catch (error) { | ||
| console.error('Auto-save failed:', error) | ||
| } catch { | ||
| updateSaveStatus('Failed to save', 'error') |
| } catch (error) { | ||
| console.error('Manual save failed:', error) | ||
| } catch { | ||
| updateSaveStatus('Save failed', 'error') | ||
| showError('HeuristicsTestView.errors.failedToSaveAnswer') |



Related Issue
Fixes #1873
Problem
During heuristic evaluations, the Submit button is never properly disabled based on the evaluation progress.
The template currently checks:
:disabled="calculateProgress < 100"
However,
calculateProgressis a function reference instead of the actual computed progress value. Because of this, the condition does not behave as expected and the submit button can remain enabled even when the evaluation is incomplete.This can allow users to submit evaluations before all questions are answered.
Root Cause
The template references the progress calculation function instead of the computed progress value.
Solution
Updated the submit button condition to use the correct reactive progress value instead of the function reference.
This ensures:
UI Screenshots
Before Fix
Submit button could remain enabled even when evaluation progress was incomplete.
After Fix
Submit button stays disabled until all heuristic questions are answered and progress reaches 100%.
Testing
Tested locally by:
Notes
This change only updates the progress reference used in the template and does not modify existing evaluation logic.