Step 167: split EditorState into sub-states

This commit is contained in:
Bill
2026-02-09 20:43:36 -07:00
parent 5b6e8d72d8
commit de13e514e1
26 changed files with 3503 additions and 2689 deletions

View File

@@ -0,0 +1,20 @@
#pragma once
#include <memory>
#include <vector>
#include <map>
#include "WebSocketServer.h"
#include "WorkflowRecorder.h"
#include "AgentRegistry.h"
#include "AgentMarketplace.h"
#include "AgentPermissionPolicy.h"
struct AgentState {
std::unique_ptr<WebSocketAgentServer> server;
MockWebSocketTransport* transport = nullptr;
int port = 8765;
std::vector<std::string> log;
std::map<std::string, AgentRole> roles;
WorkflowRecorder workflowRecorder;
AgentRegistry registry;
AgentMarketplaceState marketplace;
};

View File

@@ -0,0 +1,17 @@
#pragma once
#include "TerminalPanel.h"
#include "BuildSystem.h"
struct BuildState {
bool showTerminalPanel = false;
TerminalPanel terminal;
bool runInProgress = false;
bool hasRunResult = false;
int lastRunExitCode = 0;
std::string lastRunCommand;
BuildSystem::Type buildType = BuildSystem::Type::None;
std::vector<BuildError> buildErrors;
std::string lastBuildOutput;
std::string lastBuildCommand;
};

View File

@@ -0,0 +1,19 @@
#pragma once
#include "EmacsIntegration.h"
#include "EmacsPackageBrowser.h"
#include "EmacsFunctionDiscovery.h"
#include "EmacsKeybinding.h"
#include "OrgMode.h"
struct EmacsState {
EmacsConnection emacs;
bool showEmacsPackagesPanel = false;
EmacsPackageBrowserState emacsPackages;
EmacsFunctionIndex emacsFunctionIndex;
bool emacsFunctionIndexDirty = true;
EmacsKeybindingState emacsKeys;
bool showEmacsBridgePanel = false;
bool showOrgPanel = true;
OrgDocumentState orgDoc;
int orgTempCounter = 0;
};

View File

@@ -0,0 +1,27 @@
#pragma once
#include "DependencyPanel.h"
#include "LibraryBrowserPanel.h"
#include "CompositionPanel.h"
#include "LibraryIndexer.h"
#include "PrimitivesRegistry.h"
struct LibraryState {
bool showDependencyPanel = true;
DependencyPanelState dependencyPanel;
bool showLibraryBrowserPanel = true;
LibraryBrowserState libraryBrowser;
bool showCompositionPanel = false;
CompositionPanelState compositionPanel;
struct LibraryIndexRequest {
std::string name;
std::string version;
std::string source;
int symbolsRequestId = -1;
int completionRequestId = -1;
};
std::vector<LibraryIndexRequest> libraryIndexRequests;
LibraryIndexData libraryIndex;
PrimitivesRegistry primitives;
};

View File

@@ -0,0 +1,22 @@
#pragma once
#include "ProjectSearch.h"
struct SearchState {
bool showFind = false;
char findBuf[256] = {};
char replaceBuf[256] = {};
int lastFindPos = 0;
bool showProjectSearch = false;
char searchQuery[256] = {};
char searchInclude[256] = {};
char searchExclude[256] = {};
bool searchUseRegex = true;
std::vector<ProjectSearch::FileResult> searchResults;
bool showGoToLine = false;
char goToLineBuf[64] = {};
bool goToLineError = false;
ProjectSearch projectSearch;
};

View File

@@ -0,0 +1,14 @@
#pragma once
#include "LayoutManager.h"
struct UIFlags {
bool showWhitespace = false;
bool showMinimap = false;
bool showAnnotations = false;
bool showOutline = true;
bool showLineNumbers = true;
bool showLspSettings = false;
bool showSettingsPanel = false;
int bottomTab = 0; // 0=Output,1=AST,2=Highlighted
LayoutPreset layoutPreset = LayoutPreset::VSCode;
};