diff --git a/conductor/tracks.md b/conductor/tracks.md index 4072b07..64a0ff6 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -21,15 +21,19 @@ This file tracks all major tracks for the project. Each track has its own detail *Link: [./tracks/selectable_ui_text_20260308/](./tracks/selectable_ui_text_20260308/)* *Goal: Address UI inconveniences by making critical text across the GUI selectable and copyable. Covers discussion history, comms logs, tool outputs, and key metrics.* +4. [ ] **Track: Markdown Support & Syntax Highlighting** + *Link: [./tracks/markdown_highlighting_20260308/](./tracks/markdown_highlighting_20260308/)* + *Goal: Add rich text rendering with GFM support and syntax highlighting for PowerShell, Python, and JSON/TOML in read-only message and log views.* + --- ### C/C++ Language Support -4. [ ] **Track: Tree-Sitter C/C++ MCP Tools** +5. [ ] **Track: Tree-Sitter C/C++ MCP Tools** *Link: [./tracks/ts_cpp_tree_sitter_20260308/](./tracks/ts_cpp_tree_sitter_20260308/)* *Goal: Add tree-sitter C and C++ grammars. Extend ASTParser to support C/C++ skeleton and outline extraction. Add MCP tools ts_c_get_skeleton, ts_cpp_get_skeleton, ts_c_get_code_outline, ts_cpp_get_code_outline.* -5. [ ] **Track: Bootstrap gencpp Python Bindings** +6. [ ] **Track: Bootstrap gencpp Python Bindings** *Link: [./tracks/gencpp_python_bindings_20260308/](./tracks/gencpp_python_bindings_20260308/)* *Goal: Bootstrap standalone Python project with CFFI bindings for gencpp C library. Provides foundation for richer C++ AST parsing in future (beyond tree-sitter syntax).* @@ -37,26 +41,26 @@ This file tracks all major tracks for the project. Each track has its own detail ### Path Configuration -6. [ ] **Track: Project-Specific Conductor Directory** +7. [ ] **Track: Project-Specific Conductor Directory** *Link: [./tracks/project_conductor_dir_20260308/](./tracks/project_conductor_dir_20260308/)* *Goal: Make conductor directory per-project. Each project TOML can specify custom conductor dir for isolated track/state management.* -7. [ ] **Track: GUI Path Configuration in Context Hub** +8. [ ] **Track: GUI Path Configuration in Context Hub** *Link: [./tracks/gui_path_config_20260308/](./tracks/gui_path_config_20260308/)* *Goal: Add path configuration UI to Context Hub. Allow users to view and edit configurable paths directly from the GUI.* --- ### Manual UX Controls -8. [ ] **Track: Saved System Prompt Presets** +9. [ ] **Track: Saved System Prompt Presets** *Link: [./tracks/saved_presets_20260308/](./tracks/saved_presets_20260308/)* *Goal: Ability to have saved presets for global and project system prompts. Includes full AI profiles with temperature and top_p settings, managed via a dedicated GUI modal.* -9. [ ] **Track: Saved Tool Presets** +10. [ ] **Track: Saved Tool Presets** *Link: [./tracks/saved_tool_presets_20260308/](./tracks/saved_tool_presets_20260308/)* *Goal: Make agent tools have presets. Add flags for tools related to their level of approval (auto, ask). Move tools to ai settings. Put tools in dynamic TOML-defined categories (Python, General, etc.). Tool Presets added to mma agent role options.* -10. [ ] **Track: External Text Editor Integration for Approvals** +11. [ ] **Track: External Text Editor Integration for Approvals** *Link: [./tracks/external_editor_integration_20260308/](./tracks/external_editor_integration_20260308/)* *Goal: Add support to open files modified by agents in external editors (10xNotepad/VSCode) for native diffing and manual editing during the tool approval flow.* diff --git a/conductor/tracks/markdown_highlighting_20260308/index.md b/conductor/tracks/markdown_highlighting_20260308/index.md new file mode 100644 index 0000000..b9e92fc --- /dev/null +++ b/conductor/tracks/markdown_highlighting_20260308/index.md @@ -0,0 +1,5 @@ +# Track markdown_highlighting_20260308 Context + +- [Specification](./spec.md) +- [Implementation Plan](./plan.md) +- [Metadata](./metadata.json) diff --git a/conductor/tracks/markdown_highlighting_20260308/metadata.json b/conductor/tracks/markdown_highlighting_20260308/metadata.json new file mode 100644 index 0000000..1e23eed --- /dev/null +++ b/conductor/tracks/markdown_highlighting_20260308/metadata.json @@ -0,0 +1,8 @@ +{ + "track_id": "markdown_highlighting_20260308", + "type": "feature", + "status": "new", + "created_at": "2026-03-08T13:41:00Z", + "updated_at": "2026-03-08T13:41:00Z", + "description": "Add markdown support for message and response viewing in read-only views. Add syntax highlighting for content of text when we can resolve what type of content it is." +} diff --git a/conductor/tracks/markdown_highlighting_20260308/plan.md b/conductor/tracks/markdown_highlighting_20260308/plan.md new file mode 100644 index 0000000..f6d44a2 --- /dev/null +++ b/conductor/tracks/markdown_highlighting_20260308/plan.md @@ -0,0 +1,36 @@ +# Implementation Plan: Markdown Support & Syntax Highlighting + +## Phase 1: Markdown Integration & Setup +- [ ] Task: Research and configure `imgui_markdown` within the existing `imgui-bundle` environment. + - [ ] Identify required font assets for Markdown (bold, italic, headers). + - [ ] Create a `MarkdownRenderer` wrapper class in `src/markdown_helper.py` to manage styling and callbacks (links, etc.). +- [ ] Task: Implement basic Markdown rendering in a test panel. + - [ ] Verify that bold, italic, and headers render correctly using the defined theme fonts. +- [ ] Task: Conductor - User Manual Verification 'Phase 1: Markdown Integration' (Protocol in workflow.md) + +## Phase 2: Syntax Highlighting Implementation +- [ ] Task: Implement syntax highlighting for PowerShell, Python, and JSON/TOML. + - [ ] Research `imgui-bundle`'s recommended approach for syntax highlighting (e.g., using `ImGuiColorTextEdit` or specialized Markdown callbacks). + - [ ] Define language-specific color palettes that match the "Professional" theme. +- [ ] Task: Implement the language resolution logic. + - [ ] Create a utility to extract language tags from code blocks and resolve file extensions. + - [ ] Implement cheap heuristic for common code patterns (e.g., matching `def `, `if $`, `{ "`). +- [ ] Task: Conductor - User Manual Verification 'Phase 2: Syntax Highlighting' (Protocol in workflow.md) + +## Phase 3: GUI Integration (Read-Only Views) +- [ ] Task: Integrate Markdown rendering into the Discussion History. + - [ ] Replace `imgui.text_wrapped` in `_render_discussion_panel` with the `MarkdownRenderer`. + - [ ] Ensure that code blocks within AI messages are correctly highlighted. +- [ ] Task: Integrate syntax highlighting into the Comms Log. + - [ ] Update `_render_comms_history_panel` to render JSON/TOML payloads with highlighting. +- [ ] Task: Integrate syntax highlighting into the Operations/Tooling panels. + - [ ] Ensure PowerShell scripts and tool results are rendered with highlighting. +- [ ] Task: Conductor - User Manual Verification 'Phase 3: GUI Integration' (Protocol in workflow.md) + +## Phase 4: Refinement & Final Polish +- [ ] Task: Refine performance for large logs. + - [ ] Implement incremental rendering or caching for rendered Markdown blocks to maintain high FPS. +- [ ] Task: Implement clickable links. + - [ ] Handle link callbacks to open external URLs in the browser or local files in the configured text editor. +- [ ] Task: Conduct a final visual audit across all read-only views. +- [ ] Task: Conductor - User Manual Verification 'Phase 4: Final Polish' (Protocol in workflow.md) diff --git a/conductor/tracks/markdown_highlighting_20260308/spec.md b/conductor/tracks/markdown_highlighting_20260308/spec.md new file mode 100644 index 0000000..f3e2bd5 --- /dev/null +++ b/conductor/tracks/markdown_highlighting_20260308/spec.md @@ -0,0 +1,38 @@ +# Specification: Markdown Support & Syntax Highlighting + +## Overview +This track introduces rich text rendering to the Manual Slop GUI by adding support for GitHub-Flavored Markdown (GFM) in message and response views. It also adds syntax highlighting for code blocks and text content when the language context can be cheaply resolved (e.g., via known metadata or file extensions). + +## Functional Requirements +- **Markdown Rendering:** + - Integrate `imgui_markdown` (as provided by `imgui-bundle`) to render Markdown content in read-only views. + - Support standard GFM features: headers, bold/italic text, lists, and links. + - Ensure proper font and style mapping for Markdown elements within the application's theme. +- **Syntax Highlighting:** + - Implement syntax highlighting for the following languages: + - **PowerShell:** For AI-generated scripts and tool execution logs. + - **Python:** For codebase snippets and TDD tasks. + - **JSON/TOML:** For log payloads and configuration files. + - **Language Resolution Strategy:** + - Use explicit language tags in Markdown code blocks (e.g., ` ```python `). + - Use file extensions when rendering content originating from a file. + - Apply cheap heuristic deduction for common patterns if no explicit context exists. +- **GUI Integration:** + - Replace the basic `imgui.text_wrapped` rendering in the **Discussion History** and **Comms Log** panels with the new Markdown renderer. + - Ensure that syntax-highlighted blocks remain selectable and copyable (compatible with the "Selectable GUI Text" track). + +## Non-Functional Requirements +- **Performance:** Rendering Markdown and syntax highlighting must be efficient enough to handle large logs without significant frame rate drops. Use caching or incremental rendering if necessary. +- **Visual Consistency:** The highlighting colors and Markdown styles must align with the "Professional" UI theme overhaul. + +## Acceptance Criteria +- [ ] User and AI messages in the Discussion History render with Markdown formatting (bold, lists, etc.). +- [ ] Code blocks in messages are correctly syntax-highlighted for PowerShell and Python. +- [ ] JSON and TOML payloads in the Comms Log are syntax-highlighted. +- [ ] Links within Markdown content are clickable (e.g., opening URLs or local files). +- [ ] The renderer handles malformed Markdown gracefully without crashing the GUI. + +## Out of Scope +- Support for complex Markdown extensions like tables (unless natively supported by `imgui_markdown`). +- Inline image rendering within Markdown. +- Expensive AST-based language detection for every text block.