Skip to content

feat(web): slash command autocomplete + /status /list + fix chat input locking#404

Merged
henrypark133 merged 3 commits intomainfrom
feat/web-slash-commands
Feb 27, 2026
Merged

feat(web): slash command autocomplete + /status /list + fix chat input locking#404
henrypark133 merged 3 commits intomainfrom
feat/web-slash-commands

Conversation

@henrypark133
Copy link
Copy Markdown
Collaborator

Summary

  • Wire up /status [id], /progress [id], and /list as true slash commands (were in /help output but never parsed or dispatched)
  • Add slash command autocomplete: type / in chat input to see all 18 available commands with descriptions; arrow-key navigation, Tab/Enter to select, Escape to close
  • Fix chat input locking: remove textarea.disabled + sendBtn.disabled so users can always type and send, including /interrupt while the agent is processing
  • Remove quick-action toolbar buttons and dead #chat-status bar (black box visible due to min-height: 28px even when empty)

Test plan

  • Type / in chat → autocomplete dropdown appears with all 18 commands
  • Arrow keys navigate, Enter/Tab selects and fills the input, Escape closes
  • Type /status → agent responds with job summary (no LLM turn)
  • Type /status <uuid-prefix> → agent shows specific job details
  • Type /list → lists all jobs
  • While agent is processing, type /interrupt + Enter → interrupt is sent
  • No black bar between chat messages and input area

🤖 Generated with Claude Code

…ut locking

Backend:
- Add JobStatus, JobList, JobCancel Submission variants to submission.rs
- Parse /status [id], /progress [id], /list, /cancel <id> as control commands
- Dispatch to existing handle_check_status/handle_list_jobs/handle_cancel_job
  handlers via new process_job_status/process_job_list/process_job_cancel methods
- Add 4 parser tests (34 total, all passing)

Web UI:
- Add slash command autocomplete: type / in chat input to see all 18 commands
  with descriptions; arrow-key navigation, Tab/Enter to select, Escape to close
- Remove chat input locking: drop textarea.disabled + sendBtn.disabled so users
  can always type and send (including /interrupt while agent is processing)
- Remove quick-action toolbar buttons (↩↪⏸⊖🗑📋) added in previous session
- Remove dead #chat-status bar (min-height 28px black bar always visible when empty)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added scope: agent Agent core (agent loop, router, scheduler) scope: channel/web Web gateway channel scope: dependencies Dependency updates size: L 200-499 changed lines risk: medium Business logic, config, or moderate-risk modules contributor: experienced 6-19 merged PRs labels Feb 27, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience of the web interface by introducing robust slash command functionality and improving chat input responsiveness. It enables users to interact with the agent more efficiently through new job-related commands and an intuitive autocomplete system, while also streamlining the UI by removing unnecessary elements.

Highlights

  • Enhanced Slash Command Functionality: Implemented true slash command parsing and dispatch for /status, /progress, and /list, which were previously only listed in help but not functional.
  • Slash Command Autocomplete: Introduced a new autocomplete feature in the chat input, displaying all available commands with descriptions when typing /, and allowing navigation and selection via arrow keys, Tab, and Enter.
  • Improved Chat Input Responsiveness: Fixed an issue where the chat input would lock, ensuring users can always type and send messages, including /interrupt while the agent is processing.
  • UI Cleanup: Removed deprecated UI elements, specifically the quick-action toolbar buttons and the redundant #chat-status bar, streamlining the interface.
Changelog
  • Cargo.lock
    • Added the 'console' package as a new dependency.
    • Updated the 'syn' dependency from version 2.0.116 to 2.0.117.
  • src/agent/agent_loop.rs
    • Added new match arms to the agent's submission processing logic to handle 'JobStatus', 'JobList', and 'JobCancel' submission types.
  • src/agent/commands.rs
    • Implemented 'process_job_status' to retrieve and display job details.
    • Implemented 'process_job_list' as a convenience function to list all jobs.
    • Implemented 'process_job_cancel' to handle requests for canceling active jobs.
  • src/agent/submission.rs
    • Added new parsing logic to recognize '/status', '/progress', '/list', and '/cancel' commands.
    • Defined new enum variants 'JobStatus', 'JobList', and 'JobCancel' within the 'Submission' type.
    • Updated the 'is_control' method to correctly identify the new job-related commands as control submissions.
    • Added unit tests to verify the correct parsing of the new job status, list, and cancel commands.
  • src/channels/web/static/app.js
    • Defined a 'SLASH_COMMANDS' array containing all available slash commands and their descriptions for autocomplete.
    • Implemented functions 'showSlashAutocomplete', 'hideSlashAutocomplete', 'selectSlashItem', 'updateSlashHighlight', and 'filterSlashCommands' to manage the autocomplete UI and logic.
    • Removed the logic that disabled the chat input and send button, ensuring they are always active.
    • Removed the 'setStatus' function and all its associated calls.
    • Added comprehensive keyboard event handling for the chat input to support autocomplete navigation (ArrowUp, ArrowDown, Tab, Enter, Escape).
    • Added a 'blur' event listener to the chat input to hide the autocomplete dropdown after a short delay.
  • src/channels/web/static/index.html
    • Replaced the 'chat-status' div with a new 'slash-autocomplete' div to house the command suggestions.
    • Updated the placeholder text for the chat input to suggest typing '/' for commands.
  • src/channels/web/static/style.css
    • Removed all CSS rules related to the '.chat-status' element.
    • Added new CSS rules to style the '.slash-autocomplete' dropdown and its individual items, including command and description styling.
Activity
  • The pull request was created by henrypark133.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces excellent new features, including slash command autocomplete and handlers for /status and /list. The implementation is solid, particularly the frontend work for the autocomplete UI and the fix for chat input locking. I have a couple of suggestions to improve code clarity and efficiency. One is to simplify the backend parsing for the new /list command by treating it as a direct alias for /status, which would reduce some code redundancy. The other is a small refactoring in the JavaScript to cache autocomplete results and avoid re-filtering, which would make the UI slightly more performant.

Comment thread src/agent/submission.rs
Comment on lines +123 to +125
if lower == "/list" {
return Submission::JobList;
}
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.

medium

The /list command is an alias for /status without arguments. Instead of introducing a new Submission::JobList variant, you could parse /list directly into Submission::JobStatus { job_id: None }.

This would simplify the code by allowing you to remove the Submission::JobList enum variant and the Agent::process_job_list handler function, reducing code duplication.

You can achieve this by modifying the condition on line 111 to include /list:

if lower == "/status" || lower == "/progress" || lower == "/list" {
    return Submission::JobStatus { job_id: None };
}

And then you can remove this /list block.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in f5fc18a/list now parses directly to Submission::JobStatus { job_id: None }. Removed the JobList variant, the is_control arm, the match arm in agent_loop, and the process_job_list wrapper function.

Comment on lines +1190 to +1195
if (e.key === 'Tab' || (e.key === 'Enter' && _slashSelected >= 0)) {
e.preventDefault();
const matched = SLASH_COMMANDS.filter((c) => c.cmd.startsWith(chatInput.value.toLowerCase()));
const pick = _slashSelected >= 0 ? matched[_slashSelected] : matched[0];
if (pick) selectSlashItem(pick.cmd);
return;
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.

medium

The list of matching slash commands is being re-filtered inside the keydown event handler. This is slightly inefficient as the filtering already happens in the input event handler via filterSlashCommands.

You can avoid this re-computation by caching the list of matches when showSlashAutocomplete is called and reusing it here. To do this:

  1. Add let _slashMatches = []; at the top level (e.g., near _slashSelected).
  2. In showSlashAutocomplete(matches), store the matches: _slashMatches = matches;.
  3. In hideSlashAutocomplete(), clear it: _slashMatches = [];.

Then you can use _slashMatches here directly as suggested below.

    if (e.key === 'Tab' || (e.key === 'Enter' && _slashSelected >= 0)) {
      e.preventDefault();
      const pick = _slashSelected >= 0 ? _slashMatches[_slashSelected] : _slashMatches[0];
      if (pick) selectSlashItem(pick.cmd);
      return;
    }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in f5fc18a — added let _slashMatches = []; module-level cache. showSlashAutocomplete sets it, hideSlashAutocomplete resets it, and the keydown handler now uses _slashMatches directly instead of re-filtering SLASH_COMMANDS.

- Remove Submission::JobList variant; parse /list directly as
  JobStatus { job_id: None } (simpler, eliminates redundant enum
  variant, match arm, is_control branch, and wrapper function)
- Cache autocomplete matches in _slashMatches to avoid re-filtering
  SLASH_COMMANDS on every keydown while autocomplete is open

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@henrypark133 henrypark133 enabled auto-merge (squash) February 27, 2026 20:49
@henrypark133 henrypark133 merged commit 9ce09f7 into main Feb 27, 2026
14 checks passed
@henrypark133 henrypark133 deleted the feat/web-slash-commands branch February 27, 2026 20:59
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
…t locking (nearai#404)

* feat(web): slash command autocomplete, /status /list /cancel, fix input locking

Backend:
- Add JobStatus, JobList, JobCancel Submission variants to submission.rs
- Parse /status [id], /progress [id], /list, /cancel <id> as control commands
- Dispatch to existing handle_check_status/handle_list_jobs/handle_cancel_job
  handlers via new process_job_status/process_job_list/process_job_cancel methods
- Add 4 parser tests (34 total, all passing)

Web UI:
- Add slash command autocomplete: type / in chat input to see all 18 commands
  with descriptions; arrow-key navigation, Tab/Enter to select, Escape to close
- Remove chat input locking: drop textarea.disabled + sendBtn.disabled so users
  can always type and send (including /interrupt while agent is processing)
- Remove quick-action toolbar buttons (↩↪⏸⊖🗑📋) added in previous session
- Remove dead #chat-status bar (min-height 28px black bar always visible when empty)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: address PR review comments

- Remove Submission::JobList variant; parse /list directly as
  JobStatus { job_id: None } (simpler, eliminates redundant enum
  variant, match arm, is_control branch, and wrapper function)
- Cache autocomplete matches in _slashMatches to avoid re-filtering
  SLASH_COMMANDS on every keydown while autocomplete is open

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Pierre LE GUEN <26087574+PierreLeGuen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: experienced 6-19 merged PRs risk: medium Business logic, config, or moderate-risk modules scope: agent Agent core (agent loop, router, scheduler) scope: channel/web Web gateway channel scope: dependencies Dependency updates size: L 200-499 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants