core-agent-ide/codex-rs/tui/src/bottom_pane
Priyadarshini Tamilselvan 523dabc1ee
fix: custom prompt expansion with large pastes (#7154)
### **Summary of Changes**

**What?**
Fix for slash commands (e.g., /prompts:code-review) not being recognized
when large content (>3000 chars) is pasted.
[Bug Report](https://github.com/openai/codex/issues/7047)
**Why?**
With large pastes, slash commands were ignored, so custom prompts
weren't expanded and were submitted as literal text.

**How?**
Refactored the early return block in handle_key_event_without_popup
(lines 957-968).
Instead of returning early after replacing placeholders, the code now
replaces placeholders in the textarea and continues to the normal
submission flow.
This reuses the existing slash command detection and custom prompt
expansion logic (lines 981-1047), avoiding duplication.

**Changes:**
Modified codex-rs/tui/src/bottom_pane/chat_composer.rs: refactored early
return block to continue to normal flow instead of returning immediately
Added test: custom_prompt_with_large_paste_expands_correctly to verify
the fix

**Code Quality:**
No lint warnings
Code follows existing patterns and reuses existing logic
Atomic change focused on the bug fix
2025-11-24 12:18:32 -08:00
..
snapshots fix model picker wrapping (#6589) 2025-11-13 08:09:13 -08:00
approval_overlay.rs support MCP elicitations (#6947) 2025-11-21 14:44:53 -08:00
bottom_pane_view.rs tui: refactor ChatWidget and BottomPane to use Renderables (#5565) 2025-11-05 09:50:40 -08:00
chat_composer.rs fix: custom prompt expansion with large pastes (#7154) 2025-11-24 12:18:32 -08:00
chat_composer_history.rs tui: ^C in prompt area resets history navigation cursor (#5078) 2025-10-15 13:57:44 -07:00
command_popup.rs fix: improve custom prompt documentation and actually use prompt descriptions (#5332) 2025-10-18 15:58:31 -07:00
custom_prompt_view.rs tui: refactor ChatWidget and BottomPane to use Renderables (#5565) 2025-11-05 09:50:40 -08:00
feedback_view.rs [feedback] Add source info into feedback metadata. (#7140) 2025-11-24 19:05:37 +00:00
file_search_popup.rs tui: tweaks to dialog display (#4622) 2025-10-02 21:41:29 +00:00
footer.rs Auto compact at ~90% (#5292) 2025-10-20 11:29:49 -07:00
list_selection_view.rs feat(tui): default reasoning selection to medium (#7040) 2025-11-20 17:06:04 -08:00
mod.rs Added feature switch to disable animations in TUI (#6870) 2025-11-20 10:40:08 -08:00
paste_burst.rs fix image drag drop (#5794) 2025-10-27 17:11:30 -07:00
popup_consts.rs normalize key hints (#4586) 2025-10-02 18:34:47 +00:00
prompt_args.rs Named args for custom prompts (#4474) 2025-09-30 10:06:41 -07:00
queued_user_messages.rs tui: show queued messages during response stream (#5540) 2025-10-28 16:59:19 +00:00
scroll_state.rs Scrollable slash commands (#1830) 2025-08-06 21:23:09 -07:00
selection_popup_common.rs feat(tui): Display keyboard shortcuts inline for approval options (#5889) 2025-11-08 09:08:42 -08:00
textarea.rs Fix TUI issues with Alt-Gr on Windows (#6799) 2025-11-17 15:18:16 -08:00