1#ifndef YAZE_APP_EDITOR_MENU_RIGHT_DRAWER_MANAGER_H_
2#define YAZE_APP_EDITOR_MENU_RIGHT_DRAWER_MANAGER_H_
7#include <unordered_map>
10#include "absl/types/span.h"
13#include "imgui/imgui.h"
34class SelectionPropertiesPanel;
35class ProjectManagementPanel;
109 void SetToolOutput(std::string title, std::string query, std::string content,
110 ToolOutputActions actions = {});
135 [[deprecated(
"Use ToggleDrawer() instead.")]]
145 [[deprecated(
"Use OpenDrawer() instead.")]]
163 [[deprecated(
"Use CloseDrawer() instead.")]]
175 [[deprecated(
"Use CycleDrawer() instead.")]]
192 [[deprecated(
"Use IsDrawerExpanded() instead.")]]
201 [[deprecated(
"Use GetActiveDrawer() instead.")]]
210 [[deprecated(
"Use IsDrawerActive() instead.")]]
223 [[deprecated(
"Use GetDrawerWidth() instead.")]]
237 [[deprecated(
"Use SetDrawerWidth() instead.")]]
276 const std::unordered_map<std::string, float>& widths);
279 std::function<
void(
DrawerType,
float)> callback) {
297 [[deprecated(
"Use DrawSidebarToggleButton() instead.")]]
304 [[deprecated(
"Use GetSidebarToggleWidth() instead.")]]
348 bool default_open =
true);
355 const std::string& fallback)
const;
356 void DrawShortcutRow(
const std::string& action,
const char* description,
357 const std::string& fallback);
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Unified Agent Chat Component.
Panel for managing project settings, ROM versions, and snapshots.
ImGui drawer for displaying and managing agent proposals.
Manages right-side sliding drawers for agent chat, proposals, settings.
RightDrawerManager & operator=(const RightDrawerManager &)=delete
void CycleDrawer(int direction)
Cycle to the next/previous right drawer in header order.
void SetToastManager(ToastManager *manager)
bool DrawDrawerToggleButtons()
void DrawPanelDescription(const char *text)
void DrawEditorContextHeader()
static std::string PanelTypeKey(PanelType type)
const std::string & tool_output_query() const
void NotifyPanelWidthChanged(PanelType type, float width)
friend class RightDrawerManagerTestPeer
EditorType active_editor_type_
void SetDrawerWidthChangedCallback(std::function< void(DrawerType, float)> callback)
void TogglePanel(PanelType type)
void SetActiveEditor(EditorType type)
Set the active editor for context-aware help content.
void DrawEditorSpecificShortcuts()
void DrawPanelHeader(PanelType type, const char *title, const char *icon)
void DrawShortcutRow(const std::string &action, const char *description, const std::string &fallback)
std::string GetShortcutLabel(const std::string &action, const std::string &fallback) const
float GetClampedPanelWidth(PanelType type, float viewport_width) const
void OpenDrawer(DrawerType type)
Open a specific drawer.
void SetDrawerWidth(DrawerType type, float width)
Set drawer width for a specific drawer type.
void SetPanelWidth(PanelType type, float width)
bool DrawSidebarToggleButton()
RightDrawerManager(const RightDrawerManager &)=delete
void SetToolOutput(std::string title, std::string query, std::string content, ToolOutputActions actions={})
float GetPanelWidth() const
void ToggleLastDrawer()
Toggle the right sidebar using its last selected persistent tab.
DrawerType GetLastActiveDrawer() const
ToolOutputActions tool_output_actions_
void DrawPanelValue(const char *label, const char *value)
void Draw()
Draw the drawer and its contents.
void SetAgentChat(AgentChat *chat)
static constexpr float GetCollapsedWidth()
Get the width of the collapsed panel strip (toggle buttons)
std::function< void(PanelType, float)> on_panel_width_changed_
PanelType GetActivePanel() const
void DrawGlobalShortcuts()
ProjectManagementPanel * project_panel() const
void ResetDrawerWidths()
Reset all drawer widths to their defaults.
void SetProjectManagementPanel(ProjectManagementPanel *panel)
void DrawEditorSpecificHelp()
void SetSettingsPanelProvider(std::function< SettingsPanel *()> provider)
float GetExpandedDrawerWidth() const
SelectionPropertiesPanel * properties_panel_
bool BeginPanelSection(const char *label, const char *icon=nullptr, bool default_open=true)
void ToggleDrawer(DrawerType type)
Toggle a specific drawer on/off.
SelectionPropertiesPanel * properties_panel() const
void DrawProposalsPanel()
void SetSettingsPanel(SettingsPanel *panel)
void SetDrawerSizeLimits(DrawerType type, const PanelSizeLimits &limits)
AgentChat * agent_chat() const
bool IsPanelExpanded() const
static float GetDefaultDrawerWidth(DrawerType type, EditorType editor=EditorType::kUnknown)
Get the default width for a specific drawer type.
void OpenPanel(PanelType type)
ShortcutManager * shortcut_manager_
const std::string & tool_output_content() const
const std::string & tool_output_title() const
void DrawHeaderActions(PanelType type)
std::string tool_output_title_
float GetConfiguredPanelWidth(PanelType type) const
PanelSizeLimits GetSharedPanelSizeLimits() const
void DrawQuickActionButtons()
ProposalDrawer * proposal_drawer() const
std::unordered_map< std::string, PanelSizeLimits > panel_size_limits_
void DrawPropertiesPanel()
RightDrawerManager()=default
void DrawAgentChatPanel()
SettingsPanel * settings_panel_
void SetProposalDrawer(ProposalDrawer *drawer)
void DrawHeaderContextBadge(PanelType type, float available_width)
bool IsPanelActive(PanelType type) const
void DrawNotificationsPanel()
ToastManager * toast_manager_
DrawerType GetActiveDrawer() const
Get the currently active drawer type.
PanelSizeLimits GetDrawerSizeLimits(DrawerType type) const
bool IsDrawerActive(DrawerType type) const
Check if a specific drawer is active.
bool IsDrawerExpanded() const
Check if any drawer is currently expanded (or animating closed)
float GetDrawerWidth() const
std::string tool_output_content_
void OnHostVisibilityChanged(bool visible)
Snap transient animations when host visibility changes.
void DrawPanelLabel(const char *label)
static float GetSidebarToggleWidth()
bool DrawAgentQuickActions()
void CloseDrawer()
Close the currently active drawer.
void RestoreDrawerWidths(const std::unordered_map< std::string, float > &widths)
std::unordered_map< std::string, float > SerializeDrawerWidths() const
SettingsPanel * settings_panel() const
void CyclePanel(int direction)
PanelType last_active_panel_
ProposalDrawer * proposal_drawer_
std::string tool_output_query_
void CycleToPreviousDrawer()
ProjectManagementPanel * project_panel_
void DrawToolOutputPanel()
void SetPropertiesPanel(SelectionPropertiesPanel *panel)
void DrawDrawerNavStrip(PanelType current_panel)
static float GetDrawerToggleClusterWidth()
PanelSizeLimits GetPanelSizeLimits(PanelType type) const
std::function< SettingsPanel *()> settings_panel_provider_
void SetShortcutManager(ShortcutManager *manager)
~RightDrawerManager()=default
void SetPanelSizeLimits(PanelType type, const PanelSizeLimits &limits)
Set sizing constraints for an individual right panel.
Full-editing properties panel for selected entities.
Manages the settings UI displayed in the right sidebar.
const char * GetDrawerTypeName(RightDrawerManager::DrawerType type)
absl::Span< const DrawerCatalogEntry > GetDrawerCatalog()
Switchable drawers in header-cycle order (excludes Tool Output).
const char * GetPanelTypeName(RightDrawerManager::PanelType type)
Get the name of a panel type.
const char * GetPanelShortcutAction(RightDrawerManager::PanelType type)
Shortcut action id used by ShortcutManager for a drawer toggle.
const char * GetDrawerShortcutAction(RightDrawerManager::DrawerType type)
const char * GetDrawerTypeIcon(RightDrawerManager::DrawerType type)
const char * GetPanelTypeIcon(RightDrawerManager::PanelType type)
Get the icon for a panel type.
One entry in the shared right-drawer catalog (header / overflow / View).
RightDrawerManager::DrawerType type
const char * shortcut_action
static constexpr float kMaxPanelWidthRatio