Commit Graph

114 Commits

Author SHA1 Message Date
dishant-kumar-thakur
1e78b5e279 feat(phase-10): STRUCT-004 project format detection utility
Task: STRUCT-004
Branch: cline-dev-dishant
Cross-branch notes: none -- no shared dependencies with Richard phase 9/6 work

- ProjectFormatDetector class (injectable filesystem, fully testable)
- detect() async + detectSync() sync variants
- Detects legacy (project.json) vs v2 (nodegx.project.json + _registry.json)
- Returns { format, confidence, indicators } for transparent decision-making
- Scoring system: v2 needs score >= 2 to avoid false positives
- Errors in exists() treated as not-found (graceful degradation)
- V2_INDICATORS / LEGACY_INDICATORS sentinel constants exported
- createNodeDetector() factory for Node.js/test contexts
- Convenience methods: getFormat(), isV2(), isLegacy()
- 30 tests in tests/io/ProjectFormatDetector.test.ts
  - detect(): 12 cases (all combinations, async fs, error handling)
  - detectSync(): 4 cases (incl. throws on async fs)
  - Convenience methods: 7 cases
  - Constants: 3 cases
  - createNodeDetector() integration: 4 cases (real tmp dirs)
- Updated tests/io/index.ts to export detector tests
- Updated PROGRESS-dishant.md: STRUCT-001/002/003/004 all marked complete
2026-02-19 01:19:46 +05:30
dishant-kumar-thakur
d54e2a55a0 feat(phase-10): STRUCT-003 import engine core
Task: STRUCT-003
Branch: cline-dev-dishant
Cross-branch notes: none -- no shared dependencies with Richard phase 9/6 work

- ProjectImporter class (pure, filesystem-agnostic)
- Converts v2 multi-file format back to legacy project.json
- unflattenNodes: reconstructs recursive tree from flat NodeV2 array (two-pass)
- toLegacyName: uses preserved component.path for perfect round-trip fidelity
- Metadata merge: routes/styles merged back into project.metadata
- stateParameters -> stateParamaters reversal (legacy typo preserved)
- Non-fatal warnings: component failures collected, not thrown
- 55 unit tests in tests/io/ProjectImporter.test.ts
  - unflattenNodes: 11 cases
  - toLegacyName: 4 cases
  - ProjectImporter.import(): 20 cases
  - Round-trip (export -> import): 20 cases
- Updated tests/io/index.ts to export importer tests
- Updated PROGRESS-dishant.md: STRUCT-001/002/003 all marked complete
2026-02-19 01:07:22 +05:30
dishant-kumar-thakur
fbce66e0db feat(phase-10): STRUCT-002 export engine core
Task: STRUCT-002
Branch: cline-dev-dishant
Cross-branch notes: none  no shared dependencies with Richard's phase 9/6 work

- ProjectExporter class (pure, filesystem-agnostic)
- Converts legacy project.json to v2 multi-file format
- Outputs: nodegx.project.json, nodegx.routes.json, nodegx.styles.json,
  components/_registry.json, per-component component.json/nodes.json/connections.json
- Helper exports: legacyNameToPath, inferComponentType, flattenNodes, countNodes
- Full legacy type definitions (LegacyProject, LegacyComponent, LegacyNode, etc.)
- 50 unit tests in tests/io/ProjectExporter.test.ts
- Registered in tests/index.ts
2026-02-19 00:23:33 +05:30
dishant-kumar-thakur
f8d59cce0b feat(schemas): STRUCT-001 - JSON Schema Definition for v2 project format
Add 8 JSON schemas, SchemaValidator with Ajv v8, TS interfaces, and 33 tests.
All smoke tests passing. Critical path for STRUCT-002 (Export Engine).
2026-02-18 23:45:51 +05:30
dishant-kumar-thakur
83278b4370 feat(editor): CF11-007 canvas execution overlay
- Add ExecutionOverlay React component with header, node badges, data popup, timeline scrubber

- Add ExecutionNodeBadge: status badge positioned in canvas-space at each node

- Add ExecutionDataPopup: floating popup showing input/output/error data for selected node

- Add ExecutionTimeline: fixed scrubber bar with Prev/Next, range input, step dots

- Add #execution-overlay-layer DOM layer to nodegrapheditor.html

- Wire renderExecutionOverlay/updateExecutionOverlay into nodegrapheditor.ts

- Wire ExecutionHistoryPanel pin button via EventDispatcher execution:pinToCanvas event

- Add 20 unit tests for overlay utility functions

- Update PROGRESS-dishant.md: CF11-006 and CF11-007 both complete
2026-02-18 23:20:52 +05:30
dishant-kumar-thakur
7d373e0e50 feat(phase-11): CF11-006 Execution History Panel UI
- ExecutionHistoryPanel React component registered in sidebar (order 8.8)
- ExecutionList + ExecutionItem: scrollable list with status dots, duration, trigger type
- ExecutionDetail: summary, error display, trigger data, node steps
- NodeStepList + NodeStepItem: expandable rows with input/output JSON
- ExecutionFilters: status dropdown filter with clear button
- useExecutionHistory hook: IPC-based data fetching with filter support
- useExecutionDetail hook: single execution fetch with steps
- All styles use design tokens (no hardcoded colors)
- Unit tests: formatDuration, formatRelativeTime, buildExecutionQuery (Jasmine)
- CF11-007 canvas overlay integration point: onPinToCanvas prop stub

IPC channels expected from backend:
  execution-history:list (ExecutionQuery) -> WorkflowExecution[]
  execution-history:get (id) -> ExecutionWithSteps
2026-02-18 21:34:45 +05:30
Richard Osborne
297dfe0269 Added sprint protocol 2026-02-18 15:59:52 +01:00
Richard Osborne
bf07f1cb4a Added new github integration tasks 2026-01-18 14:38:32 +01:00
Richard Osborne
addd4d9c4a Fixed Logic Builder node bugs, expression field bugs, code editor bugs, property panel bugs 2026-01-16 17:23:31 +01:00
Richard Osborne
32a0a0885f Finished prototype local backends and expression editor 2026-01-16 12:00:31 +01:00
Richard Osborne
dac5330d4c fix(editor): use correct IPC transport pattern in useLocalBackends
Use window.require('electron').ipcRenderer.invoke() pattern which is
consistent with how GitHubOAuthService and other IPC calls work.

This fixes 'No IPC transport available' error when using local backends.
2026-01-15 18:47:20 +01:00
Richard Osborne
9181d5d83c fix(editor): replace prompt/confirm with proper dialogs in BackendServicesPanel
Electron doesn't support browser prompt()/confirm() APIs.
Replaced with:
- Inline TextInput form for creating local backends
- useConfirmationDialog hook for delete confirmations

Fixes console error when clicking + button on Local Backends section.
2026-01-15 18:43:01 +01:00
Richard Osborne
5f61317ca4 feat(editor): add local backends UI to BackendServicesPanel
- Add useLocalBackends hook for IPC communication with local backend server
- Create LocalBackendCard component for managing local SQLite backends
- Add 'Local Backends' section to BackendServicesPanel
- Support start/stop/delete operations for local backends
- Display status, endpoint URL, and port information

Part of TASK-007D: Launcher Integration
2026-01-15 18:30:42 +01:00
Richard Osborne
98fa779548 feat(local-backend): add WorkflowRunner for visual workflow execution
TASK-007C: Workflow Runtime Integration

- Add WorkflowRunner class to manage CloudRunner instances
- Integrate WorkflowRunner with LocalBackendServer
- Add workflow IPC handlers to BackendManager:
  - backend:update-workflow - Deploy/update a workflow
  - backend:reload-workflows - Hot reload all workflows
  - backend:workflow-status - Get workflow status
- LocalBackendServer now handles /functions/:name endpoints via WorkflowRunner
- WorkflowRunner loads .workflow.json files from backends/{id}/workflows/
2026-01-15 17:44:11 +01:00
Richard Osborne
ddcb9cd02e feat: Phase 5 BYOB foundation + Phase 3 GitHub integration
Phase 5 - BYOB Backend (TASK-007A/B):
- LocalSQL Adapter with full CloudStore API compatibility
- QueryBuilder translates Parse-style queries to SQL
- SchemaManager with PostgreSQL/Supabase export
- LocalBackendServer with REST endpoints
- BackendManager with IPC handlers for Electron
- In-memory fallback when better-sqlite3 unavailable

Phase 3 - GitHub Panel (GIT-004):
- Issues tab with list/detail views
- Pull Requests tab with list/detail views
- GitHub API client with OAuth support
- Repository info hook integration

Phase 3 - Editor UX Bugfixes (TASK-013):
- Legacy runtime detection banners
- Read-only enforcement for legacy projects
- Code editor modal close improvements
- Property panel stuck state fix
- Blockly node deletion and UI polish

Phase 11 - Cloud Functions Planning:
- Architecture documentation for workflow automation
- Execution history storage schema design
- Canvas overlay concept for debugging

Docs: Updated LEARNINGS.md and COMMON-ISSUES.md
2026-01-15 17:37:15 +01:00
Richard Osborne
8e49cbedc9 feat(adapter): add in-memory fallback when better-sqlite3 unavailable
When better-sqlite3 native module isn't installed/buildable, the adapter
now falls back to an in-memory mock implementation. This allows development
and testing without native compilation.
2026-01-15 17:19:23 +01:00
Richard Osborne
5badf8a8e3 fix(backend): use absolute path for adapter import
Fix module resolution when Electron runs from different cwd
2026-01-15 17:15:12 +01:00
Richard Osborne
c2e9f37129 feat(editor): integrate local backend IPC handlers
- Add setupBackendIPC() call in app.on('ready')
- Add backendManager.stopAll() cleanup on app before-quit
- Backend IPC now available for renderer process

Test with DevTools:
  await require('@electron/remote').ipcRenderer.invoke('backend:list')
  await require('@electron/remote').ipcRenderer.invoke('backend:create', 'Test')
  await require('@electron/remote').ipcRenderer.invoke('backend:start', backendId)
2026-01-15 16:37:21 +01:00
Richard Osborne
8c0f0c6797 feat(editor): add LocalBackendServer and BackendManager
TASK-007B: Local Backend Server (Phase 5 BYOB)

- Add LocalBackendServer with REST API for database CRUD
- Support /api/:table endpoints for query, create, update, delete
- Support /api/:table/:id for single record operations
- Support /api/_schema for schema management
- Support /api/_batch for batch operations
- Add placeholder for /functions/:name (CloudRunner integration)
- Add BackendManager for backend lifecycle (create, start, stop, delete)
- Add IPC handlers for renderer process communication
- Backends stored in ~/.noodl/backends/{id}/

Next: Integration with main process, UI for backend management
2026-01-15 16:34:42 +01:00
Richard Osborne
95bf2f363c feat(viewer-cloud): add ExecutionLogger for workflow execution tracking
CF11-005: Execution Logger Integration (Part 1 - Logger Class)

- Add ExecutionLogger class wrapping ExecutionStore
- Implement execution lifecycle: startExecution, completeExecution
- Implement node lifecycle: startNode, completeNode, skipNode
- Add configurable settings (enabled, captureInputs, captureOutputs)
- Add automatic data truncation for large payloads
- Add retention cleanup utility
- Add comprehensive unit tests with MockExecutionStore

CloudRunner integration (Part 2) deferred until Phase 5 TASK-007C
creates the workflow runtime engine.
2026-01-15 16:21:41 +01:00
Richard Osborne
8938fa6885 feat(viewer-cloud): add ExecutionStore for workflow execution history
CF11-004: Execution Storage Schema (Phase 11)

- Add TypeScript types for executions, steps, queries, and stats
- Add SQLite schema with workflow_executions and execution_steps tables
- Implement ExecutionStore class with full CRUD operations
- Support query filtering by workflow, status, trigger type, date range
- Support pagination with limit/offset
- Add retention utilities (cleanup by age, count, total)
- Add aggregated statistics (success rate, avg duration)
- Add unit tests with MockDatabase for all operations

Uses synchronous SQLite (better-sqlite3 compatible interface) for
performant local storage of execution history data.
2026-01-15 16:13:19 +01:00
Richard Osborne
72c9989a68 feat(runtime): add LocalSQL adapter for CloudStore interface
TASK-007A: LocalSQL Adapter (Phase 5/Phase 11 shared foundation)

- Add LocalSQLAdapter implementing CloudStore interface with SQLite backend
- Add QueryBuilder for Parse-style query to SQL translation
- Add SchemaManager for table creation, migrations, and exports
- Support all CloudStore methods: query, fetch, create, save, delete
- Support aggregate, distinct, increment, count operations
- Support relations via junction tables
- Add schema export to PostgreSQL and Supabase formats
- Add comprehensive unit tests for QueryBuilder

This adapter enables:
- Local offline database for development
- Foundation for Phase 11 execution history storage
- Schema migration path to production databases
2026-01-15 16:04:24 +01:00
Richard Osborne
39fe8fba27 Finished Blockly prototype, updated project template json 2026-01-12 13:23:12 +01:00
Richard Osborne
9b3b2991f5 feat(blockly): Phase C Step 7 COMPLETE - Code generation & port detection
Wired up complete code generation and I/O detection pipeline:
- Created BlocklyEditorGlobals to expose detectIO and generateCode
- Runtime node accesses detectIO via window.NoodlEditor
- Dynamic port updates based on workspace changes
- Full integration between editor and runtime
- Auto-initialization via side-effect import

Complete flow now works:
1. User edits blocks in BlocklyWorkspace
2. Workspace JSON saved to node parameter
3. IODetector scans workspace for inputs/outputs/signals
4. Dynamic ports created automatically
5. Code generated for runtime execution

Next: Testing and verification
2026-01-11 14:09:54 +01:00
Richard Osborne
4960f43df5 feat(blockly): Phase C Step 6 COMPLETE - Property panel Edit Blocks button
Implemented custom property editor for Logic Builder workspace:
- Created LogicBuilderWorkspaceType with styled button UI
- Added editorType='logic-builder-workspace' to node definition
- Registered LogicBuilderWorkspaceType in Ports.ts mapping
- Button emits LogicBuilder.OpenTab event with node details
- Integrated with existing property panel system

Next: Step 7 - Code generation and port detection
2026-01-11 14:07:32 +01:00
Richard Osborne
fbf01bf0f7 feat(blockly): Phase C Step 5 COMPLETE - NodeGraphEditor tab integration
Full integration of canvas tabs into NodeGraphEditor:
- Added renderCanvasTabs() method to render React tab system
- Added handleBlocklyWorkspaceChange() for workspace persistence
- Added cleanup in dispose() for React roots
- Added event listener for LogicBuilder.OpenTab events
- Tabs now render above canvas with provider wrapping

Ready for Phase C Steps 6-7 (property panel + code generation)
2026-01-11 14:00:51 +01:00
Richard Osborne
f861184b96 feat(blockly): Phase C Step 5 WIP - Add imports and template for tabs
- Updated nodegrapheditor.html template with canvas-tabs-root
- Added imports for CanvasTabsProvider and CanvasTabs
- Added canvasTabsRoot property to NodeGraphEditor class

Next: Add render logic and event handlers
2026-01-11 13:59:44 +01:00
Richard Osborne
30a70a4eb3 feat(blockly): Phase C Steps 1-4 - Core tab system components
Created complete tab system foundation:
- CanvasTabsContext: React Context for tab state management
- CanvasTabs component: Tab UI with canvas/Blockly switching
- Theme-aware SCSS styling using design tokens
- Full TypeScript types and exports

Next: Integrate into NodeGraphEditor, add property panel button
2026-01-11 13:55:04 +01:00
Richard Osborne
8039791d7e fix(blockly): Fix Logic Builder node color scheme crash
Changed category from 'Logic' to 'CustomCode' and color from 'purple' to 'javascript' to match Expression node pattern. This ensures the node picker can find the correct color scheme.

Fixes: EditorNode crash 'Cannot read properties of undefined (reading text)'
Issue: colors prop was undefined because color scheme 'purple' doesn't exist
2026-01-11 13:42:25 +01:00
Richard Osborne
5dc704d3d5 feat(blockly): Phase B1 - Register Logic Builder node
- Created IODetector utility to scan workspaces for I/O blocks
- Implemented Logic Builder runtime node with:
  - Dynamic port detection from workspace
  - Code execution context with Noodl API access
  - Signal input triggers for logic execution
  - Error handling and reporting
- Registered node in runtime and added to Custom Code category

The node should now appear in the node picker under Custom Code.
Next: Phase C - Tab system prototype

Part of TASK-012: Blockly Visual Logic Integration
2026-01-11 13:37:19 +01:00
Richard Osborne
554dd9f3b4 feat(blockly): Phase A foundation - Blockly setup, custom blocks, and generators
- Install blockly package (~500KB)
- Create BlocklyWorkspace React component with serialization
- Define custom Noodl blocks (Input/Output, Variables, Objects, Arrays)
- Implement JavaScript code generators for all custom blocks
- Add theme-aware styling for Blockly workspace
- Export initialization functions for easy integration

Part of TASK-012: Blockly Visual Logic Integration
2026-01-11 13:30:13 +01:00
Richard Osborne
6f08163590 new code editor 2026-01-11 09:48:20 +01:00
Richard Osborne
7fc49ae3a8 Tried to complete Github Oauth flow, failed for now 2026-01-10 00:04:52 +01:00
Richard Osborne
67b8ddc9c3 Added custom json edit to config tab 2026-01-08 13:27:38 +01:00
Richard Osborne
4a1080d547 Refactored dev-docs folder after multiple additions to organise correctly 2026-01-07 20:28:40 +01:00
Richard Osborne
3bf411d081 Added styles overhaul task docs 2026-01-06 00:27:56 +01:00
Richard Osborne
d144166f79 Tried to add data lineage view, implementation failed and requires rethink 2026-01-04 22:31:21 +01:00
Richard Osborne
bb9f4dfcc8 feat(topology): shelve Topology Map panel due to visual quality issues
- Disable Topology Map panel in router.setup.ts
- Comment out panel registration (line ~85)
- Add comprehensive SHELVED.md documentation explaining:
  * Why feature was shelved (SVG text layout complexity, visual quality)
  * What was implemented (graph analysis, folder aggregation, etc.)
  * Lessons learned and better approaches for future
  * Alternative enhancement suggestions
- Code remains in codebase for potential future revival
- Recommend React Flow or HTML/CSS approach instead of SVG
2026-01-04 20:07:25 +01:00
Richard Osborne
eb90c5a9c8 Added three new experimental views 2026-01-04 00:17:33 +01:00
Richard Osborne
2845b1b879 Added initial github integration 2026-01-01 21:15:51 +01:00
Richard Osborne
cfaf78fb15 Finished node canvas UI tweaks. Failed to add connection highlighting 2026-01-01 16:11:21 +01:00
Richard Osborne
2e46ab7ea7 Fixed visual issues with new dashboard and added folder attribution 2025-12-31 21:40:47 +01:00
Richard Osborne
73b5a42122 initial ux ui improvements and revised dashboard 2025-12-31 09:34:27 +01:00
Richard Osborne
ae7d3b8a8b New data query node for Directus backend integration 2025-12-30 11:55:30 +01:00
Richard Osborne
6fd59e83e6 Finished HTTP node creation and extensive node creation documentation in project 2025-12-29 08:56:46 +01:00
Richard Osborne
fad9f1006d Finished component sidebar updates, with one small bug remaining and documented 2025-12-28 22:07:29 +01:00
Richard Osborne
5f8ce8d667 Working on the editor component tree 2025-12-23 09:39:33 +01:00
Richard Osborne
89c7160de8 Made visual changes to the migration wizard 2025-12-21 11:27:41 +01:00
Richard Osborne
03a464f6ff React 19 runtime migration complete, AI-assisted migration underway 2025-12-20 23:32:50 +01:00
Richard Osborne
7d307066d8 Added some community improvement suggestions in docs 2025-12-17 09:30:30 +01:00