regression: slash commands render logic#7882
Conversation
WalkthroughUpdates the slash-commands extension to track dropdown lifecycle with add/remove active dropbar calls, render the dropdown by appending directly to document.body, and ensure cleanup on exit by deregistering and destroying the component. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Editor
participant SlashCommands as SlashCommandsExtension
participant DropbarRegistry as ActiveDropbarRegistry
participant DOM as document.body
User->>Editor: Type "/" to trigger
Editor->>SlashCommands: initialize dropdown
SlashCommands->>DropbarRegistry: addActiveDropbarExtension(self)
SlashCommands->>DOM: append dropdown element (mount)
alt user selects or cancels
User->>SlashCommands: exit dropdown
SlashCommands->>DropbarRegistry: removeActiveDropbarExtension(self)
SlashCommands-->>DOM: destroy component (unmount)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a regression in the slash commands dropdown render logic by correcting the element attachment behavior and adding proper dropdown state tracking.
- Adds tracking of active dropdown state when slash commands are started and removed when exited
- Changes element attachment from editor element to document body for consistent positioning
- Updates onExit callback to accept editor parameter for proper cleanup
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
This PR fixes the render logic of the slash commands dropdown.
Type of Change
Summary by CodeRabbit