ImGui drawer for displaying and managing agent proposals. More...
#include <proposal_drawer.h>
Public Member Functions | |
ProposalDrawer () | |
~ProposalDrawer ()=default | |
void | SetRom (Rom *rom) |
void | Draw () |
void | Show () |
void | Hide () |
void | Toggle () |
bool | IsVisible () const |
void | FocusProposal (const std::string &proposal_id) |
Private Types | |
enum class | StatusFilter { kAll , kPending , kAccepted , kRejected } |
Private Member Functions | |
void | DrawProposalList () |
void | DrawProposalDetail () |
void | DrawPolicyStatus () |
void | DrawStatusFilter () |
void | DrawActionButtons () |
absl::Status | AcceptProposal (const std::string &proposal_id) |
absl::Status | RejectProposal (const std::string &proposal_id) |
absl::Status | DeleteProposal (const std::string &proposal_id) |
void | RefreshProposals () |
void | SelectProposal (const std::string &proposal_id) |
Private Attributes | |
bool | visible_ = false |
bool | needs_refresh_ = true |
StatusFilter | status_filter_ = StatusFilter::kAll |
std::vector< cli::ProposalRegistry::ProposalMetadata > | proposals_ |
std::string | selected_proposal_id_ |
cli::ProposalRegistry::ProposalMetadata * | selected_proposal_ = nullptr |
std::string | diff_content_ |
std::string | log_content_ |
int | log_display_lines_ = 50 |
float | drawer_width_ = 400.0f |
bool | show_confirm_dialog_ = false |
bool | show_override_dialog_ = false |
std::string | confirm_action_ |
std::string | confirm_proposal_id_ |
Rom * | rom_ = nullptr |
ImGui drawer for displaying and managing agent proposals.
Provides a UI for reviewing agent-generated ROM modification proposals, including:
Integrates with the CLI ProposalRegistry service to enable human-in-the-loop review of agentic modifications.
Definition at line 31 of file proposal_drawer.h.
|
strongprivate |
Enumerator | |
---|---|
kAll | |
kPending | |
kAccepted | |
kRejected |
Definition at line 67 of file proposal_drawer.h.
yaze::editor::ProposalDrawer::ProposalDrawer | ( | ) |
Definition at line 21 of file proposal_drawer.cc.
References RefreshProposals().
|
default |
|
inline |
Definition at line 37 of file proposal_drawer.h.
References rom_.
Referenced by yaze::editor::EditorManager::DrawMenuBar().
void yaze::editor::ProposalDrawer::Draw | ( | ) |
Definition at line 25 of file proposal_drawer.cc.
References AcceptProposal(), confirm_action_, confirm_proposal_id_, DeleteProposal(), drawer_width_, DrawProposalDetail(), DrawProposalList(), DrawStatusFilter(), ICON_MD_REFRESH, ICON_MD_WARNING, needs_refresh_, RefreshProposals(), RejectProposal(), selected_proposal_, selected_proposal_id_, SelectProposal(), show_confirm_dialog_, show_override_dialog_, and visible_.
Referenced by yaze::editor::EditorManager::DrawMenuBar(), and yaze::editor::EditorManager::Update().
|
inline |
Definition at line 43 of file proposal_drawer.h.
References visible_.
Referenced by yaze::editor::EditorManager::Initialize().
|
inline |
Definition at line 44 of file proposal_drawer.h.
References visible_.
|
inline |
Definition at line 45 of file proposal_drawer.h.
References visible_.
Referenced by yaze::editor::EditorManager::BuildModernMenu(), and yaze::editor::EditorManager::Initialize().
|
inline |
Definition at line 46 of file proposal_drawer.h.
References visible_.
void yaze::editor::ProposalDrawer::FocusProposal | ( | const std::string & | proposal_id | ) |
Definition at line 447 of file proposal_drawer.cc.
References needs_refresh_, selected_proposal_, selected_proposal_id_, and visible_.
Referenced by yaze::editor::AgentChatWidget::FocusProposalDrawer(), yaze::editor::EditorManager::Initialize(), and yaze::editor::AgentChatWidget::SetProposalDrawer().
|
private |
Definition at line 137 of file proposal_drawer.cc.
References yaze::cli::ProposalRegistry::kAccepted, yaze::cli::ProposalRegistry::kPending, yaze::cli::ProposalRegistry::kRejected, proposals_, selected_proposal_id_, and SelectProposal().
Referenced by Draw().
|
private |
Definition at line 193 of file proposal_drawer.cc.
References diff_content_, DrawActionButtons(), DrawPolicyStatus(), log_content_, log_display_lines_, and selected_proposal_.
Referenced by Draw().
|
private |
Definition at line 284 of file proposal_drawer.cc.
References yaze::cli::PolicyEvaluator::GetInstance(), ICON_MD_BLOCK, ICON_MD_CANCEL, ICON_MD_CHECK_CIRCLE, ICON_MD_ERROR, ICON_MD_INFO, ICON_MD_WARNING, yaze::cli::ProposalRegistry::kPending, and selected_proposal_.
Referenced by DrawProposalDetail().
|
private |
Definition at line 273 of file proposal_drawer.cc.
References RefreshProposals(), and status_filter_.
Referenced by Draw().
|
private |
Definition at line 381 of file proposal_drawer.cc.
References confirm_action_, confirm_proposal_id_, yaze::cli::PolicyEvaluator::GetInstance(), ICON_MD_CHECK, ICON_MD_CLOSE, ICON_MD_DELETE, yaze::cli::ProposalRegistry::kPending, selected_proposal_, show_confirm_dialog_, show_override_dialog_, and yaze::cli::ProposalRegistry::ProposalMetadata::status.
Referenced by DrawProposalDetail().
|
private |
Definition at line 508 of file proposal_drawer.cc.
References yaze::cli::ProposalRegistry::Instance(), yaze::cli::RomSandboxManager::Instance(), yaze::cli::ProposalRegistry::kAccepted, yaze::Rom::LoadFromFile(), needs_refresh_, rom_, yaze::Rom::vector(), and yaze::Rom::WriteVector().
Referenced by Draw().
|
private |
Definition at line 584 of file proposal_drawer.cc.
References yaze::cli::ProposalRegistry::Instance(), yaze::cli::ProposalRegistry::kRejected, and needs_refresh_.
Referenced by Draw().
|
private |
Definition at line 593 of file proposal_drawer.cc.
References diff_content_, yaze::cli::ProposalRegistry::Instance(), log_content_, needs_refresh_, selected_proposal_, and selected_proposal_id_.
Referenced by Draw().
|
private |
Definition at line 454 of file proposal_drawer.cc.
References diff_content_, yaze::cli::ProposalRegistry::Instance(), kAccepted, yaze::cli::ProposalRegistry::kAccepted, kAll, kPending, yaze::cli::ProposalRegistry::kPending, kRejected, yaze::cli::ProposalRegistry::kRejected, log_content_, proposals_, selected_proposal_, selected_proposal_id_, and status_filter_.
Referenced by Draw(), DrawStatusFilter(), and ProposalDrawer().
|
private |
Definition at line 493 of file proposal_drawer.cc.
References diff_content_, log_content_, proposals_, selected_proposal_, and selected_proposal_id_.
Referenced by Draw(), and DrawProposalList().
|
private |
Definition at line 63 of file proposal_drawer.h.
Referenced by Draw(), FocusProposal(), Hide(), IsVisible(), Show(), and Toggle().
|
private |
Definition at line 64 of file proposal_drawer.h.
Referenced by AcceptProposal(), DeleteProposal(), Draw(), FocusProposal(), and RejectProposal().
|
private |
Definition at line 73 of file proposal_drawer.h.
Referenced by DrawStatusFilter(), and RefreshProposals().
|
private |
Definition at line 76 of file proposal_drawer.h.
Referenced by DrawProposalList(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 77 of file proposal_drawer.h.
Referenced by DeleteProposal(), Draw(), DrawProposalList(), FocusProposal(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 78 of file proposal_drawer.h.
Referenced by DeleteProposal(), Draw(), DrawActionButtons(), DrawPolicyStatus(), DrawProposalDetail(), FocusProposal(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 81 of file proposal_drawer.h.
Referenced by DeleteProposal(), DrawProposalDetail(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 82 of file proposal_drawer.h.
Referenced by DeleteProposal(), DrawProposalDetail(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 83 of file proposal_drawer.h.
Referenced by DrawProposalDetail().
|
private |
Definition at line 86 of file proposal_drawer.h.
Referenced by Draw().
|
private |
Definition at line 87 of file proposal_drawer.h.
Referenced by Draw(), and DrawActionButtons().
|
private |
Definition at line 88 of file proposal_drawer.h.
Referenced by Draw(), and DrawActionButtons().
|
private |
Definition at line 89 of file proposal_drawer.h.
Referenced by Draw(), and DrawActionButtons().
|
private |
Definition at line 90 of file proposal_drawer.h.
Referenced by Draw(), and DrawActionButtons().
|
private |
Definition at line 93 of file proposal_drawer.h.
Referenced by AcceptProposal(), and SetRom().