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

Dev #18

Merged
merged 31 commits into from
Mar 1, 2024
Merged

Dev #18

merged 31 commits into from
Mar 1, 2024

Conversation

MohammadBnei
Copy link
Owner

No description provided.

MohammadBnei and others added 30 commits February 6, 2024 01:20
…ting a new config file if it doesn't exist

feat(ui/message/message.go): truncate long message content in list item title to improve readability
The errMsg type was defined but not used anywhere in the code. Removing it to improve code cleanliness.

feat(chat): add loading state to chatModel

Added a new boolean field `loading` to the `chatModel` struct to keep track of whether the chat is in a loading state or not. This will be used to change the background color of the title based on the loading state.

fix(chat): fix transition behavior in Update function

Fixed the transition behavior in the `Update` function of the `chatModel`. Previously, the `transition` flag was being set to `false` unconditionally, which caused incorrect behavior. Removed the unnecessary code.

fix(chat): fix promptSend function

Fixed the `promptSend` function in the `chatUpdate.go` file. The error handling code was commented out, which caused the error to be ignored. Uncommented the error handling code to properly handle errors.

feat(style): add loading and normal background colors

Added two new constants `LoadingBackgroundColor` and `NormalBackgroundColor` to the `style` package. These colors will be used to set the background color of the title based on the loading state in the `chatModel`.
fix(chat): send error to chatProgram when there is an error sending prompt
…e consistent ordering

The `getItemsAsUiList` function in the `config.go` file has been modified to sort the `items` slice before returning it. This change was made to ensure that the items are always in a consistent order, regardless of the order in which they were originally added. By sorting the items based on their `ItemId` field, we can guarantee a predictable ordering when displaying the items in the UI.
… CloseContextById method

fix(config.go): change error message formatting to use fmt.Errorf for consistency
feat(config.go): add String method to ContextHold struct for better string representation
fix(chatUpdate.go): refactor closeContext function to use error directly in if statement
fix(keys.go): add logic to add and delete context in keyMapUpdate function when using textToSpeech key
… semantics

fix(cmd): bind --auto-load flag to viper key "autoSave" instead of "auto-save"
fix(root): change default value of "auto-load" to false instead of true
feat(chat): add check for "auto-load" flag in initialChatModel and load last chat if flag is true
…al behavior

fix(keys.go): remove unnecessary condition for "ctrl+c" key in keyMapUpdate function
feat(filepicker.go): add title to the file picker UI to improve user experience
feat(filepicker.go): display the number of selected files in the title to provide feedback to the user
…e cleanliness and readability

fix(chat.go): fix logic in Update function to correctly display intro content when necessary
feat(chat.go): add Intro function to display initial information in the chat UI
…g is set to true

In the `initialChatModel` function, if the `auto-load` flag is set to true in the configuration file, the `LoadLastChat` function is called to load the last chat.

fix(chat): update the `Init` function to set the window title to "Go AI cli"

In the `Init` function of the `chatModel` struct, the window title is set to "Go AI cli" using the `tea.SetWindowTitle` function.

fix(chat): update the `Update` function to handle window size changes

In the `Update` function of the `chatModel` struct, the `tea.WindowSizeMsg` message is handled to update the size of the viewport and the Markdown renderer based on the new window size.

fix(chat): update the `promptSend` function to send prompts asynchronously

In the `promptSend` function of the `chatModel` struct, the prompts are sent asynchronously using goroutines to improve performance.

fix(chat): update the `sendPrompt` function signature to match the struct field type

In the `sendPrompt` function of the `chatModel` struct, the signature is updated to match the type of the `currentChatIndices` field.

feat(file): add support for changing the current working directory with a key binding

In the `keyMap` struct of the `keys.go` file, a new key binding is added to change the current working directory when the "ctrl+r" key combination is pressed.
…ted frame size

feat(chat.go): add support for clearing chat content when Ctrl+W is pressed
…wn renderer

fix(chat.go): handle nil chat message when updating user prompt or AI response to prevent errors
… player position

feat(player.go): add support for displaying help and viewport in the audio player view
feat(player.go): update viewport width and height based on window size
feat(player.go): add tick message to update the viewport content and handle audio player position
feat(player.go): add key bindings for back and forward to navigate audio player position
feat(player.go): update audio player view to display title, viewport, and help
feat(player.go): add StartPlayingEvent and Tick types for audio player model updates
fix(keys.go): update key binding for deleting context to transition to empty state
… are no chat messages in the stack to prevent copying empty content
…ing speaker to prevent potential nil pointer error

fix(chat.go): add condition to check if textarea value is not empty before adding it to history to prevent adding empty messages to history
…sion

fix(play.go): add build constraint for portaudio to enable the file in the build process
feat(play_np.go): add file for handling audio functions when portaudio is not present
fix(play_test.go): add build constraint for portaudio to enable the file in the build process
fix(speech.go): remove build constraint for portaudio as it is not needed
fix(config.go): remove unused 'md' flag from config command
fix(go.mod): update go version to 1.22 and toolchain version to go1.22.0
fix(go.sum): update portaudio version to v0.0.0-20221027163845-7c3b689db3cc
feat(player_np.go): add file for handling audio player functions when portaudio is not present
fix(chat.go): add nil checks for currentChatMessages.user and currentChatMessages.assistant before updating userPrompt and aiResponse respectively
… readability and maintainability

feat(prompt.go): add support for automatically loading the prompt from $CONFIG/last-chat.yml file if the 'auto-load' flag is set to true
… to "goreleaser" for clarity and consistency

chore(client-release.yml): add write permission to contents for the workflow to be able to write to the repository
chore(client-release.yml): update workflow steps to use the latest versions of actions/checkout, actions/setup-go, and goreleaser/goreleaser-action
chore(helper.go): reorganize import statements to group standard library imports separately from third-party imports
chore(helper.go): remove unused imports and sort the remaining imports alphabetically
chore(helper.go): update import paths to match the new project structure
@MohammadBnei MohammadBnei merged commit cedcfb1 into main Mar 1, 2024
0 of 2 checks passed
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