yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::ProposalDrawer Class Reference

ImGui drawer for displaying and managing agent proposals. More...

#include <proposal_drawer.h>

Collaboration diagram for yaze::editor::ProposalDrawer:

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::ProposalMetadataproposals_
 
std::string selected_proposal_id_
 
cli::ProposalRegistry::ProposalMetadataselected_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_
 
Romrom_ = nullptr
 

Detailed Description

ImGui drawer for displaying and managing agent proposals.

Provides a UI for reviewing agent-generated ROM modification proposals, including:

  • List of all proposals with status indicators
  • Detailed view of selected proposal (metadata, diff, logs)
  • Accept/Reject controls
  • Filtering by status (Pending/Accepted/Rejected)

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.

Member Enumeration Documentation

◆ StatusFilter

Enumerator
kAll 
kPending 
kAccepted 
kRejected 

Definition at line 67 of file proposal_drawer.h.

Constructor & Destructor Documentation

◆ ProposalDrawer()

yaze::editor::ProposalDrawer::ProposalDrawer ( )

Definition at line 21 of file proposal_drawer.cc.

References RefreshProposals().

Here is the call graph for this function:

◆ ~ProposalDrawer()

yaze::editor::ProposalDrawer::~ProposalDrawer ( )
default

Member Function Documentation

◆ SetRom()

void yaze::editor::ProposalDrawer::SetRom ( Rom rom)
inline

Definition at line 37 of file proposal_drawer.h.

References rom_.

Referenced by yaze::editor::EditorManager::DrawMenuBar().

◆ Draw()

◆ Show()

void yaze::editor::ProposalDrawer::Show ( )
inline

Definition at line 43 of file proposal_drawer.h.

References visible_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ Hide()

void yaze::editor::ProposalDrawer::Hide ( )
inline

Definition at line 44 of file proposal_drawer.h.

References visible_.

◆ Toggle()

void yaze::editor::ProposalDrawer::Toggle ( )
inline

◆ IsVisible()

bool yaze::editor::ProposalDrawer::IsVisible ( ) const
inline

Definition at line 46 of file proposal_drawer.h.

References visible_.

◆ FocusProposal()

void yaze::editor::ProposalDrawer::FocusProposal ( const std::string &  proposal_id)

◆ DrawProposalList()

void yaze::editor::ProposalDrawer::DrawProposalList ( )
private

◆ DrawProposalDetail()

void yaze::editor::ProposalDrawer::DrawProposalDetail ( )
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().

Here is the call graph for this function:

◆ DrawPolicyStatus()

void yaze::editor::ProposalDrawer::DrawPolicyStatus ( )
private

◆ DrawStatusFilter()

void yaze::editor::ProposalDrawer::DrawStatusFilter ( )
private

Definition at line 273 of file proposal_drawer.cc.

References RefreshProposals(), and status_filter_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawActionButtons()

◆ AcceptProposal()

absl::Status yaze::editor::ProposalDrawer::AcceptProposal ( const std::string &  proposal_id)
private

◆ RejectProposal()

absl::Status yaze::editor::ProposalDrawer::RejectProposal ( const std::string &  proposal_id)
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().

Here is the call graph for this function:

◆ DeleteProposal()

absl::Status yaze::editor::ProposalDrawer::DeleteProposal ( const std::string &  proposal_id)
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().

Here is the call graph for this function:

◆ RefreshProposals()

◆ SelectProposal()

void yaze::editor::ProposalDrawer::SelectProposal ( const std::string &  proposal_id)
private

Member Data Documentation

◆ visible_

bool yaze::editor::ProposalDrawer::visible_ = false
private

Definition at line 63 of file proposal_drawer.h.

Referenced by Draw(), FocusProposal(), Hide(), IsVisible(), Show(), and Toggle().

◆ needs_refresh_

bool yaze::editor::ProposalDrawer::needs_refresh_ = true
private

Definition at line 64 of file proposal_drawer.h.

Referenced by AcceptProposal(), DeleteProposal(), Draw(), FocusProposal(), and RejectProposal().

◆ status_filter_

StatusFilter yaze::editor::ProposalDrawer::status_filter_ = StatusFilter::kAll
private

Definition at line 73 of file proposal_drawer.h.

Referenced by DrawStatusFilter(), and RefreshProposals().

◆ proposals_

std::vector<cli::ProposalRegistry::ProposalMetadata> yaze::editor::ProposalDrawer::proposals_
private

Definition at line 76 of file proposal_drawer.h.

Referenced by DrawProposalList(), RefreshProposals(), and SelectProposal().

◆ selected_proposal_id_

std::string yaze::editor::ProposalDrawer::selected_proposal_id_
private

◆ selected_proposal_

cli::ProposalRegistry::ProposalMetadata* yaze::editor::ProposalDrawer::selected_proposal_ = nullptr
private

◆ diff_content_

std::string yaze::editor::ProposalDrawer::diff_content_
private

◆ log_content_

std::string yaze::editor::ProposalDrawer::log_content_
private

◆ log_display_lines_

int yaze::editor::ProposalDrawer::log_display_lines_ = 50
private

Definition at line 83 of file proposal_drawer.h.

Referenced by DrawProposalDetail().

◆ drawer_width_

float yaze::editor::ProposalDrawer::drawer_width_ = 400.0f
private

Definition at line 86 of file proposal_drawer.h.

Referenced by Draw().

◆ show_confirm_dialog_

bool yaze::editor::ProposalDrawer::show_confirm_dialog_ = false
private

Definition at line 87 of file proposal_drawer.h.

Referenced by Draw(), and DrawActionButtons().

◆ show_override_dialog_

bool yaze::editor::ProposalDrawer::show_override_dialog_ = false
private

Definition at line 88 of file proposal_drawer.h.

Referenced by Draw(), and DrawActionButtons().

◆ confirm_action_

std::string yaze::editor::ProposalDrawer::confirm_action_
private

Definition at line 89 of file proposal_drawer.h.

Referenced by Draw(), and DrawActionButtons().

◆ confirm_proposal_id_

std::string yaze::editor::ProposalDrawer::confirm_proposal_id_
private

Definition at line 90 of file proposal_drawer.h.

Referenced by Draw(), and DrawActionButtons().

◆ rom_

Rom* yaze::editor::ProposalDrawer::rom_ = nullptr
private

Definition at line 93 of file proposal_drawer.h.

Referenced by AcceptProposal(), and SetRom().


The documentation for this class was generated from the following files: