-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: Add kangaroo Easter egg to chat interface #8799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Created KangarooEasterEgg component with 5 different jokes - Triggers after typing "kangaroo" three times within 10 seconds - Displays random joke with animated punchline reveal - Added comprehensive test coverage - Subtle, dismissible overlay that does not interrupt workflow
Code Review SummaryI've reviewed the changes and found the following issues that should be addressed:
|
| setCursorPosition(newCursorPosition) | ||
|
|
||
| // Easter egg detection: trigger on typing "kangaroo" three times | ||
| if (newValue.toLowerCase().includes("kangaroo")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Easter egg detection currently checks if the entire input includes "kangaroo" and then increments the counter on every change. This can lead to multiple increments if the input already contains the word. Consider counting exact occurrences (e.g., using a regex match) or checking that a new instance was added to avoid unintended multiple triggers.
| kangarooTimeoutRef.current = setTimeout(() => { | ||
| kangarooCountRef.current = 0 | ||
| }, 10000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timeout stored in kangarooTimeoutRef is never cleaned up when the component unmounts, which will cause a memory leak if the component is destroyed before the 10-second timeout fires. Add a cleanup function in a useEffect hook to clear this timeout on unmount.
| // Easter egg detection: trigger on typing "kangaroo" three times | ||
| if (newValue.toLowerCase().includes("kangaroo")) { | ||
| kangarooCountRef.current++ | ||
|
|
||
| // Clear existing timeout | ||
| if (kangarooTimeoutRef.current) { | ||
| clearTimeout(kangarooTimeoutRef.current) | ||
| } | ||
|
|
||
| // Reset counter after 10 seconds | ||
| kangarooTimeoutRef.current = setTimeout(() => { | ||
| kangarooCountRef.current = 0 | ||
| }, 10000) | ||
|
|
||
| // Show Easter egg on third "kangaroo" | ||
| if (kangarooCountRef.current >= 3) { | ||
| setShowKangarooEasterEgg(true) | ||
| kangarooCountRef.current = 0 | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trigger logic increments the counter on every input change that contains "kangaroo" anywhere in the text, rather than tracking distinct instances of typing the word. This means if a user types "kangaroo" once and then continues editing that same input (adding more text after it), the counter will increment again on each keystroke. The easter egg will trigger unexpectedly early if the input continues to contain the word during subsequent edits.
Summary
Adds a fun kangaroo-themed Easter egg to the Roo Code chat interface that displays random kangaroo jokes.
Changes
KangarooEasterEggcomponent with 5 different kangaroo jokesHow to trigger
Testing
Important
Adds a kangaroo-themed Easter egg to the chat interface, triggered by typing 'kangaroo' three times, with comprehensive test coverage.
KangarooEasterEggcomponent displaying random kangaroo jokes with animated punchline reveal.ChatTextArea.KangarooEasterEggin__tests__/KangarooEasterEgg.spec.tsxwith 7 tests.ChatTextArea.tsxwith state management for triggering and displaying the Easter egg.This description was created by
for 6d14463. You can customize this summary. It will automatically update as commits are pushed.