Compact proposal management panel for agent sidebar. More...
#include <agent_proposals_panel.h>
Public Member Functions | |
| AgentProposalsPanel () | |
| ~AgentProposalsPanel ()=default | |
| void | SetContext (AgentUIContext *context) |
| Set the shared UI context. | |
| void | SetToastManager (ToastManager *toast_manager) |
| Set toast manager for notifications. | |
| void | SetRom (Rom *rom) |
| Set ROM reference for proposal merging. | |
| void | SetProposalCallbacks (const ProposalCallbacks &callbacks) |
| Set proposal callbacks. | |
| void | Draw (float available_height=0.0f) |
| Draw the complete proposals panel. | |
| void | DrawProposalList () |
| Draw just the proposal list (for custom layouts) | |
| void | DrawProposalDetail () |
| Draw the detail view for selected proposal. | |
| void | SetCompactMode (bool compact) |
| Set compact mode for sidebar usage. | |
| bool | IsCompactMode () const |
| void | FocusProposal (const std::string &proposal_id) |
| Focus a specific proposal by ID. | |
| void | RefreshProposals () |
| Refresh the proposal list from registry. | |
| int | GetPendingCount () const |
| Get count of pending proposals. | |
| int | GetTotalCount () const |
| Get total proposal count. | |
Private Member Functions | |
| void | DrawStatusFilter () |
| void | DrawProposalRow (const cli::ProposalRegistry::ProposalMetadata &proposal) |
| void | DrawQuickActions (const cli::ProposalRegistry::ProposalMetadata &proposal) |
| void | DrawDiffView () |
| void | DrawLogView () |
| 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 | SelectProposal (const std::string &proposal_id) |
| const char * | GetStatusIcon (cli::ProposalRegistry::ProposalStatus status) const |
| ImVec4 | GetStatusColor (cli::ProposalRegistry::ProposalStatus status) const |
Private Attributes | |
| AgentUIContext * | context_ = nullptr |
| ToastManager * | toast_manager_ = nullptr |
| Rom * | rom_ = nullptr |
| ProposalCallbacks | proposal_callbacks_ |
| bool | compact_mode_ = false |
| bool | needs_refresh_ = true |
| std::vector< cli::ProposalRegistry::ProposalMetadata > | proposals_ |
| std::string | selected_proposal_id_ |
| const cli::ProposalRegistry::ProposalMetadata * | selected_proposal_ = nullptr |
| std::string | diff_content_ |
| std::string | log_content_ |
| bool | show_confirm_dialog_ = false |
| std::string | confirm_action_ |
| std::string | confirm_proposal_id_ |
Compact proposal management panel for agent sidebar.
This component displays a list of agent-generated proposals with:
Designed to work in both sidebar mode (compact) and standalone (full detail). Uses AgentUIContext for shared state with other agent components.
Definition at line 32 of file agent_proposals_panel.h.
| yaze::editor::AgentProposalsPanel::AgentProposalsPanel | ( | ) |
Definition at line 64 of file agent_proposals_panel.cc.
References proposals_.
|
default |
| void yaze::editor::AgentProposalsPanel::SetContext | ( | AgentUIContext * | context | ) |
Set the shared UI context.
Definition at line 68 of file agent_proposals_panel.cc.
References context_.
| void yaze::editor::AgentProposalsPanel::SetToastManager | ( | ToastManager * | toast_manager | ) |
Set toast manager for notifications.
Definition at line 72 of file agent_proposals_panel.cc.
References toast_manager_.
| void yaze::editor::AgentProposalsPanel::SetRom | ( | Rom * | rom | ) |
Set ROM reference for proposal merging.
Definition at line 76 of file agent_proposals_panel.cc.
References rom_.
| void yaze::editor::AgentProposalsPanel::SetProposalCallbacks | ( | const ProposalCallbacks & | callbacks | ) |
Set proposal callbacks.
Definition at line 78 of file agent_proposals_panel.cc.
References proposal_callbacks_.
| void yaze::editor::AgentProposalsPanel::Draw | ( | float | available_height = 0.0f | ) |
Draw the complete proposals panel.
| available_height | Height available (0 = auto) |
Definition at line 83 of file agent_proposals_panel.cc.
References AcceptProposal(), compact_mode_, confirm_action_, confirm_proposal_id_, DeleteProposal(), DrawProposalDetail(), DrawProposalList(), DrawStatusFilter(), yaze::editor::AgentUI::GetTheme(), needs_refresh_, RefreshProposals(), RejectProposal(), selected_proposal_, and show_confirm_dialog_.
| void yaze::editor::AgentProposalsPanel::DrawProposalList | ( | ) |
Draw just the proposal list (for custom layouts)
Definition at line 182 of file agent_proposals_panel.cc.
References context_, DrawProposalRow(), yaze::editor::ProposalState::filter_mode, yaze::editor::ProposalState::kAccepted, yaze::cli::ProposalRegistry::kAccepted, yaze::editor::ProposalState::kAll, yaze::editor::ProposalState::kPending, yaze::cli::ProposalRegistry::kPending, yaze::editor::ProposalState::kRejected, yaze::cli::ProposalRegistry::kRejected, yaze::editor::AgentUIContext::proposal_state(), and proposals_.
Referenced by Draw().

| void yaze::editor::AgentProposalsPanel::DrawProposalDetail | ( | ) |
Draw the detail view for selected proposal.
Definition at line 321 of file agent_proposals_panel.cc.
References yaze::cli::ProposalRegistry::ProposalMetadata::description, DrawDiffView(), DrawLogView(), GetStatusColor(), GetStatusIcon(), yaze::editor::AgentUI::GetTheme(), ICON_MD_PREVIEW, yaze::cli::ProposalRegistry::ProposalMetadata::id, selected_proposal_, and yaze::cli::ProposalRegistry::ProposalMetadata::status.
Referenced by Draw().
|
inline |
Set compact mode for sidebar usage.
Definition at line 76 of file agent_proposals_panel.h.
References compact_mode_.
|
inline |
Definition at line 77 of file agent_proposals_panel.h.
References compact_mode_.
| void yaze::editor::AgentProposalsPanel::FocusProposal | ( | const std::string & | proposal_id | ) |
Focus a specific proposal by ID.
Definition at line 420 of file agent_proposals_panel.cc.
References context_, yaze::editor::ProposalState::focused_proposal_id, yaze::editor::AgentUIContext::proposal_state(), and SelectProposal().

| void yaze::editor::AgentProposalsPanel::RefreshProposals | ( | ) |
Refresh the proposal list from registry.
Definition at line 427 of file agent_proposals_panel.cc.
References context_, diff_content_, yaze::cli::ProposalRegistry::Instance(), yaze::cli::ProposalRegistry::kAccepted, yaze::cli::ProposalRegistry::kPending, yaze::cli::ProposalRegistry::kRejected, yaze::cli::ProposalRegistry::ListProposals(), log_content_, needs_refresh_, yaze::editor::AgentUIContext::proposal_state(), proposals_, selected_proposal_, selected_proposal_id_, and yaze::editor::ProposalState::total_proposals.
Referenced by Draw().

| int yaze::editor::AgentProposalsPanel::GetPendingCount | ( | ) | const |
Get count of pending proposals.
Definition at line 473 of file agent_proposals_panel.cc.
References yaze::cli::ProposalRegistry::kPending, and proposals_.
Referenced by DrawStatusFilter().
|
inline |
Get total proposal count.
Definition at line 97 of file agent_proposals_panel.h.
References proposals_.
|
private |
Definition at line 145 of file agent_proposals_panel.cc.
References compact_mode_, context_, GetPendingCount(), ICON_MD_RULE, needs_refresh_, yaze::editor::AgentUIContext::proposal_state(), yaze::editor::AgentUI::StatusBadge(), and yaze::editor::AgentUI::Warning.
Referenced by Draw().

|
private |
Definition at line 222 of file agent_proposals_panel.cc.
References yaze::cli::ProposalRegistry::ProposalMetadata::bytes_changed, yaze::cli::ProposalRegistry::ProposalMetadata::commands_executed, compact_mode_, yaze::cli::ProposalRegistry::ProposalMetadata::created_at, yaze::cli::ProposalRegistry::ProposalMetadata::description, DrawQuickActions(), GetStatusColor(), GetStatusIcon(), yaze::editor::AgentUI::GetTheme(), yaze::cli::ProposalRegistry::ProposalMetadata::id, yaze::cli::ProposalRegistry::kPending, selected_proposal_id_, SelectProposal(), and yaze::cli::ProposalRegistry::ProposalMetadata::status.
Referenced by DrawProposalList().
|
private |
Definition at line 276 of file agent_proposals_panel.cc.
References compact_mode_, confirm_action_, confirm_proposal_id_, yaze::editor::AgentUI::GetTheme(), ICON_MD_CHECK, ICON_MD_CLOSE, yaze::cli::ProposalRegistry::ProposalMetadata::id, show_confirm_dialog_, and yaze::editor::AgentUI::StyledButton().
Referenced by DrawProposalRow().

|
private |
Definition at line 359 of file agent_proposals_panel.cc.
References diff_content_, yaze::cli::ProposalRegistry::ProposalMetadata::diff_path, yaze::editor::AgentUI::GetTheme(), and selected_proposal_.
Referenced by DrawProposalDetail().

|
private |
Definition at line 400 of file agent_proposals_panel.cc.
References yaze::editor::AgentUI::GetTheme(), log_content_, yaze::cli::ProposalRegistry::ProposalMetadata::log_path, and selected_proposal_.
Referenced by DrawProposalDetail().

|
private |
Definition at line 530 of file agent_proposals_panel.cc.
References yaze::editor::ProposalCallbacks::accept_proposal, ICON_MD_CHECK_CIRCLE, yaze::cli::ProposalRegistry::Instance(), yaze::cli::ProposalRegistry::kAccepted, yaze::editor::kError, yaze::editor::kSuccess, needs_refresh_, proposal_callbacks_, yaze::editor::ToastManager::Show(), toast_manager_, and yaze::cli::ProposalRegistry::UpdateStatus().
Referenced by Draw().

|
private |
Definition at line 557 of file agent_proposals_panel.cc.
References ICON_MD_CANCEL, yaze::cli::ProposalRegistry::Instance(), yaze::editor::kError, yaze::editor::kInfo, yaze::cli::ProposalRegistry::kRejected, needs_refresh_, proposal_callbacks_, yaze::editor::ProposalCallbacks::reject_proposal, yaze::editor::ToastManager::Show(), toast_manager_, and yaze::cli::ProposalRegistry::UpdateStatus().
Referenced by Draw().

|
private |
Definition at line 584 of file agent_proposals_panel.cc.
References diff_content_, ICON_MD_DELETE, yaze::cli::ProposalRegistry::Instance(), yaze::editor::kError, yaze::editor::kInfo, log_content_, needs_refresh_, yaze::cli::ProposalRegistry::RemoveProposal(), selected_proposal_, selected_proposal_id_, yaze::editor::ToastManager::Show(), and toast_manager_.
Referenced by Draw().

|
private |
Definition at line 483 of file agent_proposals_panel.cc.
References diff_content_, log_content_, proposals_, selected_proposal_, and selected_proposal_id_.
Referenced by DrawProposalRow(), and FocusProposal().
|
private |
Definition at line 501 of file agent_proposals_panel.cc.
References ICON_MD_CANCEL, ICON_MD_CHECK_CIRCLE, ICON_MD_HELP, ICON_MD_PENDING, yaze::cli::ProposalRegistry::kAccepted, yaze::cli::ProposalRegistry::kPending, and yaze::cli::ProposalRegistry::kRejected.
Referenced by DrawProposalDetail(), and DrawProposalRow().
|
private |
Definition at line 515 of file agent_proposals_panel.cc.
References yaze::editor::AgentUI::GetTheme(), yaze::cli::ProposalRegistry::kAccepted, yaze::cli::ProposalRegistry::kPending, and yaze::cli::ProposalRegistry::kRejected.
Referenced by DrawProposalDetail(), and DrawProposalRow().

|
private |
Definition at line 114 of file agent_proposals_panel.h.
Referenced by DrawProposalList(), DrawStatusFilter(), FocusProposal(), RefreshProposals(), and SetContext().
|
private |
Definition at line 115 of file agent_proposals_panel.h.
Referenced by AcceptProposal(), DeleteProposal(), RejectProposal(), and SetToastManager().
|
private |
Definition at line 116 of file agent_proposals_panel.h.
Referenced by SetRom().
|
private |
Definition at line 117 of file agent_proposals_panel.h.
Referenced by AcceptProposal(), RejectProposal(), and SetProposalCallbacks().
|
private |
Definition at line 119 of file agent_proposals_panel.h.
Referenced by Draw(), DrawProposalRow(), DrawQuickActions(), DrawStatusFilter(), IsCompactMode(), and SetCompactMode().
|
private |
Definition at line 120 of file agent_proposals_panel.h.
Referenced by AcceptProposal(), DeleteProposal(), Draw(), DrawStatusFilter(), RefreshProposals(), and RejectProposal().
|
private |
Definition at line 123 of file agent_proposals_panel.h.
Referenced by AgentProposalsPanel(), DrawProposalList(), GetPendingCount(), GetTotalCount(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 124 of file agent_proposals_panel.h.
Referenced by DeleteProposal(), DrawProposalRow(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 125 of file agent_proposals_panel.h.
Referenced by DeleteProposal(), Draw(), DrawDiffView(), DrawLogView(), DrawProposalDetail(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 128 of file agent_proposals_panel.h.
Referenced by DeleteProposal(), DrawDiffView(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 129 of file agent_proposals_panel.h.
Referenced by DeleteProposal(), DrawLogView(), RefreshProposals(), and SelectProposal().
|
private |
Definition at line 132 of file agent_proposals_panel.h.
Referenced by Draw(), and DrawQuickActions().
|
private |
Definition at line 133 of file agent_proposals_panel.h.
Referenced by Draw(), and DrawQuickActions().
|
private |
Definition at line 134 of file agent_proposals_panel.h.
Referenced by Draw(), and DrawQuickActions().