yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
unified_layout.cc
Go to the documentation of this file.
2
3#include <ftxui/component/component.hpp>
4#include <ftxui/component/screen_interactive.hpp>
5#include <ftxui/dom/elements.hpp>
6#include <ftxui/screen/terminal.hpp>
7#include <numeric>
8#include <utility>
9
10#include "absl/strings/str_format.h"
12#include "cli/z3ed_ascii_logo.h"
13
14namespace yaze {
15namespace cli {
16
17using namespace ftxui;
18
20 : screen_(ScreenInteractive::TerminalOutput()),
21 rom_context_(rom_context) {
22 // Initialize chat TUI
23 chat_tui_ = std::make_unique<tui::ChatTUI>(rom_context_);
24
25 // Set default configuration
27
28 // Initialize state
30 if (rom_context_) {
32 }
33
35 "ROM Audit",
36 "Dungeon QA",
37 "Palette Polish"
38 };
39
41
42 status_provider_ = [this] {
43 auto rom_loaded = rom_context_ && rom_context_->is_loaded();
44 return vbox({
45 text(rom_loaded ? "✅ Ready" : "⚠ Awaiting ROM") |
46 color(rom_loaded ? Color::GreenLight : Color::YellowLight),
47 text(absl::StrFormat("Focus: %s",
49 "Main Menu" : state_.command_palette_hint)) |
50 dim
51 });
52 };
53
55 return std::vector<std::string>{
56 "agent::chat — conversational ROM inspector",
57 "rom::info — metadata & validation",
58 "dungeon::list — dungeon manifest",
59 "gfx::export — sprite/palette dump",
60 "project::build — apply patches"
61 };
62 };
63
64 todo_provider_ = [] {
65 return std::vector<std::string>{
66 "[pending] Implement dungeon diff visualizer",
67 "[pending] Integrate context panes",
68 "[todo] Hook TODO manager into project manifests"
69 };
70 };
71
72 // Create components
84
85 // Create layout
87
88 // Set up event handlers
89 global_event_handler_ = [this](const Event& event) {
90 return HandleGlobalEvents(event);
91 };
92
93 panel_event_handler_ = [this](const Event& event) {
94 return HandlePanelEvents(event);
95 };
96}
97
99 // Wrap the layout with event handling
100 auto event_handler = CatchEvent(unified_layout_, global_event_handler_);
101
102 screen_.Loop(event_handler);
103}
104
106 rom_context_ = rom_context;
107 if (chat_tui_) {
108 chat_tui_->SetRomContext(rom_context_);
109 }
110
111 if (rom_context_) {
113 } else {
114 state_.current_rom_file.clear();
115 }
116}
117
120 screen_.PostEvent(Event::Custom); // Force screen refresh
121}
122
125 screen_.PostEvent(Event::Custom); // Force screen refresh
126}
127
130 screen_.PostEvent(Event::Custom); // Force screen refresh
131}
132
135 screen_.PostEvent(Event::Custom); // Force screen refresh
136}
137
142 todo_overlay_component_ = Renderer([this] {
143 Elements rows;
144 if (todo_provider_) {
145 auto items = todo_provider_();
146 if (items.empty()) {
147 rows.push_back(text("No TODOs available") | dim | center);
148 } else {
149 for (const auto& line : items) {
150 rows.push_back(text(line));
151 }
152 }
153 }
154 return dbox({window(text("📝 TODO Overlay") | bold,
155 vbox({
156 separatorLight(),
157 vbox(rows) | frame | size(HEIGHT, LESS_THAN, 15) | size(WIDTH, LESS_THAN, 80),
158 separatorLight(),
159 text("Ctrl+T to close • Enter to jump via command palette") | dim | center
160 })) | center});
161 });
162 }
163 screen_.PostEvent(Event::Custom);
164 } else {
165 screen_.PostEvent(Event::Custom);
166 }
167}
168
170 config_ = config;
171}
172
173void UnifiedLayout::SetStatusProvider(std::function<Element()> provider) {
174 status_provider_ = std::move(provider);
175}
176
177void UnifiedLayout::SetCommandSummaryProvider(std::function<std::vector<std::string>()> provider) {
178 command_summary_provider_ = std::move(provider);
179}
180
181void UnifiedLayout::SetTodoProvider(std::function<std::vector<std::string>()> provider) {
182 todo_provider_ = std::move(provider);
183}
184
186 auto terminal = Terminal::Size();
187 if (terminal.dimx < 120) {
190 }
191}
192
194 struct MenuState {
195 int selected = 0;
196 std::vector<std::string> items = {
197 "🔍 Hex Viewer",
198 "🎨 Palette Editor",
199 "📝 TODO Manager",
200 "🔧 ROM Tools",
201 "🎮 Graphics Tools",
202 "⚙️ Settings",
203 "❓ Help",
204 "🚪 Exit"
205 };
206 };
207
208 auto state = std::make_shared<MenuState>();
209
210 MenuOption option;
211 option.focused_entry = &state->selected;
212 option.on_enter = [this, state] {
213 switch (state->selected) {
220 case 6: SwitchMainPanel(PanelType::kHelp); break;
221 case 7: screen_.Exit(); break;
222 }
223 };
224
225 auto menu = Menu(&state->items, &state->selected, option);
226
227 return Renderer(menu, [this, menu, state] {
228 auto banner = RenderAnimatedBanner();
229 return vbox({
230 banner,
231 separator(),
232 menu->Render(),
233 separator(),
235 separator(),
237 separator(),
238 text("↑/↓: Navigate | Enter: Select | q: Quit") | dim | center
239 }) | borderRounded | bgcolor(Color::Black);
240 });
241}
242
244 // Use the full-featured ChatTUI if available
245 if (chat_tui_) {
246 return Renderer([this] {
247 std::vector<Element> cards;
248 cards.push_back(vbox({
249 text("🤖 Overview") | bold,
250 text("AI assistant for ROM editing"),
251 text("Press 'f' for fullscreen chat") | dim
252 }) | borderRounded);
253
254 if (rom_context_) {
255 cards.push_back(vbox({
256 text("📦 ROM Context") | bold,
257 text(rom_context_->title()),
258 text(absl::StrFormat("Size: %d bytes", rom_context_->size())) | dim
259 }) | borderRounded | color(Color::GreenLight));
260 } else {
261 cards.push_back(vbox({
262 text("⚠ No ROM loaded") | color(Color::Yellow),
263 text("Use Load ROM from main menu") | dim
264 }) | borderRounded);
265 }
266
267 cards.push_back(vbox({
268 text("🛠 Integrations") | bold,
269 text("• TODO manager status") | dim,
270 text("• Command palette shortcuts") | dim,
271 text("• Tool dispatcher metrics") | dim
272 }) | borderRounded);
273
274 return vbox({
276 separator(),
278 separator(),
279 text("Shortcuts: f fullscreen | c toggle chat | /help commands") | dim | center
280 }) | borderRounded | bgcolor(Color::Black);
281 });
282 }
283
284 // Fallback simple chat interface
285 auto input_message = std::make_shared<std::string>();
286 auto input_component = Input(input_message.get(), "Type your message...");
287
288 auto send_button = Button("Send", [this, input_message] {
289 if (input_message->empty()) return;
290
291 // Handle chat commands
292 if (*input_message == "/exit") {
293 screen_.Exit();
294 return;
295 }
296
297 input_message->clear();
298 });
299
300 // Handle Enter key
301 input_component = CatchEvent(input_component, [this, input_message](const Event& event) {
302 if (event == Event::Return) {
303 if (input_message->empty()) return true;
304
305 if (*input_message == "/exit") {
306 screen_.Exit();
307 return true;
308 }
309
310 input_message->clear();
311 return true;
312 }
313 return false;
314 });
315
316 auto container = Container::Vertical({
317 input_component,
318 send_button
319 });
320
321 return Renderer(container, [this, container, input_component, send_button] {
322 return vbox({
323 text("🤖 AI Chat") | bold | center,
324 separator(),
325 text("Chat functionality integrated into unified layout") | center | dim,
326 separator(),
327 hbox({
328 text("You: ") | bold,
329 input_component->Render() | flex,
330 text(" "),
331 send_button->Render()
332 }),
333 separator(),
334 text("Commands: /exit, /clear, /help") | dim | center
335 });
336 });
337}
338
340 return Renderer([this] {
341 Element rom_info = rom_context_ ?
342 text(absl::StrFormat("ROM: %s", rom_context_->title())) | color(Color::GreenLight) :
343 text("ROM: none") | color(Color::RedLight);
344
345 Element provider_status = status_provider_ ? status_provider_() : text("Ready") | color(Color::GrayLight);
346 auto command_tiles = RenderCommandHints();
347 auto todo_tiles = RenderTodoStack();
348
349 std::vector<Element> sections = {
351 separatorLight(),
352 rom_info,
353 separatorLight(),
354 provider_status,
355 separatorLight(),
356 command_tiles,
357 separatorLight(),
358 todo_tiles
359 };
360
361 if (!state_.current_error.empty()) {
362 sections.push_back(separatorLight());
363 sections.push_back(text(state_.current_error) | color(Color::Red) | bold);
364 }
365
366 return vbox(sections) | borderRounded | bgcolor(Color::Black);
367 });
368}
369
371 struct ToolsState {
372 int selected = 0;
373 std::vector<std::string> items = {
374 "🔧 ROM Tools (press t)",
375 "🎨 Graphics Tools (ref gfx::export)",
376 "📝 TODO Manager (ref todo::list)",
377 "⚙️ Settings",
378 "❓ Help"
379 };
380 };
381
382 auto state = std::make_shared<ToolsState>();
383 MenuOption option;
384 option.on_change = [this, state] {
385 if (!state->items.empty()) {
386 state_.command_palette_hint = state->items[state->selected];
387 }
388 };
389 auto menu = Menu(&state->items, &state->selected, option);
390
391 return Renderer(menu, [this, menu, state] {
392 return vbox({
394 separator(),
395 menu->Render(),
396 separator(),
397 text("Select a tool category") | dim | center,
398 separator(),
400 separator(),
402 }) | borderRounded | bgcolor(Color::Black);
403 });
404}
405
407 auto offset = std::make_shared<int>(0);
408 const int lines_to_show = 20;
409
410 return Renderer([this, offset, lines_to_show] {
411 if (!rom_context_) {
412 return vbox({
413 text("🔍 Hex Viewer") | bold | center,
414 separator(),
415 text("No ROM loaded") | center | color(Color::Red),
416 separator(),
417 text("Load a ROM to view hex data") | center | dim
418 }) | border;
419 }
420
421 std::vector<Element> rows;
422 for (int i = 0; i < lines_to_show; ++i) {
423 int current_offset = *offset + (i * 16);
424 if (current_offset >= static_cast<int>(rom_context_->size())) {
425 break;
426 }
427
428 Elements row;
429 row.push_back(text(absl::StrFormat("0x%08X: ", current_offset)) | color(Color::Yellow));
430
431 for (int j = 0; j < 16; ++j) {
432 if (current_offset + j < static_cast<int>(rom_context_->size())) {
433 row.push_back(text(absl::StrFormat("%02X ", rom_context_->vector()[current_offset + j])));
434 } else {
435 row.push_back(text(" "));
436 }
437 }
438
439 row.push_back(separator());
440
441 for (int j = 0; j < 16; ++j) {
442 if (current_offset + j < static_cast<int>(rom_context_->size())) {
443 char c = rom_context_->vector()[current_offset + j];
444 row.push_back(text(std::isprint(c) ? std::string(1, c) : "."));
445 } else {
446 row.push_back(text(" "));
447 }
448 }
449
450 rows.push_back(hbox(row));
451 }
452
453 auto workflow = RenderWorkflowLane();
454
455 return vbox({
456 text("🔍 Hex Viewer") | bold | center,
457 separator(),
458 workflow,
459 separator(),
460 vbox(rows) | frame | flex,
461 separator(),
462 text(absl::StrFormat("Offset: 0x%08X", *offset)) | color(Color::Cyan),
463 separator(),
464 text("↑/↓: Scroll | q: Back") | dim | center
465 }) | borderRounded | bgcolor(Color::Black);
466 });
467}
468
470 return Renderer([this] {
471 return vbox({
473 separator(),
475 vbox({
476 text("🌈 Overview") | bold,
477 text("Preview palette indices and colors"),
478 text("Highlight sprite-specific palettes") | dim
479 }) | borderRounded | bgcolor(Color::Black),
480 vbox({
481 text("🧪 Roadmap") | bold,
482 text("• Live recolor with undo stack"),
483 text("• Sprite preview viewport"),
484 text("• Export to .pal/.act")
485 }) | borderRounded | bgcolor(Color::Black),
486 vbox({
487 text("🗒 TODO") | bold,
488 text("Link to command palette"),
489 text("Use animation timeline"),
490 text("Add palette history panel") | dim
491 }) | borderRounded | bgcolor(Color::Black)
492 }),
493 separator(),
495 separator(),
496 text("Press 'q' to go back") | dim | center
497 }) | borderRounded;
498 });
499}
500
502 return Renderer([this] {
503 std::vector<Element> todo_cards;
504 if (todo_provider_) {
505 for (const auto& item : todo_provider_()) {
506 todo_cards.push_back(text("• " + item));
507 }
508 }
509 if (todo_cards.empty()) {
510 todo_cards.push_back(text("No TODOs yet") | dim);
511 }
512
513 return vbox({
515 separator(),
516 vbox(todo_cards) | borderRounded | bgcolor(Color::Black),
517 separator(),
518 text("Press Ctrl+T anywhere to toggle the popup todo overlay.") | dim,
519 separator(),
521 separator(),
522 text("Press 'q' to go back") | dim | center
523 }) | borderRounded;
524 });
525}
526
528 struct ToolsState {
529 int selected = 0;
530 std::vector<std::string> items = {
531 "Apply Asar Patch — todo#123",
532 "Apply BPS Patch — todo#124",
533 "Extract Symbols — todo#098",
534 "Validate Assembly — todo#087",
535 "Generate Save File — todo#142",
536 "Back"
537 };
538 };
539
540 auto state = std::make_shared<ToolsState>();
541 auto menu = Menu(&state->items, &state->selected);
542
543 return Renderer(menu, [this, menu, state] {
544 return vbox({
545 text("🔧 ROM Tools") | bold | center,
546 separator(),
547 menu->Render(),
548 separator(),
549 text("Select a ROM tool") | dim | center
550 }) | border;
551 });
552}
553
555 struct ToolsState {
556 int selected = 0;
557 std::vector<std::string> items = {
558 "Palette Editor — ref gfx::export",
559 "Hex Viewer — ref rom::hex",
560 "Back"
561 };
562 };
563
564 auto state = std::make_shared<ToolsState>();
565 auto menu = Menu(&state->items, &state->selected);
566
567 return Renderer(menu, [this, menu, state] {
568 return vbox({
569 text("🎨 Graphics Tools") | bold | center,
570 separator(),
571 menu->Render(),
572 separator(),
573 text("Select a graphics tool") | dim | center
574 }) | border;
575 });
576}
577
579 struct SettingsState {
580 int left_width_slider;
581 int right_width_slider;
582 int bottom_height_slider;
583 };
584
585 auto state = std::make_shared<SettingsState>();
586 state->left_width_slider = config_.left_panel_width;
587 state->right_width_slider = config_.right_panel_width;
588 state->bottom_height_slider = config_.bottom_panel_height;
589
590 auto left_width_control = Slider("Left Panel Width: ", &state->left_width_slider, 20, 60, 1);
591 auto right_width_control = Slider("Right Panel Width: ", &state->right_width_slider, 30, 60, 1);
592 auto bottom_height_control = Slider("Bottom Panel Height: ", &state->bottom_height_slider, 10, 30, 1);
593
594 auto apply_button = Button("Apply Changes", [this, state] {
595 config_.left_panel_width = state->left_width_slider;
596 config_.right_panel_width = state->right_width_slider;
597 config_.bottom_panel_height = state->bottom_height_slider;
598 screen_.PostEvent(Event::Custom);
599 });
600
601 auto reset_button = Button("Reset to Defaults", [this, state] {
602 state->left_width_slider = 30;
603 state->right_width_slider = 40;
604 state->bottom_height_slider = 15;
608 screen_.PostEvent(Event::Custom);
609 });
610
611 auto controls = Container::Vertical({
612 left_width_control,
613 right_width_control,
614 bottom_height_control,
615 Container::Horizontal({
616 apply_button,
617 reset_button
618 })
619 });
620
621 return Renderer(controls, [this, controls, state, left_width_control, right_width_control,
622 bottom_height_control, apply_button, reset_button] {
623 return vbox({
624 RenderPanelHeader(PanelType::kSettings) | color(Color::Cyan),
625 separator(),
626 text("Customize the TUI layout") | center | dim,
627 separator(),
628 hbox({
629 text("Left Panel Width: ") | bold,
630 text(absl::StrFormat("%d", state->left_width_slider))
631 }),
632 left_width_control->Render(),
633 separator(),
634 hbox({
635 text("Right Panel Width: ") | bold,
636 text(absl::StrFormat("%d", state->right_width_slider))
637 }),
638 right_width_control->Render(),
639 separator(),
640 hbox({
641 text("Bottom Panel Height: ") | bold,
642 text(absl::StrFormat("%d", state->bottom_height_slider))
643 }),
644 bottom_height_control->Render(),
645 separator(),
646 hbox({
647 apply_button->Render(),
648 text(" "),
649 reset_button->Render()
650 }) | center,
651 separator(),
652 text("Panel Visibility:") | bold,
653 hbox({
654 text("Chat: ") | bold,
655 text(config_.show_chat ? "ON ✓" : "OFF ✗") |
656 color(config_.show_chat ? Color::Green : Color::Red),
657 text(" "),
658 text("Status: ") | bold,
659 text(config_.show_status ? "ON ✓" : "OFF ✗") |
660 color(config_.show_status ? Color::Green : Color::Red)
661 }) | center,
662 separator(),
663 text("Keyboard Shortcuts:") | bold,
664 text(" c - Toggle chat panel") | dim,
665 text(" s - Toggle status panel") | dim,
666 text(" Esc/b - Back to menu") | dim,
667 separator(),
668 text("Changes apply immediately") | center | dim
669 });
670 });
671}
672
674 return Renderer([this] {
675 return vbox({
676 RenderPanelHeader(PanelType::kHelp) | color(Color::Cyan),
677 separator(),
678 text("Unified TUI Layout - ROM Editor & AI Agent") | center | dim,
679 separator(),
680 text("Global Shortcuts:") | bold | color(Color::Yellow),
681 text(" q - Quit application"),
682 text(" h - Show this help"),
683 text(" m - Main menu"),
684 text(" Esc/b - Back to previous panel"),
685 separator(),
686 text("Panel Controls:") | bold | color(Color::Yellow),
687 text(" c - Toggle chat panel"),
688 text(" s - Toggle status panel"),
689 text(" f - Open full chat interface"),
690 text(" t - ROM tools"),
691 separator(),
692 text("Navigation:") | bold | color(Color::Yellow),
693 text(" ↑/↓ - Navigate menus"),
694 text(" Enter - Select item"),
695 text(" Tab - Switch focus"),
696 separator(),
697 text("Chat Commands:") | bold | color(Color::Yellow),
698 text(" /exit - Exit chat"),
699 text(" /clear - Clear history"),
700 text(" /help - Show chat help"),
701 separator(),
702 text("Available Tools:") | bold | color(Color::Green),
703 text(" • Hex Viewer - Inspect ROM data"),
704 text(" • Palette Editor - Edit color palettes"),
705 text(" • TODO Manager - Track tasks"),
706 text(" • AI Chat - Natural language ROM queries"),
707 text(" • Dungeon Tools - Room inspection & editing"),
708 text(" • Graphics Tools - Sprite & tile editing"),
709 separator(),
710 text("Press 'Esc' or 'b' to go back") | dim | center
711 });
712 });
713}
714
716 // Create a container that holds all panels
717 auto all_panels = Container::Tab({
729 }, nullptr);
730
731 // Create a renderer that dynamically shows the right panels based on state
732 return Renderer(all_panels, [this, all_panels] {
733 // Dynamically select left panel based on current state
734 Component left_panel;
735 switch (state_.active_main_panel) {
736 case PanelType::kMainMenu:
737 left_panel = main_menu_panel_;
738 break;
739 case PanelType::kHexViewer:
740 left_panel = hex_viewer_panel_;
741 break;
742 case PanelType::kPaletteEditor:
743 left_panel = palette_editor_panel_;
744 break;
745 case PanelType::kTodoManager:
746 left_panel = todo_manager_panel_;
747 break;
748 case PanelType::kRomTools:
749 left_panel = rom_tools_panel_;
750 break;
751 case PanelType::kGraphicsTools:
752 left_panel = graphics_tools_panel_;
753 break;
754 case PanelType::kSettings:
755 left_panel = settings_panel_;
756 break;
757 case PanelType::kHelp:
758 left_panel = help_panel_;
759 break;
760 default:
761 left_panel = main_menu_panel_;
762 break;
763 }
764
765 // Dynamically select right panel
766 Component right_panel;
767 if (config_.show_status) {
768 right_panel = status_panel_;
769 } else {
770 right_panel = tools_panel_;
771 }
772
773 // Create horizontal layout
774 auto top_section = hbox({
775 left_panel->Render() | flex,
776 separatorLight(),
777 right_panel->Render() | size(WIDTH, LESS_THAN, config_.right_panel_width)
778 });
779
780 // Add chat panel if enabled
781 if (config_.show_chat) {
782 Element stacked = vbox({
783 top_section | flex,
784 separatorLight(),
785 chat_panel_->Render() | size(HEIGHT, EQUAL, config_.bottom_panel_height)
786 }) | bgcolor(Color::Black);
787
789 stacked = dbox({stacked, todo_overlay_component_->Render()});
790 }
791 return stacked;
792 }
793
794 Element content = top_section | bgcolor(Color::Black);
796 content = dbox({content, todo_overlay_component_->Render()});
797 }
798 return content;
799 });
800}
801
802
803bool UnifiedLayout::HandleGlobalEvents(const Event& event) {
804 // Back to main menu
805 if (event == Event::Escape || event == Event::Character('b')) {
808 return true;
809 }
810 }
811
812 // Global shortcuts
813 if (event == Event::Special({20})) { // Ctrl+T
815 return true;
816 }
817
818 if (event == Event::Character('q') ||
819 (event == Event::Character('q') && state_.active_main_panel == PanelType::kMainMenu)) {
820 screen_.Exit();
821 return true;
822 }
823
824 if (event == Event::Character('h')) {
826 return true;
827 }
828
829 if (event == Event::Character('c')) {
830 ToggleChat();
831 return true;
832 }
833
834 if (event == Event::Character('s')) {
835 ToggleStatus();
836 return true;
837 }
838
839 if (event == Event::Character('t')) {
841 return true;
842 }
843
844 if (event == Event::Character('m')) {
846 return true;
847 }
848
849 if (event == Event::Character('f')) {
850 // Launch full chat interface
851 if (chat_tui_) {
852 screen_.ExitLoopClosure()(); // Exit current loop
853 chat_tui_->Run(); // Run full chat
854 screen_.PostEvent(Event::Custom); // Refresh when we return
855 }
856 return true;
857 }
858
859 return false;
860}
861
862bool UnifiedLayout::HandlePanelEvents(const Event& /* event */) {
863 // Panel-specific event handling
864 return false;
865}
866
868 std::string title;
869 switch (panel) {
871 title = "🎮 Main Menu";
872 break;
873 case PanelType::kChat:
874 title = "🤖 AI Chat";
875 break;
877 title = "📊 Status";
878 break;
880 title = "🛠️ Tools";
881 break;
883 title = "🔍 Hex Viewer";
884 break;
886 title = "🎨 Palette Editor";
887 break;
889 title = "📝 TODO Manager";
890 break;
892 title = "🔧 ROM Tools";
893 break;
895 title = "🎨 Graphics Tools";
896 break;
898 title = "⚙️ Settings";
899 break;
900 case PanelType::kHelp:
901 title = "❓ Help";
902 break;
903 }
904
905 return text(title) | bold | center;
906}
907
909 return hbox({
910 text(absl::StrFormat("Panel: %s",
911 state_.active_main_panel == PanelType::kMainMenu ? "Main" : "Other")) | color(Color::Cyan),
912 filler(),
913 text(absl::StrFormat("ROM: %s",
914 state_.current_rom_file.empty() ? "None" : state_.current_rom_file)) | color(Color::Green),
915 filler(),
916 text("Shortcuts: Ctrl+T TODO Overlay | f Full Chat | m Main Menu") | dim
917 });
918}
919
921 return text("🎮 Z3ED CLI") | bold | center;
922}
923
925 return text("Workflow: Active") | color(Color::Green);
926}
927
929 return vbox({
930 text("Command Hints:") | bold,
931 text(" Ctrl+T - Toggle TODO overlay"),
932 text(" f - Full chat mode"),
933 text(" m - Main menu")
934 });
935}
936
938 return text("TODO Stack: Empty") | dim;
939}
940
941Element UnifiedLayout::RenderResponsiveGrid(const std::vector<Element>& tiles) {
942 if (tiles.empty()) {
943 return text("No items") | center | dim;
944 }
945 return vbox(tiles);
946}
947
948} // namespace cli
949} // namespace yaze
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:71
auto vector() const
Definition rom.h:207
auto size() const
Definition rom.h:202
bool is_loaded() const
Definition rom.h:197
auto title() const
Definition rom.h:201
ftxui::Component unified_layout_
ftxui::Element RenderTodoStack()
ftxui::Component CreateToolsPanel()
ftxui::Component CreatePaletteEditorPanel()
ftxui::Component graphics_tools_panel_
void SwitchToolPanel(PanelType panel)
ftxui::Component CreateHelpPanel()
void SetStatusProvider(std::function< ftxui::Element()> provider)
ftxui::Component settings_panel_
void SetLayoutConfig(const LayoutConfig &config)
ftxui::Element RenderCommandHints()
UnifiedLayout(Rom *rom_context=nullptr)
std::function< ftxui::Element()> status_provider_
ftxui::Component rom_tools_panel_
ftxui::Component CreateRomToolsPanel()
ftxui::Element RenderStatusBar()
ftxui::Component hex_viewer_panel_
ftxui::Component CreateChatPanel()
ftxui::ScreenInteractive screen_
bool HandleGlobalEvents(const ftxui::Event &event)
std::unique_ptr< tui::ChatTUI > chat_tui_
ftxui::Element RenderPanelHeader(PanelType panel)
std::function< bool(const ftxui::Event &)> global_event_handler_
ftxui::Element RenderResponsiveGrid(const std::vector< ftxui::Element > &tiles)
void SwitchMainPanel(PanelType panel)
ftxui::Component status_panel_
ftxui::Component palette_editor_panel_
std::function< bool(const ftxui::Event &)> panel_event_handler_
ftxui::Component chat_panel_
ftxui::Component help_panel_
ftxui::Component main_menu_panel_
void SetTodoProvider(std::function< std::vector< std::string >()> provider)
void SetRomContext(Rom *rom_context)
ftxui::Component CreateHexViewerPanel()
std::function< std::vector< std::string >()> todo_provider_
ftxui::Component CreateSettingsPanel()
ftxui::Component todo_manager_panel_
ftxui::Component todo_overlay_component_
ftxui::Element RenderWorkflowLane()
ftxui::Component CreateStatusPanel()
ftxui::Component tools_panel_
void SetCommandSummaryProvider(std::function< std::vector< std::string >()> provider)
bool HandlePanelEvents(const ftxui::Event &event)
ftxui::Component CreateUnifiedLayout()
ftxui::Component CreateGraphicsToolsPanel()
ftxui::Component CreateTodoManagerPanel()
ftxui::Component CreateMainMenuPanel()
ftxui::Element RenderAnimatedBanner()
std::function< std::vector< std::string >()> command_summary_provider_
Definition cli.h:21
Main namespace for the application.
std::vector< std::string > active_workflows
std::string current_rom_file
std::string command_palette_hint