diff --git a/src/views/Game/GameLog.tsx b/src/views/Game/GameLog.tsx index 24f9eb722d..6c241c92a7 100644 --- a/src/views/Game/GameLog.tsx +++ b/src/views/Game/GameLog.tsx @@ -18,6 +18,7 @@ import * as React from "react"; import * as moment from "moment"; import { _, pgettext } from "translate"; +import * as DynamicHelp from "react-dynamic-help"; import { LogEntry } from "Game"; import { GobanEngineConfig } from "goban"; @@ -42,8 +43,13 @@ export function GameLog({ const [log, setLog] = React.useState([]); const [shouldDisplayFullLog, setShouldDisplayFullLog] = React.useState(false); + const { registerTargetItem } = React.useContext(DynamicHelp.Api); + const { ref: autoscoreRef } = registerTargetItem("autoscore-game-log-entry"); + const game_id = goban_config.game_id as number; + let firstAutoscoringEntryRendered = false; + React.useEffect(() => { socket.send(`game/log`, { game_id }, (log) => { setLog(log); @@ -70,6 +76,14 @@ export function GameLog({ [goban_config], ); + function firstAutoScoreEntry(): boolean { + if (firstAutoscoringEntryRendered) { + return false; + } + firstAutoscoringEntryRendered = true; + return true; + } + return ( <>

{_("Game Log")}

@@ -101,6 +115,13 @@ export function GameLog({ ) .map((entry, idx) => ( . + */ + +import React from "react"; + +import { HelpFlow, HelpItem } from "react-dynamic-help"; + +import { _, pgettext } from "translate"; + +/** + * A help flow intended for moderators and CMs wondering about mysterious auto score entries + */ + +export function GameLogHelp(): JSX.Element { + return ( + + +
+ {_( + "These come from the user's browser during autoscoring. Two of these from each user, at the beginning of the scoring phase, and if the users presses 'auto-score'", + )} +
+
+
+ ); +} diff --git a/src/views/HelpFlows/HelpFlows.tsx b/src/views/HelpFlows/HelpFlows.tsx index ffb54d97d9..519b16e12d 100644 --- a/src/views/HelpFlows/HelpFlows.tsx +++ b/src/views/HelpFlows/HelpFlows.tsx @@ -28,6 +28,7 @@ import { UndoRequestedIntro } from "./UndoIntro"; import { UndoRequestReceivedIntro } from "./UndoIntro"; import { CommunityModeratorIntro } from "./CommunityModeratorIntro"; import { OJEIntro } from "./OJEIntro"; +import { GameLogHelp } from "./GameLogHelp"; /** * This component is a handy wrapper for all the Help Flows, and reset on login/logout @@ -87,6 +88,7 @@ export function HelpFlows(): JSX.Element { +