Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coral-web: enabled data sources and tools in composer #208

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

wujessica
Copy link
Contributor

@wujessica wujessica commented Jun 13, 2024

Description:

Part 1 of moving composer usability changes to toolkit. This PR includes:

  • showing enabled data sources from the composer and ability to deselect
  • allowing file selection from the drawer
  • IconButton UI updates like adding a tooltip

Note: there are some drawer selection inconsistencies (e.g. I added the logic to deselect all files if you remove it from the composer) that will be addressed when I port over the drawer changes in the next PR.

Screen.Recording.2024-06-13.at.2.59.50.PM.mov

AI Description

This PR makes changes to the UI components of the Coral web interface, specifically related to file uploading, configuration, and conversation.

Files

  • Adds a handleToggle function to enable/disable the default file loader tool and update the list of file IDs.
  • Updates the Files component to include a Checkbox for each file, allowing users to select/deselect files.
  • Updates the UploadedFile component to include a checkbox and handle file selection.
  • Introduces the ComposerError component to display file upload errors.
  • Modifies the ComposerFiles component to use the MessageFile component for displaying files.
  • Adds the DragDropFileUploadOverlay component to handle drag and drop file uploads.
  • Creates the ComposerToolbar component to manage file uploads and data sources.
  • Implements the EnabledDataSources component to render enabled data sources in the composer toolbar.
  • Updates the Conversation component to include the ComposerToolbar and ComposerError components.
  • Removes the isDragDropInputActive state and related drag and drop event handlers from the Conversation component.
  • Updates the Conversation component to use the chatWindowRef for dynamic textarea height adjustment.

Configuration

  • Updates the ConfigurationDrawer component to include a tooltip label for the close drawer icon button.

Conversation

  • Updates the Composer component to include the ComposerError and ComposerToolbar components.
  • Removes the ComposerMenu component and replaces it with the ComposerToolbar component.
  • Adds the DragDropFileUploadOverlay component to handle drag and drop file uploads.
  • Updates the handleKeyDown function to prevent sending messages when composing is in progress.
  • Introduces the handleCompositionStart and handleCompositionEnd functions to manage composition events and update the textarea value.
  • Updates the ComposerFiles component to filter out files with errors and display them separately.
  • Removes the useFileActions hook and related file actions.
  • Updates the Conversation component to use the chatWindowRef for dynamic height adjustment.

Other Changes

  • Updates the IconButton component to include a tooltip label prop and render the tooltip using the Tooltip component.
  • Updates the MessageContent component to use the MessageFile component for displaying files.
  • Adds a new tooltip class to the tailwind configuration.

Copy link
Contributor

@misspia-cohere misspia-cohere left a comment

Choose a reason for hiding this comment

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

works as advertised ✅

question: how come disabling search_file from underneath the composer disables the file but doesn't do the same when disabled from the right side panel?

@wujessica
Copy link
Contributor Author

works as advertised ✅

question: how come disabling search_file from underneath the composer disables the file but doesn't do the same when disabled from the right side panel?

Yea I mentioned it in the description but I wanted to keep the changes a bit more contained, will address when I port over the drawer changes!

@wujessica wujessica merged commit 33d63b8 into main Jun 18, 2024
3 checks passed
@wujessica wujessica deleted the jw/new-composer-changes-pt-1 branch June 18, 2024 14:34
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