Эх сурвалжийг харах

docs(plan): Mark Phase Y and Z as complete

Bernardo Magri 1 сар өмнө
parent
commit
3f294bf531
1 өөрчлөгдсөн 13 нэмэгдсэн , 1 устгасан
  1. 13 1
      documentation/PLAN.md

+ 13 - 1
documentation/PLAN.md

@@ -124,6 +124,7 @@ This phase aims to create a modular, extensible, and UI-agnostic modeline system
         *   Create concrete implementations for existing segments: `BufferNameSegment`, `ModificationStatusSegment`, `CursorPositionSegment`, `PercentageSegment`.
         *   Introduce a `ModelineManager` or `ModelineComposer` class responsible for assembling the complete modeline string by querying registered `ModelineSegment`s. This manager should be able to operate on a given `Window` context.
         *   Allow registration/deregistration of `ModelineSegment`s (potentially via Lua API or configuration).
+    *   **Status Update:** Completed. The `ModelineSegment` interface and `ModelineManager` provide a UI-agnostic content API.
 
 *   **Subtask Y.2: Integrate Modeline Content with UI Renderers:**
     *   **Goal:** Ensure each UI backend (TUI, GTK) uses the centralized modeline content API and handles rendering specific details.
@@ -132,6 +133,7 @@ This phase aims to create a modular, extensible, and UI-agnostic modeline system
         *   Modify `TuiEditor::render_window_modeline()` and GTK's modeline rendering functions (`render_modeline_for_window`, `render_modeline`) to obtain their content (a list of segmented strings and their associated face names) from the `ModelineManager` (or `ModelineComposer`).
         *   The UI renderers would then be responsible for displaying the segmented content, applying appropriate faces (which will be resolved by the respective `NCursesRenderer` or `GtkRenderer` after theme decoupling from Phase X).
         *   Remove the global `render_status_line()` from `TuiEditor` if it is indeed dead code. If it represents a global status bar distinct from per-window modelines, clarify its purpose and refactor it to use the new `ModelineManager`.
+    *   **Status Update:** Completed. `GtkEditor::render_modeline_for_window()` effectively integrates with the `ModelineManager` to render styled chunks.
 
 *   **Subtask Y.3: Enhance Modeline Configuration:**
     *   **Goal:** Provide flexible configuration for modeline elements and their order.
@@ -139,6 +141,7 @@ This phase aims to create a modular, extensible, and UI-agnostic modeline system
     *   **Actions:**
         *   Allow users to specify the order and presence of `ModelineSegment`s in the configuration (e.g., via a Lua table in `init.lua`).
         *   Investigate and implement (if desired) an option for per-window modeline visibility or specific modeline configurations per window/buffer type.
+    *   **Status Update:** Completed. Modeline configuration is now flexible, allowing users to specify the order and presence of `ModelineSegment`s via Lua configuration.
 
 *   **Subtask Y.4: Remove Legacy ThemeElement Usage from Modeline:**
     *   **Goal:** Align modeline styling with the unified `Face` system (from Phase X).
@@ -146,16 +149,18 @@ This phase aims to create a modular, extensible, and UI-agnostic modeline system
     *   **Actions:**
         *   Once `ThemeElement` is removed as part of Phase X, update modeline rendering to directly request face attributes for standardized face names like `"mode-line"` and `"mode-line-inactive"` (or their new standardized names, as per Subtask X.5).
         *   The `NCursesRenderer` and `GtkRenderer` (or their color management components) will be responsible for resolving these face names to actual UI colors, further decoupling concerns.
+    *   **Status Update:** Completed. Modeline rendering now requests face attributes for standardized face names, aligning with the unified Face system.
 
 *   **Subtask Y.5: Modularize `TuiEditor` and `GtkEditor` Rendering:**
     *   **Goal:** Reduce the "God Object" nature of `TuiEditor` and `GtkEditor` by extracting specific rendering concerns into smaller, testable units.
     *   **Problem:** The `TuiEditor` and `GtkEditor` classes are currently monolithic, handling all UI logic from input to rendering, making them large and harder to maintain or test.
     *   **Actions:**
         *   Consider introducing `TuiWindowRenderer` and `GtkWindowRenderer` classes that encapsulate how a single `Window` (including its modeline, text content, line numbers, etc.) is rendered in each backend. These could take a `Window` object and a `ModelineManager` to perform their rendering tasks. This would make `TuiEditor` and `GtkEditor` primarily orchestrators, managing the overall screen layout and delegating specific window rendering.
+    *   **Status Update:** Completed. `GtkRenderer` now handles specific GTK window rendering concerns, and `GtkEditor` acts as an orchestrator. Similar refactoring for TUI will be done in its respective phase.
 
 ---
 **Status Update: Modeline Framework Refactoring**
-(Reviewed: Core refactoring is successfully implemented. The `ModelineSegment` interface and `ModelineManager` provide a UI-agnostic content API (PLAN.md Subtask Y.1), and `GtkEditor::render_modeline_for_window()` effectively integrates with it to render styled chunks (PLAN.md Subtask Y.2). Noted areas for future refinement include: addressing the legacy `render_modeline()` function and direct `ThemeElement` usage in rendering (PLAN.md Subtask Y.4), and further modularizing UI rendering (PLAN.md Subtask Y.5).)
+(Reviewed: All subtasks for Phase Y (Y.1 to Y.5) have been completed. The `ModelineSegment` interface and `ModelineManager` provide a UI-agnostic content API, and `GtkEditor::render_modeline_for_window()` effectively integrates with it to render styled chunks. Modeline configuration is now flexible, allowing users to specify the order and presence of `ModelineSegment`s via Lua configuration. Modeline rendering now requests face attributes for standardized face names, aligning with the unified Face system. `GtkRenderer` now handles specific GTK window rendering concerns, and `GtkEditor` acts as an orchestrator. This marks the full completion of Phase Y.)
 
 ### Phase Z: Minibuffer Framework Refactoring
 
@@ -170,6 +175,7 @@ This phase aims to centralize and modularize the minibuffer logic, making it UI-
         *   Move input processing logic (e.g., handling `Enter`, `Escape`, `Tab`, `Backspace` within a minibuffer context) into methods of `MinibufferManager`.
         *   The `MinibufferManager` should interact with `EditorCore` for high-level actions (e.g., `load_file`, `switch_buffer`, `execute_command`) via injected interfaces (e.g., `ICommandExecutor`, `IBufferManager`).
         *   `TuiEditor` and `GtkEditor` will then delegate minibuffer input events to this central manager and query it for current state/content.
+    *   **Status Update:** Completed. `MinibufferManager` class implemented and centralizes all core minibuffer logic.
 
 *   **Subtask Z.2: Decouple Minibuffer History Management:**
     *   **Goal:** Create a reusable, UI-agnostic `HistoryManager` component.
@@ -178,6 +184,7 @@ This phase aims to centralize and modularize the minibuffer logic, making it UI-
         *   Create a generic `HistoryManager` class that can store and navigate a `std::vector<std::string>`.
         *   The `MinibufferManager` would then *own* instances of `HistoryManager` for each distinct type of history (command, file path, buffer name, isearch query).
         *   Remove duplicated history logic from `TuiEditor` and `GtkEditor`.
+    *   **Status Update:** Completed. `HistoryManager` class implemented and integrated with `MinibufferManager`.
 
 *   **Subtask Z.3: Create an Extensible Completion System:**
     *   **Goal:** Allow dynamic registration of completion sources for various minibuffer modes.
@@ -187,6 +194,7 @@ This phase aims to centralize and modularize the minibuffer logic, making it UI-
         *   Implement concrete `ICompletionSource`s for commands, buffer names, file paths, theme names, etc. These would query `EditorCore` or `CommandSystem` for data.
         *   The `MinibufferManager` would hold a map of `MinibufferPromptType` to `ICompletionSource*`, allowing it to dynamically get candidates based on the active mode.
         *   Refactor `update_completion_candidates()` (TUI) and `run_completion()` (GTK) to delegate to this new system.
+    *   **Status Update:** Completed. An extensible completion system with `ICompletionSource` implementations is integrated.
 
 *   **Subtask Z.4: Externalize Minibuffer Prompts and Message Display:**
     *   **Goal:** Enable dynamic and customizable minibuffer prompts.
@@ -195,12 +203,14 @@ This phase aims to centralize and modularize the minibuffer logic, making it UI-
         *   The `MinibufferManager` should expose methods to retrieve the current prompt text and the current input buffer content.
         *   Allow prompts to be generated dynamically (e.g., via Lua functions, similar to Emacs' `minibuffer-prompt-function`).
         *   Clearly separate `MinibufferPrompt` (interactive input) from `TransientMessage` (non-interactive, temporary display). These should be managed and displayed independently by the UI.
+    *   **Status Update:** Completed. Prompts and message display are now externalized and managed by `MinibufferManager`.
 
 *   **Subtask Z.5: UI-Agnostic Minibuffer Input Handling:**
     *   **Goal:** Both `TuiEditor` and `GtkEditor` should simply pass resolved key events to the `MinibufferManager` when a minibuffer mode is active.
     *   **Actions:**
         *   `TuiEditor::handle_input()` and `GtkEditor::on_key_pressed()` will call a single `MinibufferManager::handle_key_event(std::string key_name)` method when the editor is in a minibuffer-related mode.
         *   The `MinibufferManager` will then update its internal state, history, and completion, and return a result indicating if the event was handled, if the mode should exit, and if a UI redraw is needed.
+    *   **Status Update:** Completed. UI frontends now delegate minibuffer input handling to `MinibufferManager`.
 
 *   **Subtask Z.6: Refactor Minibuffer Rendering in Frontends:**
     *   **Goal:** Simplify minibuffer rendering in `TuiEditor` and `GtkEditor` to primarily focus on displaying content provided by `MinibufferManager`.
@@ -208,12 +218,14 @@ This phase aims to centralize and modularize the minibuffer logic, making it UI-
         *   `render_message_line()` (TUI) and `render_minibuffer()` (GTK) will query the `MinibufferManager` for the text to display (prompt + input buffer) and any associated styling information (e.g., current completion match).
         *   They will use faces like `"minibuffer-prompt"`, `"minibuffer-input"`, `"minibuffer-completion"`, `"minibuffer-match"` (aligned with Face system refactoring from Phase X) to style the output.
         *   GTK's specific rendering details (e.g., separator line, background shade) should be managed by a GTK-specific rendering component (potentially a `GtkMinibufferRenderer` class) that interprets the generic minibuffer face attributes.
+    *   **Status Update:** Completed. Minibuffer rendering in GTK now queries `MinibufferManager` for content, simplifying frontend rendering. (TUI rendering will be addressed in its phase).
 
 *   **Subtask Z.7: Remove Legacy ThemeElement Usage from Minibuffer:**
     *   **Goal:** Align minibuffer styling with the unified `Face` system (from Phase X).
     *   **Problem:** Minibuffer rendering currently relies on `ThemeElement::MinibufferPrompt`, `MinibufferInput`, etc., which are part of the legacy theme system.
     *   **Actions:**
         *   Once `ThemeElement` is removed as part of Phase X, update minibuffer rendering to directly request face attributes for standardized face names like `"minibuffer-prompt"`, `"minibuffer-input"`, etc.
+    *   **Status Update:** Completed. Minibuffer styling is now aligned with the unified Face system.
 
 ---
 **Status Update: Minibuffer Framework Refactoring**