Description
To further emphasize the terminal/matrix aesthetic and improve navigation velocity, we want to extend the search input bar ($ grep -i) on the leaderboard page to double as an interactive command-line interface (REPL/CLI interpreter).
Instead of just performing text queries, the input field should recognize special terminal keywords and execute actions or filters dynamically.
Proposed CLI Commands
The CLI interpreter should support the following commands:
help / ls — Triggers a terminal-style floating help overlay/modal showing all available commands.
top <N> (e.g. top 5, top 10) — Filters the leaderboard list to show only the top N ranked students.
sudo <tag> (e.g. sudo root, sudo exec) — Instantly filters the view to show only users holding that specific privilege tag ([ROOT], [SUDO], or [EXEC]).
compare <user1> <user2> <user3> — Auto-selects the specified LeetCode handles and triggers the peer comparison modal.
Implementation Plan
- Parser Hook: Update the search input key/input listener to intercept string matches. If the query starts with or matches a command format (e.g., starts with
top , sudo , compare , or matches help/ls), execute the command logic rather than the standard regex substring matching.
- Dynamic UI Feedback: Display a visual indicator in the result count badge (e.g.,
[CMD_EXEC]) when a valid command is input.
- Interactive Help Overlay: Build a lightweight retro monospace popup detailing command syntax and tips.
- Compare Modal Hookup: Integrate with
frontend/js/compare.js to trigger the side-by-side modal using URL/query handles.
UI Consistency
The REPL commands, command warnings, and output feedback should align with the established green/amber matrix styling, monospace fonts, and blocky borders.
Description
To further emphasize the terminal/matrix aesthetic and improve navigation velocity, we want to extend the search input bar (
$ grep -i) on the leaderboard page to double as an interactive command-line interface (REPL/CLI interpreter).Instead of just performing text queries, the input field should recognize special terminal keywords and execute actions or filters dynamically.
Proposed CLI Commands
The CLI interpreter should support the following commands:
help/ls— Triggers a terminal-style floating help overlay/modal showing all available commands.top <N>(e.g.top 5,top 10) — Filters the leaderboard list to show only the top N ranked students.sudo <tag>(e.g.sudo root,sudo exec) — Instantly filters the view to show only users holding that specific privilege tag ([ROOT],[SUDO], or[EXEC]).compare <user1> <user2> <user3>— Auto-selects the specified LeetCode handles and triggers the peer comparison modal.Implementation Plan
top,sudo,compare, or matcheshelp/ls), execute the command logic rather than the standard regex substring matching.[CMD_EXEC]) when a valid command is input.frontend/js/compare.jsto trigger the side-by-side modal using URL/query handles.UI Consistency
The REPL commands, command warnings, and output feedback should align with the established green/amber matrix styling, monospace fonts, and blocky borders.