From 229aafc8e99edf7731ecbeb79ddb66924de8dba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Gierwia=C5=82o?= Date: Fri, 5 Dec 2025 22:16:49 +0100 Subject: [PATCH] refactor(recordings): remove manual matching trigger from Recording tab Removed "Run matching" buttons from the Recording tab to prevent manual triggering. The system now only displays matching status information: - Shows countdown when registration deadline is approaching - Shows last run time when matching has been completed - Shows informational message when matching hasn't run yet This ensures matching is only triggered automatically by the system or through the admin interface, maintaining better control over the matching process. Changes: - Removed handleRunMatching function and runningMatching state - Replaced actionable buttons with informational status displays - Improved date/time formatting for last run timestamp - Changed "not run yet" status to positive "will be run soon" message --- .../components/recordings/RecordingTab.jsx | 61 ++++++------------- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/frontend/src/components/recordings/RecordingTab.jsx b/frontend/src/components/recordings/RecordingTab.jsx index cca7232..2cfe87f 100644 --- a/frontend/src/components/recordings/RecordingTab.jsx +++ b/frontend/src/components/recordings/RecordingTab.jsx @@ -16,7 +16,6 @@ const RecordingTab = ({ slug, event, myHeats }) => { const [suggestions, setSuggestions] = useState(null); const [recorderOptOut, setRecorderOptOut] = useState(false); const [updatingOptOut, setUpdatingOptOut] = useState(false); - const [runningMatching, setRunningMatching] = useState(false); // Load suggestions on mount useEffect(() => { @@ -66,18 +65,6 @@ const RecordingTab = ({ slug, event, myHeats }) => { } }; - const handleRunMatching = async () => { - try { - setRunningMatching(true); - await matchingAPI.runMatching(slug); - await loadSuggestions(); - } catch (err) { - console.error('Failed to run matching:', err); - } finally { - setRunningMatching(false); - } - }; - // Calculate countdown to matching const getCountdown = () => { if (!event?.registrationDeadline) return null; @@ -149,41 +136,29 @@ const RecordingTab = ({ slug, event, myHeats }) => { ) : matchingRunAt ? (
-
-
- -
-

Matching completed

-

- Last run: {new Date(matchingRunAt).toLocaleString('en-US')} -

-
+
+ +
+

Matching completed

+

+ Last run: {new Date(matchingRunAt).toLocaleString('en-US', { + dateStyle: 'medium', + timeStyle: 'short' + })} +

-
) : ( -
-
-
- -

Matching has not been run yet

+
+
+ +
+

Matching will be run soon

+

+ The system will automatically pair recording partners when ready. +

-
)}