Commit Graph

29 Commits

Author SHA1 Message Date
Reinier van der Leer
e44ca4185a fix(frontend): Unbreak ChatInputField
Fix specification of `onSubmitted` hook in the `TextField`.
2024-02-21 02:09:23 +01:00
Ethan Presberg
6cfe229332 feat(frontend): Allow sending a message with the enter key (#6378)
This has not yet been tested due to an issue with compiling on WSL. This was the fix suggested by Pwuts.
2024-02-20 10:49:37 +01:00
hunteraraujo
9021d8392d feat: Add support for temporary chat message
- Added logic to display a temporary chat message while waiting for the response from the agent.
- When a user sends a message, a temporary chat message is created and displayed.
- Implemented a method to remove the temporary chat message when the response is received or in case of an error.
- Updated the UI to invoke the method for adding a temporary chat message when the send button is pressed.

Feedback:
- This change improves the user experience by allowing them to see their own message immediately while waiting for the response from the agent.
2023-10-31 19:39:56 -07:00
hunteraraujo
688ba62db7 feat: Add isWaitingForAgentResponse property to TaskViewModel
- Added a boolean property `isWaitingForAgentResponse` to the `TaskViewModel` class to track whether a task is being created and waiting for a response from the agent.
- When a task is being created, we set `isWaitingForAgentResponse` to `true` and notify the listeners.
- When the task creation process is completed (successfully or not), `isWaitingForAgentResponse` is set to `false` and listeners are notified.
- Updated the `ChatView` class to listen to changes in `TaskViewModel.isWaitingForAgentResponse` to show the loading indicator conditionally.
2023-10-31 16:59:36 -07:00
hunteraraujo
2f187a853e refactor: Refactor agent message tile rendering logic
- Updated the regular expression pattern to include matching fenced code blocks in addition to headers.
- Set the `dotAll` parameter to `true` to match across multiple lines in the regular expression.
- Wrapped the message container with a `SingleChildScrollView` widget to enable scrolling when the message content exceeds the available space.
- Implemented logic to conditionally render the message as markdown or selectable text based on the value of `hasMarkdown`.
- Modified the `MarkdownStyleSheet` to customize the appearance of blockquotes and code blocks.
- Updated the child widget of the message container to reflect the changes.
2023-10-31 16:33:45 -07:00
hunteraraujo
82434a248c Disable markdown as it causes crash for some responses 2023-10-20 08:07:27 -07:00
hunteraraujo
2187f66149 Show error toast for 5xx error 2023-10-20 00:20:46 -07:00
hunteraraujo
27ff99a9a5 Check for inline code blocks in agent step 2023-10-20 00:15:20 -07:00
hunteraraujo
9219bfba0e add Markdown detection and rendering
- Implement `containsMarkdown` function to identify messages with Markdown
- Utilize `flutter_markdown` package to render detected Markdown content
- Enhance chat UI to conditionally display plain text or formatted Markdown
2023-10-19 22:19:09 -07:00
hunteraraujo
dbec110bac Refactor ChatInputField to use SharedPreferencesService 2023-10-10 18:39:24 -07:00
hunteraraujo
c77ade5b2f Gate test suites from the task view based off isDeveloperModeEnabled flag 2023-10-09 11:30:58 -07:00
hunteraraujo
51ebe2407d Integrate TaskQueueViewModel throughout application 2023-10-08 22:34:52 -07:00
hunteraraujo
0f2126e6f0 Implement Artifact Class for Enhanced Data Handling (#5585) 2023-10-06 14:55:47 -07:00
hunteraraujo
cbdb6ac0bf Add _throwawayFocusNode to allow continuous mode to work after dialog 2023-09-29 00:22:00 -07:00
hunteraraujo
8c58df706a Show helpful toast if someone hits a 404 2023-09-28 23:43:02 -07:00
hunteraraujo
ab2a49c8d2 Show loading state when running benchmark or waiting for agent response 2023-09-28 13:09:26 -07:00
hunteraraujo
a438619177 Add LoadingIndicator for Async Operations
Implemented a new LoadingIndicator widget that displays a pulsating gradient line, giving users visual feedback during asynchronous operations such as API calls. The indicator animates a gradient from white to AppColors.primaryLight and back to the grey background color, signifying the loading state.
2023-09-28 12:54:13 -07:00
hunteraraujo
d2f64a1163 Fix bug where AgentMessageTile are being reused inappropriately 2023-09-27 23:01:06 -07:00
hunteraraujo
b04f4e0f55 Added Artifact Handling for Chat Messages
- Enhanced the `Chat` model to include an `artifacts` field to hold associated artifacts.
- Updated the `AgentMessageTile` widget to display the number of artifacts and added functionality to trigger artifact downloads upon button press.
- Introduced a method in `ChatViewModel` to leverage the `ChatService` for artifact downloads.
2023-09-27 22:37:06 -07:00
hunteraraujo
c739e049c3 Fixed bug where task list did not update when creating new task 2023-09-27 20:27:21 -07:00
hunteraraujo
389131f2ab Add ContinuousModeDialog and integrate with ChatInputField
- Introduced a new dialog, ContinuousModeDialog, to inform users about the repercussions of the continuous mode.
- Integrated ContinuousModeDialog with ChatInputField. The dialog is shown when the fast-forward icon is clicked, based on the user's shared preferences.
- Leveraged shared preferences to remember if the user has chosen not to see the dialog again.
- Enhanced the ChatInputField to handle different states and user interactions related to continuous mode.
2023-09-26 14:25:20 -07:00
hunteraraujo
ffa76c3a19 Integrated continuousModeSteps from SettingsViewModel into ChatViewModel
Refactored the ChatViewModel's sendChatMessage method to utilize the continuousModeSteps setting from the SettingsViewModel. This allows the continuous chat mode to honor the user's preference from the settings. Also introduced an optional currentStep parameter with a default value, enabling better control over the progression of continuous mode.
2023-09-24 17:15:36 -07:00
hunteraraujo
17f284a9ac Add auto-scroll behavior to chat message list
Implemented auto-scrolling in the chat message list to ensure that the view scrolls down to the most recent message when a new chat is added. This behavior only triggers if the user is already at the bottom of the list, providing a seamless user experience.
2023-09-06 15:05:26 -07:00
hunteraraujo
27e9868aa5 End continuous mode when clicking text field 2023-09-06 12:10:57 -07:00
hunteraraujo
2e62c517e2 Include tooltips for single message + continuous mode 2023-09-06 12:04:52 -07:00
hunteraraujo
4e499c5bac Deselect text field after user goes into continuous mode 2023-09-06 11:56:45 -07:00
hunteraraujo
d3b4b50a5c Update parameters for ChatInputField to support continuous mode 2023-09-06 11:46:43 -07:00
hunteraraujo
d80053e8dc Refactor ChatInputField to Support Continuous Mode
- Added a new boolean state `isContinuousMode` to the `ChatInputField` widget to handle the continuous mode feature.
- Introduced a new callback function `onContinuousModePressed` to manage the state of the continuous mode from an external source.
- Conditionally rendered the send button based on the `isContinuousMode` state.
- Enhanced the UI by adding a button to toggle between continuous mode and single message mode, which triggers the `onContinuousModePressed` callback.
2023-09-06 11:46:03 -07:00
hunteraraujo
ef2d64513b Merge commit 'e5d30a9f6d0854e20049309333c2f637cd03025c' as 'frontend' 2023-09-06 11:22:37 -07:00