19 ImGui::PushID(
"Z3EDCmdPanel");
20 ImVec4 command_color = ImVec4(1.0f, 0.647f, 0.0f, 1.0f);
23 ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.14f, 0.12f, 0.18f, 0.95f));
24 ImGui::BeginChild(
"Z3ED_CommandsChild", ImVec2(0, 100),
true);
29 ImGui::SetNextItemWidth(-60);
30 ImGui::InputTextWithHint(
31 "##z3ed_cmd",
"Command...", state.command_input_buffer,
32 IM_ARRAYSIZE(state.command_input_buffer));
34 ImGui::BeginDisabled(state.command_running);
37 std::string command = state.command_input_buffer;
38 state.command_running =
true;
40 state.command_running =
false;
41 if (status.ok() && toast_manager) {
47 if (ImGui::IsItemHovered()) {
48 ImGui::SetTooltip(
"Run command");
56 const auto& proposals = *result;
57 state.command_output = absl::StrJoin(proposals,
"\n");
61 if (ImGui::IsItemHovered())
62 ImGui::SetTooltip(
"List");
68 state.command_output = *result;
71 if (ImGui::IsItemHovered())
72 ImGui::SetTooltip(
"Diff");
79 if (ImGui::IsItemHovered())
80 ImGui::SetTooltip(
"Accept");
87 if (ImGui::IsItemHovered())
88 ImGui::SetTooltip(
"Reject");
90 if (!state.command_output.empty()) {
93 "%s", state.command_output.substr(0, 100).c_str());
97 ImGui::PopStyleColor();
Unified context for agent UI components.
Z3EDCommandState & z3ed_command_state()