feat(cli): enhance TUI functionality and update CI test configurations
- Added support for a new `--tui` flag in the CLI to launch a chat-based TUI for ROM interaction. - Integrated a fallback mechanism for loading ROM files from specified directories. - Updated the ChatTUI to provide a more informative initial message and added a new option to display ROM info. - Refined the CI workflow to differentiate between stable and experimental test runs, improving test result organization. Benefits: - Improved user experience with the new TUI feature for ROM hacking. - Enhanced clarity in CI test results, facilitating better debugging and reporting.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/dom/table.hpp"
|
||||
#include "cli/tui/chat_tui.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
@@ -31,6 +32,21 @@ absl::Status ModernCLI::Run(int argc, char* argv[]) {
|
||||
args.push_back(argv[i]);
|
||||
}
|
||||
|
||||
// Handle --tui flag
|
||||
if (args[0] == "--tui") {
|
||||
Rom rom;
|
||||
// Attempt to load a ROM from the current directory or a well-known path
|
||||
auto rom_status = rom.LoadFromFile("zelda3.sfc");
|
||||
if (!rom_status.ok()) {
|
||||
// Try assets directory as a fallback
|
||||
rom_status = rom.LoadFromFile("assets/zelda3.sfc");
|
||||
}
|
||||
|
||||
tui::ChatTUI chat_tui(rom.is_loaded() ? &rom : nullptr);
|
||||
chat_tui.Run();
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
if (args[0] == "help") {
|
||||
if (args.size() > 1) {
|
||||
ShowCategoryHelp(args[1]);
|
||||
|
||||
@@ -76,7 +76,7 @@ ChatTUI::ChatTUI(Rom* rom_context) : rom_context_(rom_context) {
|
||||
"List dungeon entrances", "Show sprite palette summary",
|
||||
"Summarize overworld map", "Find unused rooms",
|
||||
"Explain ROM header", "Search dialogue for 'Master Sword'",
|
||||
"Suggest QA checklist", "Show TODO status",
|
||||
"Suggest QA checklist", "Show TODO status", "Show ROM info"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -218,7 +218,12 @@ void ChatTUI::Run() {
|
||||
|
||||
Element history_view;
|
||||
if (history.empty()) {
|
||||
history_view = vbox({text("No messages yet. Start chatting!") | dim}) | flex | center;
|
||||
history_view = vbox({
|
||||
text("yaze TUI") | bold | center,
|
||||
text("A conversational agent for ROM hacking") | center,
|
||||
separator(),
|
||||
text("No messages yet. Start chatting!") | dim
|
||||
}) | flex | center;
|
||||
} else {
|
||||
history_view = vbox(history_elements) | vscroll_indicator | frame | flex;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ UnifiedLayout::UnifiedLayout(Rom* rom_context)
|
||||
todo_provider_ = [] {
|
||||
return std::vector<std::string>{
|
||||
"[pending] Implement dungeon diff visualizer",
|
||||
"[pending] Integrate Claude-style context panes",
|
||||
"[pending] Integrate context panes",
|
||||
"[todo] Hook TODO manager into project manifests"
|
||||
};
|
||||
};
|
||||
@@ -247,7 +247,7 @@ Component UnifiedLayout::CreateChatPanel() {
|
||||
std::vector<Element> cards;
|
||||
cards.push_back(vbox({
|
||||
text("🤖 Overview") | bold,
|
||||
text("Claude-style assistant for ROM editing"),
|
||||
text("AI assistant for ROM editing"),
|
||||
text("Press 'f' for fullscreen chat") | dim
|
||||
}) | borderRounded);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user