31 Commits

Author SHA1 Message Date
Rankin Zheng
2738a5b602 Update components to use chat panel width from store
- Extract chat panel width state into Chat store
- Remove width prop drilling from parent components
- Use chat panel width via hook instead of props
- Pass className prop to MessageMarkdown for width styling
- Extend MessageMarkdown props to allow className
- Update MessageBody to get width styles
2023-09-14 15:03:37 +08:00
Rankin Zheng
2e543eeeca Add hover styles to InputMessage component
- Add hover styles to change color, border color, and background color on hover.
2023-09-13 20:47:22 +08:00
Rankin Zheng
bc5b222ae7 Update InputMessage component
- Adjust the styling of the rightSection in the InputMessage component
- Remove duplicate Indicator and ActionIcon for the context menus
- Add marginLeft to the send button for proper spacing
- Update the styling of the context menu dropdown
- Remove duplicate padding style for menu items
- Add menuStyles object to define the styles for the context menu
- Add buttonStyles object to define the styles for the model selection button
- Apply buttonStyles to the model selection button in the InputMessage component
2023-09-13 20:47:22 +08:00
Rankin Zheng
cf56658ab6 Change button colors 2023-09-13 20:47:22 +08:00
Rankin Zheng
e540c63ad8 Update InputMessage component
- Add buttonStyles object to define the styles for the model selection button
- Apply buttonStyles to the model selection button in the InputMessage component
2023-09-13 20:47:22 +08:00
Rankin Zheng
251e40fd4b Refactor InputMessage component
- Update the styling of the context menu dropdown
- Remove duplicate padding style for menu items
- Add menuStyles object to define the styles for the context menu
2023-09-13 20:47:22 +08:00
Rankin Zheng
778ba44124 Refactor InputMessage component
- Adjust the styling of the rightSection in the InputMessage component
- Remove duplicate Indicator and ActionIcon for the context menus
- Add marginLeft to the send button for proper spacing
2023-09-13 20:47:22 +08:00
Rankin Zheng
b5a0cb60f9 Update InputMessage component and ChatStore
- Update InputMessage component to include modelMenus in the input object
- Add fetchModelMenus action to InputStore to fetch model menus
- Update ChatStore to set the default chatModel to 'GPT-3.5'
2023-09-13 20:47:22 +08:00
Rankin Zheng
daaef43d73 Add missing Mantine components and remove unused code
- Import Chip, Group, Button, UnstyledButton, and Menu components from Mantine/core.
- Import IconDatabase, IconTextPlus, and IconRobot from @tabler/icons-react.
- Remove handlePlusClick function and its usage.
- Remove contextMenusNode and its usage.
- Remove unused onClose and onOpen props from Popover component.
- Update placeholder text in Textarea component.
- Adjust styling and layout of components.
- Add changeModel function to handle chat model selection.
- Update return statement to use Stack and Group components for layout.
- Update ActionIcon and Button components with new props and styling.
- Remove unused code and dependencies.
2023-09-13 20:47:22 +08:00
Rankin Zheng
50462e38ef Add '/help' command handling in chat input
- Modified the handleSendClick function in InputMessage/index.tsx to handle '/help' command.
- If the user types '/help', a help message is displayed and the input field is cleared.
- If the input is not '/help', the existing functionality of sending and displaying the user's message is executed.
2023-09-01 14:39:58 +08:00
Rankin Zheng
348823f871 Update InputMessage component width
- Adjusted the width of the Stack component within the InputMessage component to "calc(100% - 60px)" to ensure proper spacing.
2023-09-01 10:45:39 +08:00
Rankin Zheng
70887c471d
Merge pull request #274 from devchat-ai/update-ui-text
Refine context command descriptions
2023-08-30 21:18:54 -05:00
bobo.yang
63fbb1289d Add InstallCommands functionality to DevChat
- Added a new command "InstallCommands" to the package.json file.
- Created a new function "registerInstallCommandsCommand" in commands.ts to handle the execution of the new command.
- The function checks for a directory in the user's home directory, if it exists it performs a git pull, if not it clones a git repository.
- The function is registered in the extension.ts file.
- Added a function "sendCommandListByDevChatRun" in regCommandList.ts to send the command list.
- The new command is executed in the statusBarView.ts file.
- Updated the InputMessage component to register a handler for the 'regCommandList' message.
- Updated the InputStore to handle the new commands and removed the old "regCommandMenus" function.
2023-08-30 16:39:47 +08:00
Rankin Zheng
b6be3c0817 Update InputMessage component with new icon and closeButtonProps
- Imported IconChevronDown from "@tabler/icons-react".
- Added closeButtonProps to the Popover component with IconChevronDown as children.
2023-08-30 11:39:13 +08:00
Rankin Zheng
12979c50e6 Remove commandMenuIcon function and update UI
- Removed the commandMenuIcon function from InputMessage component.
- Updated the UI by removing the commandMenuIcon from the menu items.
- Added padding to the left of the menu items for better alignment.
2023-08-30 11:02:55 +08:00
Jinglei Ren
91d2fd8549 Refine context command descriptions 2023-08-29 23:20:10 +08:00
Rankin Zheng
19b4616db4 Add ScrollArea to context and command menus in InputMessage component
- Wrapped the contextMenusNode and commandMenusNode with ScrollArea.Autosize for better UX.
- Set the maximum height of the ScrollArea to 240 and scroll type to 'always'.
- This change ensures that the menus are scrollable and do not exceed a certain height.
2023-08-25 13:19:05 +08:00
Rankin Zheng
271f4eb55d Fix conditional rendering of Indicator in InputMessage component
- Corrected the placement of the closing brace for the conditional rendering of the Indicator component in the InputMessage component.
2023-08-25 11:35:20 +08:00
Rankin Zheng
824e9ae120 Enhance UI and UX of InputMessage and ChatPanel components
- Refactored InputContexts component to use Drawer for better UX.
- Added an Indicator to show the number of contexts in the InputMessage component.
- Added an ActionIcon to open the Drawer containing the contexts.
- Removed unused imports from InputMessage and ChatPanel components.
- Adjusted the zIndex of the 'scroll to bottom' ActionIcon in ChatPanel.
- Simplified the Accordion.Panel in InputContexts by removing unnecessary ScrollArea.
- Adjusted the styling of the pre tag in InputContexts for better readability.
2023-08-25 11:26:24 +08:00
Rankin Zheng
28f1e186bd Clear input field and scroll to bottom after sending message
- Imported 'useTimeout' hook from '@mantine/hooks' in InputMessage/index.tsx.
- Added a setTimeout function in the handleSendMessage function in InputMessage/index.tsx to scroll to the bottom after clearing the input field.
2023-08-24 11:21:05 +08:00
Rankin Zheng
7830a6d421 Refactor code to improve readability and functionality
- Renamed 'width' prop to 'chatPanelWidth' in InputMessage component for clarity.
- Passed 'chatPanelWidth' prop to MessageList component to set its width.
- Added condition to wrap long lines in 'markdown' or 'text' language blocks in MessageMarkdown component.
- Applied 'breakStyles' to inline code blocks in MessageMarkdown component.
- Passed 'chatPanelWidth' to InputMessage component in ChatPanel page.
2023-08-23 21:30:23 +08:00
Rankin Zheng
8b43283566 Add 'help' command to DevChat
- Added a new 'help' command to the command menu in InputStore.ts.
- Modified the behavior of the 'Enter' and 'Tab' keys in InputMessage/index.tsx to display a help message when the 'help' command is selected.
- Refactored ChatStore.ts to include a new 'helpMessage' function that displays a help message.
- Removed redundant code in ChatStore.ts and reorganized the remaining code for better readability.
2023-08-23 19:53:55 +08:00
Rankin Zheng
63694c7306 Add 'path' property to ChatContext model and update components
- Added 'path' property to ChatContext model in InputStore.ts.
- Updated InputMessage and MessageContainer components to use 'path' instead of 'file' for display.
- Updated ChatStore to include 'path' in the context object.
2023-08-18 16:28:43 +08:00
Rankin Zheng
14bb7ba17b Refactor InputMessage component and ChatStore
- Imported the Message model from ChatStore in InputMessage/index.tsx.
- Updated the handleSendClick function to create a new Message object before calling the newMessage action.
- Updated the startGenerating action in ChatStore.ts to accept an array of chat contexts.
- Updated the map function in the loadHistory action to directly use the context field of each item.
2023-08-18 13:00:54 +08:00
Rankin Zheng
6290436bb7 Refactor InputMessage component and InputStore
- Imported the ChatContext model from InputStore in InputMessage/index.tsx.
- Updated the handleSendClick function to create a new ChatContext object before calling the newContext action.
- Updated the newContext action in InputStore.ts to accept an IChatContext object.
2023-08-18 12:21:19 +08:00
Rankin Zheng
1fe45ef5e0 Refactor InputMessage component and ChatStore
- Simplified the handleSendClick function in InputMessage/index.tsx to directly use input.value.
- Made 'contexts' an optional field in the Message model in ChatStore.ts.
- Updated the newMessage and updateLastMessage actions in ChatStore.ts to accept an IMessage object.
2023-08-18 11:48:19 +08:00
Rankin Zheng
b99ab0262a Refactor InputContexts component and related files
- Imported ChatContext from InputStore in InputContexts.tsx.
- Refactored the map function in InputContexts to destructure the context object.
- Updated the display text in the Accordion.Control component to use destructured values.
- Replaced 'context.content' with 'content' in the Accordion.Panel component.
- In InputMessage/index.tsx, updated the newContext method call to use 'context.content'.
- Added 'command' as an optional string to the ChatContext model in InputStore.ts.
2023-08-18 08:47:09 +08:00
Rankin Zheng
5bbe9963b8 Refactor InputMessage and InputContexts components to use MobX
- Replaced Redux hooks with MobX hooks in InputMessage and InputContexts components.
- Removed Redux actions and replaced them with equivalent MobX actions.
- Updated event handlers and useEffect hooks to use MobX actions instead of Redux actions.
- Replaced Redux selectors with equivalent MobX observables.
2023-08-18 00:23:18 +08:00
Rankin Zheng
0bcc339447 Move Icons and avatar images to appropriate folders
- Moved Icons.tsx from views to components/ChatIcons folder.
- Updated import path for Icons in InputMessage/index.tsx.
- Moved avatar_devchat.svg, avatar_spaceman.png, and avatar_user.svg from views to components/MessageHeader folder.
- Updated import paths for avatar images in MessageHeader/index.tsx.
2023-08-03 17:01:12 +08:00
Rankin Zheng
cec95185b3 Move chatSlice and inputSlice to reducers folder
- Moved chatSlice and inputSlice from views to reducers folder.
- Updated import paths for chatSlice and inputSlice in various files.
- Adjusted import paths for chatSlice and inputSlice in store.ts.
2023-08-03 16:49:30 +08:00
Rankin Zheng
b900fe0b8b Move InputMessage and related files to components folder
- Moved InputMessage and InputContexts from views to components folder.
- Updated import paths for InputMessage in ChatPanel.tsx.
- Adjusted import paths for inputSlice and chatSlice in InputMessage and InputContexts.
- Improved code formatting in InputMessage.tsx.
2023-08-03 16:47:26 +08:00