diff --git a/src/components/Analysis/AnalysisNotification.tsx b/src/components/Analysis/AnalysisNotification.tsx index d03e3f34..1a32ee9d 100644 --- a/src/components/Analysis/AnalysisNotification.tsx +++ b/src/components/Analysis/AnalysisNotification.tsx @@ -5,11 +5,15 @@ import { DeepAnalysisProgress } from 'src/types/analysis' interface Props { progress: DeepAnalysisProgress onCancel: () => void + // A word for the cancel button, shown beside it (the drills' "Skip + // review"); without one, just the close icon. + cancelLabel?: string } export const AnalysisNotification: React.FC = ({ progress, onCancel, + cancelLabel, }) => { const hasTotals = progress.totalMoves > 0 const progressPercentage = hasTotals @@ -47,13 +51,22 @@ export const AnalysisNotification: React.FC = ({ - + {cancelLabel ? ( + + ) : ( + + )}
diff --git a/src/components/Openings/DrillPerformanceModal.tsx b/src/components/Openings/DrillPerformanceModal.tsx index 2c7a56f5..8dea8d81 100644 --- a/src/components/Openings/DrillPerformanceModal.tsx +++ b/src/components/Openings/DrillPerformanceModal.tsx @@ -39,6 +39,7 @@ interface Props { performanceData: DrillPerformanceData onContinueAnalyzing: () => void onNextDrill: () => void + onRetry: () => void onReconfigureDrills: () => void } @@ -769,6 +770,7 @@ const DesktopLayout: React.FC<{ performanceData: DrillPerformanceData onContinueAnalyzing: () => void onNextDrill: () => void + onRetry: () => void onReconfigureDrills: () => void gameTree: GameTree openingEndNode: GameNode @@ -788,6 +790,7 @@ const DesktopLayout: React.FC<{ performanceData, onContinueAnalyzing, onNextDrill, + onRetry, onReconfigureDrills, gameTree, openingEndNode, @@ -1064,6 +1067,13 @@ const DesktopLayout: React.FC<{ {/* Action Buttons */}
+
) : null - const renderDrillActionButtons = (fullWidth = false) => ( -
+ // Two to a row; one left on its own takes the whole row. + const drillButtonClass = + 'min-w-[45%] flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors' + const quietDrillButtonClass = `${drillButtonClass} border border-glass-border bg-white/5 text-white/90 hover:bg-white/10` + + const retryDrillButton = ( + + ) + + const renderDrillActionButtons = () => ( +
{controller.isAwaitingExtensionDecision && !controller.showPerformanceModal && !controller.continueAnalyzingMode && ( @@ -1078,17 +1094,20 @@ const OpeningsPage: NextPage = () => { !controller.showPerformanceModal && ( )} + {!controller.showPerformanceModal && + !controller.continueAnalyzingMode && + retryDrillButton} {!controller.currentPerformanceData && !controller.showPerformanceModal && !controller.continueAnalyzingMode && ( @@ -1097,7 +1116,7 @@ const OpeningsPage: NextPage = () => { !controller.continueAnalyzingMode && ( @@ -1105,20 +1124,21 @@ const OpeningsPage: NextPage = () => {
) - const renderPostDrillAnalysisButtons = (fullWidth = false) => + // After the drill: its review (the analysis, if it was skipped), the same + // drill again, or the next. + const renderPostDrillAnalysisButtons = () => controller.continueAnalyzingMode ? ( -
- {controller.currentPerformanceData && ( - - )} +
+ {retryDrillButton} + @@ -1371,7 +1391,7 @@ const OpeningsPage: NextPage = () => {
{renderDrillProgress()} - {renderDrillActionButtons(true)} + {renderDrillActionButtons()}
@@ -1850,7 +1870,7 @@ const OpeningsPage: NextPage = () => { )} {/* Action Buttons */} - {renderPostDrillAnalysisButtons(true)} + {renderPostDrillAnalysisButtons()} {/* Analysis Components Stacked */}
@@ -2031,6 +2051,7 @@ const OpeningsPage: NextPage = () => { performanceData={controller.currentPerformanceData} onContinueAnalyzing={controller.continueAnalyzing} onNextDrill={controller.moveToNextDrill} + onRetry={controller.retryCurrentDrill} onReconfigureDrills={handleReconfigureDrills} /> )} @@ -2044,6 +2065,7 @@ const OpeningsPage: NextPage = () => { )}