Skip to content

Conversation

@evgenoid
Copy link
Contributor

@evgenoid evgenoid commented Oct 3, 2025

Before need to release this one: reaviz/reablocks#310

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

No way to call some action in chat input

Issue Number: #9

What is the new behavior?

Improve the input to allow for slash commands

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Screen.Recording.2025-10-03.at.11.34.44.mov
Screen.Recording.2025-10-03.at.11.35.06.mov

@evgenoid evgenoid self-assigned this Oct 3, 2025
@netlify
Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for reachat-storybook ready!

Name Link
🔨 Latest commit 6b7ab34
🔍 Latest deploy log https://app.netlify.com/projects/reachat-storybook/deploys/68df8bf9d414ba00087cb3b8
😎 Deploy Preview https://deploy-preview-61--reachat-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@amcdnl amcdnl requested review from Copilot and steppy452 October 6, 2025 13:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an actions menu component that allows users to trigger slash commands (e.g., "/") in the chat input to display a menu with available actions and functions. The implementation provides both synchronous and asynchronous loading examples.

  • Added QuickActions component for triggering contextual menus in chat input
  • Enhanced ChatInput to support external input references for menu integration
  • Created Storybook examples demonstrating both static and async loading patterns

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
stories/Chat.stories.tsx Added ActionsMenu and ActionsMenuAsync story examples demonstrating slash command functionality
src/index.css Updated CSS import path for reablocks
src/QuickActions/index.ts Export file for QuickActions component
src/QuickActions/QuickActions.tsx Core QuickActions component implementation with keyboard trigger support
src/ChatInput/ChatInput.tsx Enhanced to support external input references for menu integration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

return (
<List className="bg-gray-800">
<ListItem value={`${name} 1`} onClick={() => onClick('1')}>{name} 1</ListItem>
<ListItem value={`${name} 2`} onClick={() => onClick('1')}>{name} 2</ListItem>
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The onClick handler passes '1' instead of '2' for the second list item. This should be onClick(() => onClick('2')) to match the item's intended value.

Suggested change
<ListItem value={`${name} 2`} onClick={() => onClick('1')}>{name} 2</ListItem>
<ListItem value={`${name} 2`} onClick={() => onClick('2')}>{name} 2</ListItem>

Copilot uses AI. Check for mistakes.
return () => {
inputEl.removeEventListener('keydown', handleKeyDown);
};
}, []);
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The dependency array is missing trigger and inputRef. Changes to these props won't update the event listener, potentially causing stale closures or incorrect behavior.

Suggested change
}, []);
}, [inputRef, trigger]);

Copilot uses AI. Check for mistakes.

interface ChatInputProps {
/**
* Reference to the input element.
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The JSDoc comment should clarify that this ref will be populated with the internal textarea element, allowing external components to access it.

Suggested change
* Reference to the input element.
* Ref that will be populated with the internal textarea element,
* allowing external components to access and interact with the textarea directly.

Copilot uses AI. Check for mistakes.
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.

1 participant