feat: Enhance AgentChatWidget with Improved Message Handling and UI Updates

- Updated the AgentChatWidget to manage AI response states, including a new mechanism for handling pending messages and a thinking animation indicator.
- Improved the initialization of embedded labels for resource tools, ensuring labels are loaded only when necessary, enhancing performance and user experience.
- Refined the chat history synchronization process to ensure timely updates in the chat history popup.
- Enhanced the UI layout for better readability and interaction, including adjustments to button styles and spacing for a more polished appearance.
This commit is contained in:
scawful
2025-10-05 12:08:11 -04:00
parent 8b9f838054
commit a7c384a37d
4 changed files with 561 additions and 402 deletions

View File

@@ -112,14 +112,19 @@ absl::Status HandleResourceListCommand(
rom = &rom_storage;
}
// Initialize embedded labels if not already loaded
if (rom->resource_label() && !rom->resource_label()->labels_loaded_) {
core::YazeProject project;
auto labels_status = project.InitializeEmbeddedLabels();
if (labels_status.ok()) {
rom->resource_label()->labels_ = project.resource_labels;
rom->resource_label()->labels_loaded_ = true;
// Initialize embedded labels if needed
if (rom->resource_label()) {
if (!rom->resource_label()->labels_loaded_ || rom->resource_label()->labels_.empty()) {
core::YazeProject project;
project.use_embedded_labels = true;
auto labels_status = project.InitializeEmbeddedLabels();
if (labels_status.ok()) {
rom->resource_label()->labels_ = project.resource_labels;
rom->resource_label()->labels_loaded_ = true;
}
}
} else {
return absl::FailedPreconditionError("ROM has no resource label manager");
}
ResourceContextBuilder context_builder(rom);