Skip to content
Draft
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a7473a7
Initial plan
Copilot Dec 25, 2025
5584796
Implement Phase 1: Core workflow infrastructure and engine
Copilot Dec 25, 2025
cb967bd
Add comprehensive tests and documentation for workflow system
Copilot Dec 25, 2025
3ea5e6a
Add workflow system implementation summary
Copilot Dec 25, 2025
fff9b90
Implement Phase 2: Built-in workflow nodes
Copilot Dec 25, 2025
729f84b
Implement Phase 3: Integrate workflow engine into CommandPaletteForm
Copilot Dec 25, 2025
d08f74b
Implement Phase 4: Add One-Time Prompt workflow nodes
Copilot Dec 25, 2025
c9ecb64
Add workflow switching support and One-Time Prompt trigger
Copilot Dec 25, 2025
28c8be2
Add workflow validation system with comprehensive tests
Copilot Dec 25, 2025
7784655
Complete Phase 5: Add comprehensive documentation and guides
Copilot Dec 25, 2025
4db4e6e
Add extensible list item rendering system integrated with workflow ar…
Copilot Dec 25, 2025
62e080a
Address comprehensive code review feedback
Copilot Dec 25, 2025
2a8408b
Add architecture proposal and project structure documentation for ext…
tamaygz Dec 25, 2025
b101edf
Add NuGet packages for advanced features (Phase 7.1)
Copilot Dec 25, 2025
afcc0c8
Implement Phases 1-7: Complete extensible workflow system with valida…
Copilot Dec 25, 2025
7e2d18c
Implement Phase 7.2: Capability Registry System (Complete)
Copilot Dec 25, 2025
fbb46b5
Implement Phase 7.3: Universal Actions Framework (Complete)
Copilot Dec 25, 2025
2d67b0b
Phase 7.4: Systematic integration - Wire actions framework with exist…
Copilot Dec 25, 2025
6441636
Phase 7.5: JSON Workflow Loading System - COMPLETE
Copilot Dec 25, 2025
9cfe3d7
Phase 7.5 COMPLETE: Full JSON workflow system with all 4 workflows + …
Copilot Dec 25, 2025
6a45656
Phase 8: Legacy Code Elimination - Remove _useWorkflowEngine flag + m…
Copilot Dec 25, 2025
83fbfa8
Phase 8.2: MASSIVE Legacy Code Elimination - 854 lines removed from C…
Copilot Dec 25, 2025
1cfe9e1
Phase 8.3: Final cleanup - Remove unused fields, reduce to 1,024 lines
Copilot Dec 25, 2025
7103a3d
CRITICAL FIX: Resolve async timing issue causing empty command palette
Copilot Dec 25, 2025
180854f
CRITICAL FIX v2: Ensure RenderNodeUI is always called for node comple…
Copilot Dec 25, 2025
7bc9a95
CRITICAL FIX v3: Remove misleading FilterResults warning - timing con…
Copilot Dec 25, 2025
33eff74
Refactor command palette workflow: Enhance logging, improve workflow …
tamaygz Dec 25, 2025
b9b738f
Refactor command palette and settings: Introduce workflow management,…
tamaygz Dec 25, 2025
8e9e4cc
Enhance hotkey configuration: Add support for optional second key and…
tamaygz Dec 25, 2025
88d887c
Add settings for window behavior: enable minimizing to tray and start…
tamaygz Dec 25, 2025
f2de965
Refactor command palette: Ensure text display panel is hidden during …
tamaygz Dec 31, 2025
3b73ed9
Refactor TextDisplayPanel: Update font handling to use Heading font f…
tamaygz Dec 31, 2025
3838972
Refactor CommandPaletteForm: Ensure TextDisplayPanel is hidden when C…
tamaygz Dec 31, 2025
bd4f977
CRITICAL FIX v4: Resolve workflow action execution bug - clear select…
Copilot Dec 31, 2025
16f866b
Refactor command palette navigation: Improve item selection and focus…
tamaygz Dec 31, 2025
61244ea
Merge branch 'copilot/refactor-command-palette-workflow' of https://g…
tamaygz Dec 31, 2025
94e6c44
CRITICAL FIX v5: Fix Quick Paste workflow - improve selectedItem life…
Copilot Dec 31, 2025
fa0131f
Refactor theme handling: Introduce ThemeOverride class for customizab…
tamaygz Dec 31, 2025
98ca23a
CRITICAL FIX v6: Fix empty palette on Copy/Paste actions - skip Rende…
Copilot Dec 31, 2025
80382ba
Refactor theming: Apply theme colors to ListView and TreeView control…
tamaygz Dec 31, 2025
948fe3f
Enhance Quick Paste workflow: Add conditional node for action selecti…
tamaygz Dec 31, 2025
22868f0
Refactor window management: Introduce IWindowService and WindowServic…
tamaygz Dec 31, 2025
ecd1827
Enhance window management: Add methods to refresh and set the last fo…
tamaygz Dec 31, 2025
15f9f3f
Refactor IsPromptArqWindow method: Simplify logic by removing fallbac…
tamaygz Dec 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
379 changes: 377 additions & 2 deletions WindowsApp/CommandPaletteForm.cs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions WindowsApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ static void Main()
LoggerConfig.Initialize();
Log.Information("PromptArq application starting");

// Configure dependency injection
ServiceConfiguration.Configure();
Log.Information("Service container configured");

// Ensure cleanup on ALL possible exit paths
Application.ApplicationExit += OnApplicationExit;
AppDomain.CurrentDomain.ProcessExit += OnProcessExit;
Expand Down Expand Up @@ -63,6 +67,7 @@ static void Main()
Log.Information("Application exiting, performing final cleanup");
ThemeManager.Instance?.Dispose();
UnifiedServerManager.Stop();
ServiceConfiguration.Dispose();
LoggerConfig.CloseAndFlush();
}
}
Expand Down
5 changes: 4 additions & 1 deletion WindowsApp/PromptAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public enum PromptActionType
Archive,
Restore,
Improve,
CoAuthorOneTimePrompt
CoAuthorOneTimePrompt,
ExecuteOneTimePrompt,
EditGeneratedPrompt
}

public class PromptAction
Expand Down Expand Up @@ -54,6 +56,7 @@ public class SystemPromptInfo
{
public string Id { get; set; } = "";
public string Name { get; set; } = "";
public string Description { get; set; } = "";
public string Content { get; set; } = "";
public string ScopeType { get; set; } = "";
public string? ScopeId { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions WindowsApp/PromptArqApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
117 changes: 117 additions & 0 deletions WindowsApp/ServiceConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using PromptArqApp.Workflow.Core;
using PromptArqApp.Workflow.Registry;
using PromptArqApp.Workflow.Plugins;
using Serilog;

namespace PromptArqApp
{
/// <summary>
/// Configures and provides the dependency injection container for the application.
/// </summary>
public static class ServiceConfiguration
{
private static IServiceProvider? _serviceProvider;

/// <summary>
/// Gets the configured service provider instance.
/// </summary>
public static IServiceProvider ServiceProvider
{
get
{
if (_serviceProvider == null)
{
throw new InvalidOperationException("ServiceProvider has not been configured. Call Configure() first.");
}
return _serviceProvider;
}
}

/// <summary>
/// Configures the service container with all application services.
/// </summary>
public static void Configure()
{
var services = new ServiceCollection();

// Core services
ConfigureCoreServices(services);

// Workflow services
ConfigureWorkflowServices(services);

// Build the service provider
_serviceProvider = services.BuildServiceProvider();

Log.Information("Service container configured successfully");
}

private static void ConfigureCoreServices(IServiceCollection services)
{
// Add logging (Serilog is already configured in LoggerConfig)
services.AddSingleton<ILogger>(Log.Logger);

// Add application settings
services.AddSingleton<AppSettings>(sp => AppSettings.Load());

// Add prompt history
services.AddSingleton<PromptHistory>(sp => PromptHistory.Load());

// NotificationManager is static, so no need to register it
}

private static void ConfigureWorkflowServices(IServiceCollection services)
{
// Register workflow registry as singleton
services.AddSingleton<IWorkflowRegistry>(sp =>
{
var registry = new WorkflowRegistry(sp);

// Register built-in workflows plugin
registry.RegisterPlugin(new BuiltInWorkflowsPlugin());

return registry;
});

// Register workflow engine as transient (new instance per resolve)
services.AddTransient<WorkflowEngine>();

Log.Information("Workflow services registered");
}

/// <summary>
/// Gets a required service from the container.
/// </summary>
/// <typeparam name="T">The service type.</typeparam>
/// <returns>The service instance.</returns>
public static T GetRequiredService<T>() where T : notnull
{
return ServiceProvider.GetRequiredService<T>();
}

/// <summary>
/// Gets a service from the container, or null if not registered.
/// </summary>
/// <typeparam name="T">The service type.</typeparam>
/// <returns>The service instance, or null.</returns>
public static T? GetService<T>() where T : class
{
return ServiceProvider.GetService<T>();
}

/// <summary>
/// Disposes the service provider if it implements IDisposable.
/// </summary>
public static void Dispose()
{
if (_serviceProvider is IDisposable disposable)
{
disposable.Dispose();
_serviceProvider = null;
Log.Information("Service container disposed");
}
}
}
}
116 changes: 116 additions & 0 deletions WindowsApp/Workflow/Core/INodeItemRenderer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
using System.Drawing;

namespace PromptArqApp.Workflow.Core
{
/// <summary>
/// Defines different rendering templates for list items in the command palette.
/// Templates provide consistent visual patterns while allowing customization.
/// </summary>
public enum ItemRenderTemplate
{
/// <summary>
/// Standard template: Icon on left (spans both rows), Row 1: main text, Row 2: hint/explanation
/// </summary>
Standard,

/// <summary>
/// Badge template: Colored badge on left, Row 1: title, Row 2: description
/// </summary>
Badge,

/// <summary>
/// Simple template: Single line text, centered vertically
/// </summary>
Simple,

/// <summary>
/// Detailed template: Icon on left, Row 1: title + metadata (right-aligned), Row 2: description
/// </summary>
Detailed,

/// <summary>
/// Custom template: Node provides complete custom rendering logic
/// </summary>
Custom
}

/// <summary>
/// Contains all data needed to render a list item.
/// Nodes populate this structure to control how their items appear.
/// </summary>
public class ItemRenderData
{
/// <summary>
/// Primary text displayed on the first row (required)
/// </summary>
public string MainText { get; set; } = "";

/// <summary>
/// Secondary text displayed on the second row (optional)
/// </summary>
public string? SecondaryText { get; set; }

/// <summary>
/// Icon/emoji displayed on the left (optional)
/// </summary>
public string? Icon { get; set; }

/// <summary>
/// Badge text for Badge template (e.g., "SYS", "PRJ") (optional)
/// </summary>
public string? BadgeText { get; set; }

/// <summary>
/// Badge background color for Badge template (optional)
/// </summary>
public Color? BadgeColor { get; set; }

/// <summary>
/// Custom color for the item (optional)
/// </summary>
public Color? ItemColor { get; set; }

/// <summary>
/// Metadata text displayed on the right side of row 1 for Detailed template (optional)
/// </summary>
public string? MetadataText { get; set; }

/// <summary>
/// The rendering template to use
/// </summary>
public ItemRenderTemplate Template { get; set; } = ItemRenderTemplate.Standard;

/// <summary>
/// Reference to the original item being rendered
/// </summary>
public object? OriginalItem { get; set; }
}

/// <summary>
/// Extended interface for nodes that want to control their item rendering.
/// This allows nodes to specify how each item should be displayed using templates.
/// </summary>
public interface INodeItemRenderer
{
/// <summary>
/// Gets the render data for an item, specifying how it should be displayed.
/// </summary>
/// <param name="item">The item to get render data for.</param>
/// <returns>ItemRenderData containing all rendering information.</returns>
ItemRenderData GetItemRenderData(object item);

/// <summary>
/// Optional: Provides custom rendering for items when Template is Custom.
/// Return false to fall back to default rendering.
/// </summary>
/// <param name="graphics">Graphics object for drawing.</param>
/// <param name="bounds">Bounds rectangle for the item.</param>
/// <param name="item">The item to render.</param>
/// <param name="isSelected">Whether the item is currently selected.</param>
/// <returns>True if custom rendering was performed, false to use default.</returns>
bool CustomRenderItem(Graphics graphics, Rectangle bounds, object item, bool isSelected)
{
return false; // Default: no custom rendering
}
}
}
Loading
Loading