working checkpoint before major feedback UI changes

This commit is contained in:
2026-01-03 20:10:54 -07:00
parent 925fc25d73
commit adb6f0b39c
8 changed files with 328 additions and 271 deletions

View File

@@ -143,31 +143,39 @@ const PromptDisplay = () => {
};
const handleFillPool = async () => {
// Show feedback weighting UI instead of directly filling pool
setShowFeedbackWeighting(true);
};
const handleFeedbackComplete = async (feedbackData) => {
// After feedback is submitted, fill the pool
// Start pool refill immediately (uses active words 6-11)
setFillPoolLoading(true);
setShowFeedbackWeighting(false);
setError(null);
try {
const response = await fetch('/api/v1/prompts/fill-pool', { method: 'POST' });
if (response.ok) {
// Refresh the prompt and pool stats
fetchMostRecentPrompt();
fetchPoolStats();
const data = await response.json();
console.log('Pool refill started:', data);
// Pool refill started successfully, now show feedback weighting UI
setShowFeedbackWeighting(true);
} else {
setError('Failed to fill prompt pool after feedback');
const errorData = await response.json();
throw new Error(errorData.detail || `Failed to start pool refill: ${response.status}`);
}
} catch (err) {
setError('Failed to fill prompt pool after feedback');
console.error('Error starting pool refill:', err);
setError(`Failed to start pool refill: ${err.message}`);
} finally {
setFillPoolLoading(false);
}
};
const handleFeedbackComplete = async (feedbackData) => {
// After feedback is submitted, refresh the UI
setShowFeedbackWeighting(false);
// Refresh the prompt and pool stats
fetchMostRecentPrompt();
fetchPoolStats();
};
const handleFeedbackCancel = () => {
setShowFeedbackWeighting(false);
};