Skip to content

Commit 9ba9561

Browse files
unhappychoiceclaude
andcommitted
feat(ui): add real-time metrics updates during typing
- Update display periodically (every 100ms) even without keyboard input - Ensures elapsed time, WPM, CPM, and other metrics update in real-time - Applies to all typing screen methods: start_session, show, show_with_state 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9087328 commit 9ba9561

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/game/screens/typing_screen.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ impl TypingScreen {
177177
}
178178
}
179179
}
180+
} else {
181+
// No keyboard event, but update display periodically for real-time metrics
182+
self.update_display()?;
180183
}
181184
}
182185

@@ -233,6 +236,9 @@ impl TypingScreen {
233236
}
234237
}
235238
}
239+
} else {
240+
// No keyboard event, but update display periodically for real-time metrics
241+
self.update_display()?;
236242
}
237243
}
238244

@@ -277,6 +283,9 @@ impl TypingScreen {
277283
}
278284
}
279285
}
286+
} else {
287+
// No keyboard event, but update display periodically for real-time metrics
288+
self.update_display()?;
280289
}
281290
};
282291

0 commit comments

Comments
 (0)