Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Refactors chat command handling to unify behavior between workspace chat and creation flow. Supports global commands like /providers in creation mode. Reduces LoC by consolidating utility functions.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent ammar-agent force-pushed the slash-commands-chat-flow-fix-pr branch 3 times, most recently from 2288a76 to 05d4802 Compare November 24, 2025 19:05
- Toast was only rendered for workspace variant, so slash command
  toasts (e.g., /providers help) were invisible in creation mode
- Now renders a single ChatInputToast that shows either:
  - Shared toast from slash commands (priority)
  - Creation-specific toast as fallback
- Command suggestions were already unified, this completes parity
The CommandSuggestions popup was being clipped by overflow:hidden on
parent containers in creation mode. In workspace mode, ChatInput is
positioned outside the overflow-hidden scroll container.

Solution: Pass anchorRef to CommandSuggestions when in creation mode.
When anchorRef is provided, the component uses createPortal to render
to document.body with fixed positioning relative to the anchor element.
This escapes the overflow:hidden containers and ensures suggestions are
visible in both variants.
@ammar-agent ammar-agent force-pushed the slash-commands-chat-flow-fix-pr branch from 111250a to 93c016b Compare November 24, 2025 20:15
@ammario ammario merged commit 75c93e7 into main Nov 24, 2025
13 checks passed
@ammario ammario deleted the slash-commands-chat-flow-fix-pr branch November 24, 2025 20:21
ethanndickson added a commit that referenced this pull request Dec 9, 2025
Fixes a regression introduced in #784 where slash commands were
accidentally removed from creation mode during the ORPC migration.

Supporting global commands like /providers in creation mode was
originally introduced in #704. This PR restores that functionality
with an improvement: workspace-only commands (clear, truncate,
compact, fork, new) are now filtered from suggestions in creation
mode rather than just showing an error toast when executed.

Changes:
- Restore CommandSuggestions in creation mode with portal rendering
- Filter workspace-only commands from suggestions based on variant
- Unify toast handling to show slash command feedback in both modes
- Extract WORKSPACE_ONLY_COMMANDS to shared constant to avoid duplication
github-merge-queue bot pushed a commit that referenced this pull request Dec 9, 2025
Fixes a regression introduced in #784
where slash commands were accidentally removed from creation mode during
the ORPC migration.

Supporting global commands like `/providers` in creation mode was
originally introduced in #704. This PR
restores that functionality with an improvement: workspace-only commands
(`clear`, `truncate`, `compact`, `fork`, `new`) are now filtered from
suggestions in creation mode rather than just showing an error toast
when executed.

## Changes

- Restore `CommandSuggestions` in creation mode with portal rendering
(to escape `overflow:hidden` containers)
- Filter workspace-only commands from suggestions based on variant
- Unify toast handling to show slash command feedback in both modes
- Extract `WORKSPACE_ONLY_COMMANDS` to shared constant to avoid
duplication between suggestion filtering and command execution

_Generated with `mux`_
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