5#include "absl/strings/str_format.h"
14 : window_manager_(window_manager), session_id_(session_id) {}
21 std::function<
void(
const std::string&)> switch_callback)
22 : switch_callback_(std::move(switch_callback)) {}
29 std::function<
void(
const std::string&)> open_callback)
30 : open_callback_(std::move(open_callback)) {}
37 : session_id_(session_id) {}
44 std::function<
void(
int drawer_type)> toggle_callback,
45 std::function<
void()> cycle_next, std::function<
void()> cycle_prev)
46 : toggle_callback_(std::move(toggle_callback)),
47 cycle_next_(std::move(cycle_next)),
48 cycle_prev_(std::move(cycle_prev)) {}
55 std::function<
void(
const std::string&)> apply_callback)
56 : apply_callback_(std::move(apply_callback)) {}
64 : window_manager_(window_manager), session_id_(session_id) {}
73 : window_manager_(window_manager),
74 user_settings_(user_settings),
75 session_id_(session_id) {}
85 "Clear the custom sidebar order and revert to defaults",
94 "Un-hide every sidebar category",
104 for (
const auto& cat : categories) {
108 std::string pin_name = absl::StrFormat(
"Sidebar: Toggle Pin: %s", cat);
109 std::string pin_desc =
110 absl::StrFormat(
"Pin or unpin %s at the top of the sidebar", cat);
111 std::string captured_cat_pin = cat;
113 "", [
this, captured_cat_pin]() {
117 if (pinned.count(captured_cat_pin)) {
118 pinned.erase(captured_cat_pin);
120 pinned.insert(captured_cat_pin);
125 std::string hide_name =
126 absl::StrFormat(
"Sidebar: Toggle Visibility: %s", cat);
127 std::string hide_desc =
128 absl::StrFormat(
"Show or hide %s in the sidebar", cat);
129 std::string captured_cat_hide = cat;
131 "", [
this, captured_cat_hide]() {
135 if (hidden.count(captured_cat_hide)) {
136 hidden.erase(captured_cat_hide);
138 hidden.insert(captured_cat_hide);
146 : callbacks_(std::move(callbacks)) {}
void RegisterDrawerCommands(std::function< void(int drawer_type)> toggle_callback, std::function< void()> cycle_next={}, std::function< void()> cycle_prev={})
Register right-drawer toggle commands from GetDrawerCatalog().
void RegisterDungeonRoomCommands(size_t session_id)
Register dungeon room navigation commands.
void RegisterWelcomeCommands(const RecentProjectsModel *model, const std::vector< std::string > &template_names, std::function< void(const std::string &)> remove_callback, std::function< void(const std::string &)> toggle_pin_callback, std::function< void()> undo_remove_callback, std::function< void()> clear_recents_callback, std::function< void(const std::string &)> create_from_template_callback, std::function< void()> dismiss_welcome_callback, std::function< void()> show_welcome_callback)
Expose welcome-screen actions through the command palette.
void RegisterLayoutCommands(std::function< void(const std::string &)> apply_callback)
Register layout preset commands.
void AddCommand(const std::string &name, const std::string &category, const std::string &description, const std::string &shortcut, std::function< void()> callback)
void RegisterPanelCommands(WorkspaceWindowManager *window_manager, size_t session_id)
Register all window toggle commands from WorkspaceWindowManager.
void RegisterWorkflowCommands(WorkspaceWindowManager *window_manager, size_t session_id)
Register hack workflow commands from workflow-aware panels/actions.
void RegisterEditorCommands(std::function< void(const std::string &)> switch_callback)
Register all editor switch commands.
void RegisterRecentFilesCommands(std::function< void(const std::string &)> open_callback)
Register commands to open recent files.
std::function< void(int)> toggle_callback_
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
DrawerCommandsProvider(std::function< void(int drawer_type)> toggle_callback, std::function< void()> cycle_next={}, std::function< void()> cycle_prev={})
std::function< void()> cycle_prev_
std::function< void()> cycle_next_
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
DungeonRoomCommandsProvider(size_t session_id)
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
EditorCommandsProvider(std::function< void(const std::string &)> switch_callback)
std::function< void(const std::string &) switch_callback_)
LayoutCommandsProvider(std::function< void(const std::string &)> apply_callback)
std::function< void(const std::string &) apply_callback_)
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
WorkspaceWindowManager * window_manager_
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
PanelCommandsProvider(WorkspaceWindowManager *window_manager, size_t session_id)
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
std::function< void(const std::string &) open_callback_)
RecentFilesCommandsProvider(std::function< void(const std::string &)> open_callback)
Manages user preferences and settings persistence.
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
WelcomeCommandsProvider(Callbacks callbacks)
WorkspaceWindowManager * window_manager_
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
WorkflowCommandsProvider(WorkspaceWindowManager *window_manager, size_t session_id)
Central registry for all editor cards with session awareness and dependency injection.
static constexpr const char * kDashboardCategory
std::vector< std::string > GetAllCategories(size_t session_id) const
static constexpr const char * kView
std::unordered_set< std::string > sidebar_hidden
std::function< void()> clear_recents
std::function< void(const std::string &) toggle_pin)
std::vector< std::string > template_names
std::function< void()> undo_remove
std::function< void(const std::string &) remove)
std::function< void()> dismiss_welcome
std::function< void()> show_welcome
std::function< void(const std::string &) create_from_template)
const RecentProjectsModel * model