Skip to content

feat(clerk-bird): add leaderboard, audio cue, and surface in help#304

Merged
rafa-thayto merged 2 commits into
mainfrom
clerk-bird-rankings-sound-and-help
May 22, 2026
Merged

feat(clerk-bird): add leaderboard, audio cue, and surface in help#304
rafa-thayto merged 2 commits into
mainfrom
clerk-bird-rankings-sound-and-help

Conversation

@rafa-thayto

@rafa-thayto rafa-thayto commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Leaderboard: a local top-10 leaderboard for the hidden clerk bird easter egg. From the GAME OVER screen, press N to submit a name and L to view the board; use / (or j/k) to select a row and D to delete it (with Y/N confirmation). Rankings live in ~/.flap-rankings.json; the existing ~/.flap-best file is unchanged.
  • Audio feedback: each pipe-pass (+1) and the death event now emit a short bell tone via ASCII BEL (\x07). The host terminal handles cross-platform behavior on Windows, macOS, Linux, and any POSIX TTY — terminals with the bell disabled stay silent, respecting the user's own setting. No subprocess, no platform branching, no bundled audio asset.
  • Discoverability: clerk bird is no longer hidden. The help formatter now renders easter-egg commands after the auto-generated help row so the easter egg surfaces in clerk --help without cluttering the top of the command list.

Test plan

  • bun run format && bun run lint && bun run typecheck — all clean locally
  • bun test packages/extras/src/clerk-bird/flap.test.ts — 23 passing (includes new beep + it.each refactors of removeRanking)
  • clerk --help ends with the bird row below the help row
  • clerk bird launches the game; passing a pipe produces a +1 popup and a bell tick on the same render frame; death produces a bell tick + screen shake
  • In macOS Terminal → Settings → Profiles → Advanced, disable "Audible bell" + "Visual bell"; relaunch the game and confirm scoring still works silently (we don't force audio when the user has disabled it)
  • On Windows Terminal / WSL: confirm BEL produces the system default beep on score (validates the no-platform-branching claim)

@changeset-bot

changeset-bot Bot commented May 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f667c2d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
clerk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f78b840f-d1bd-44a4-b08e-a6a6659e7149

📥 Commits

Reviewing files that changed from the base of the PR and between 6a47f50 and f667c2d.

📒 Files selected for processing (6)
  • .changeset/clerk-bird-rankings.md
  • package.json
  • packages/cli-core/src/lib/help.ts
  • packages/extras/src/clerk-bird/flap.test.ts
  • packages/extras/src/clerk-bird/flap.ts
  • packages/extras/src/index.ts

📝 Walkthrough

Walkthrough

This PR adds persistent leaderboards to the "clerk bird" easter-egg game, making it more discoverable and feature-complete. The game now supports a name-entry phase after death, displays a ranked leaderboard with entry selection and deletion, persists scores to ~/.flap-rankings.json, provides audio feedback on scoring events, and displays the bird command in help output. A comprehensive test suite validates the ranking utilities (insertion, removal, file I/O, and audio output).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately and concisely summarizes the main changes: adding a leaderboard, audio feedback, and making the bird command visible in help.
Description check ✅ Passed The pull request description comprehensively documents all three major features (leaderboard, audio feedback, discoverability) with implementation details and a thorough test plan.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rafa-thayto

Copy link
Copy Markdown
Contributor Author

!snapshot

@github-actions

Copy link
Copy Markdown
Contributor

Snapshot published

npm install -g clerk@1.4.1-snapshot.4ae2e98
Package Version
clerk 1.4.1-snapshot.4ae2e98

Published from 4ae2e98

@rafa-thayto rafa-thayto force-pushed the clerk-bird-rankings-sound-and-help branch from 4ae2e98 to 3bdf62c Compare May 21, 2026 15:24

@wyattjoh wyattjoh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two issues worth fixing before merging.

Comment thread packages/extras/src/clerk-bird/flap.ts Outdated
Comment thread packages/extras/src/clerk-bird/flap.test.ts
- Local top-10 leaderboard with name entry on game-over and ↑↓/jk + D
  to inspect and delete rows; stored as JSON in `~/.flap-rankings.json`
- ASCII BEL on each pipe-pass and on death — cross-platform audio
  feedback that respects the host terminal's own bell setting
- `clerk bird` is no longer hidden; it now appears as the last item
  in `clerk --help`, rendered below the auto-generated help row
- Clamp scores in sanitizeEntry() to [0, 99999] so a corrupted
  ~/.flap-rankings.json cannot crash the leaderboard renderer via
  negative repeat() in padBox().
- Add packages/extras/src/ to the root test script so flap tests
  are picked up by CI.
@rafa-thayto rafa-thayto force-pushed the clerk-bird-rankings-sound-and-help branch from 3bdf62c to f667c2d Compare May 22, 2026 12:15
@rafa-thayto rafa-thayto requested a review from wyattjoh May 22, 2026 12:17
@rafa-thayto rafa-thayto merged commit bb0ce2d into main May 22, 2026
10 checks passed
@rafa-thayto rafa-thayto deleted the clerk-bird-rankings-sound-and-help branch May 22, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants