Skip to content

[Feature Request]: Interactive Terminal REPL & CLI Search Commands for Leaderboard #107

@Vachhani-Tapan

Description

@Vachhani-Tapan

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:

  1. help / ls — Triggers a terminal-style floating help overlay/modal showing all available commands.
  2. top <N> (e.g. top 5, top 10) — Filters the leaderboard list to show only the top N ranked students.
  3. 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]).
  4. compare <user1> <user2> <user3> — Auto-selects the specified LeetCode handles and triggers the peer comparison modal.

Implementation Plan

  1. 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.
  2. Dynamic UI Feedback: Display a visual indicator in the result count badge (e.g., [CMD_EXEC]) when a valid command is input.
  3. Interactive Help Overlay: Build a lightweight retro monospace popup detailing command syntax and tips.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions