Commit Graph

1863 Commits

Author SHA1 Message Date
Pedram Amini
62c2f8f4ee ## CHANGES
- Settings checkboxes upgraded into sleek right-aligned toggle switches 🎛️
- Full-row setting cards now toggle on click for faster changes 🖱️
- Keyboard accessibility added: Enter/Space toggles settings cleanly ⌨️
- Toggle buttons now prevent event bubbling for reliable interactions 🛑
- Context Window Warnings setting redesigned with the new toggle UI ⚠️
- Toggle styling now reflects theme colors for clearer on/off states 🎨
- Batch progress totals now track net task changes, not just additions 📈
- Document processor computes `totalTasksChange` for accurate task accounting 🧮
- Overall batch state updates now correctly handle added and completed tasks 🔄
2025-12-30 02:28:19 -06:00
Pedram Amini
4015ce8b02 ## CHANGES
- Polished Gist publish modal buttons with consistent small-text styling 🧩
- Prevented button label wrapping for cleaner, stable modal layouts 📐
2025-12-30 01:58:04 -06:00
Pedram Amini
396e74aa54 ## CHANGES
- Run git commands remotely via SSH with optional `sshRemoteId` support 🚀
- New `execGit` dispatcher seamlessly chooses local vs remote execution 🧭
- Git IPC handlers now accept remote working directory overrides for flexibility 🛰️
- Git handler registration injects settings store for SSH remote lookups 🧩
- SSH execution hardened: disable forwarding and TTY to avoid flaky runs 🛡️
- Document Graph fully rewritten to `react-force-graph-2d` for smoother visuals 🎛️
- Added focus mode with neighbor-depth slider for ego-network exploration 🔍
- Node size now reflects connection counts for instant relationship insight 📈
- Graph data builder decoupled from React Flow; positions handled by D3 physics 🧠
- Persistence now avoids saving empty sessions before initial load completes 🔒
2025-12-30 01:39:34 -06:00
Pedram Amini
621f60c6cd OAuth enabled but no valid token found. Starting authentication...
Found expired OAuth token, attempting refresh...
Token refresh successful
## CHANGES

- Bumped app version to 0.14.0 with fresh dependency refresh 🚀
- Added <a href="https://www.npmjs.com/package/react-force-graph-2d">react-force-graph-2d</a> for richer graph visualization options 🧠
- DocumentGraph layouts now use two-phase positioning for cleaner clusters 🧭
- External link nodes now sit on periphery/runs below hierarchy, reducing chaos 🪐
- Force layout spacing tuned for better readability and fewer overlaps 📐
- Added fallback grid layout when only external nodes exist 🧩
- SSH remote configs now persist `useSshConfig` and `sshConfigHost` metadata 🔐
- SSH Config host picker now supports filtering + keyboard navigation ⌨️
- SSH remote validation relaxed: username/key optional, leverage ssh-agent defaults 🗝️
- File explorer shows RTL-ellipsized cwd and double-click copies path 🎯
2025-12-30 00:32:06 -06:00
Pedram Amini
bc0db13cd7 ## CHANGES
- Added Escape-triggered “Close Document Graph?” confirmation modal for safety 🛡️
- Improved graph data loading: cache preserved unless settings or rootPath change 
- Resized Document Graph modal to a cleaner, consistent 90vw/90vh view 🖥️
- Repositioned legend to bottom-center for better visibility and balance 🧭
- Increased default node/rank spacing to reduce clutter and overlaps 📐
- Tuned force layout: stronger repulsion, collision, and longer link distances 🧲
- Extended force simulation iterations for more stable, converged layouts ⏱️
- Upgraded hierarchical layout: larger margins, better ranker, roomier nodes 🏗️
- Adjusted external link sizing/padding and edge min-length to avoid clustering 🔗
2025-12-29 19:13:04 -06:00
Pedram Amini
e025fba795 Merge pull request #118 from pedramamini/1-ssh-tunnel-agents
## CHANGES - Import SSH remotes straight from `~/.ssh/config` via new dropdown picker 🚀 - Run remotes using SSH Host patterns, not raw IPs anymore 🧭 - Username and private key become optional when SSH config is enabled 🔑 - SSH commands now omit `-i` unless you explicitly override keys 🎛️ - Default port 22 no longer forced; only send `-p` when overriding 🔌 - New SSH config parser supports HostName, User, Port, IdentityFile, ProxyJump 🧩 - Wildcard-only hosts (`Host *`, `dev-*`) are ignored for cleaner imports 🧹 - UI shows “Using SSH Config” indicator with one-click clear toggle 🏷️ - Added IPC + preload API to fetch SSH config hosts safely 🛡️ - Expanded test coverage for SSH-config mode command-building and parsing 
2025-12-29 19:11:28 -06:00
Pedram Amini
d5284434b8 ## CHANGES
- Import SSH remotes straight from `~/.ssh/config` via new dropdown picker 🚀
- Run remotes using SSH Host patterns, not raw IPs anymore 🧭
- Username and private key become optional when SSH config is enabled 🔑
- SSH commands now omit `-i` unless you explicitly override keys 🎛️
- Default port 22 no longer forced; only send `-p` when overriding 🔌
- New SSH config parser supports HostName, User, Port, IdentityFile, ProxyJump 🧩
- Wildcard-only hosts (`Host *`, `dev-*`) are ignored for cleaner imports 🧹
- UI shows “Using SSH Config” indicator with one-click clear toggle 🏷️
- Added IPC + preload API to fetch SSH config hosts safely 🛡️
- Expanded test coverage for SSH-config mode command-building and parsing 
2025-12-29 19:10:55 -06:00
Pedram Amini
43ec590475 ## CHANGES
- Bumped Maestro to v0.14.0 with a fresh release cutover 🚀
- Added self-serve “Resend Confirmation” for leaderboard token recovery 📧
- Wired new `leaderboard:resendConfirmation` IPC handler end-to-end 🧩
- Upgraded registration modal with resend-first flow, manual token fallback 🛟
- Added Quick Actions entry to open the Document Graph instantly 
- Document Graph now persists external-links toggle back into settings 💾
- Document Graph modal now preserves state across closes for continuity 🔒
- React Flow controls are fully theme-styled with dynamic injected CSS 🎨
- Improved graph layouts to reduce external-node overlap in both modes 🧭
- Wizard now detects provider errors and shows recovery hints + “Go Back” 🧠
2025-12-29 18:06:31 -06:00
Pedram Amini
6939fa2565 Merge pull request #111 from pedramamini/1-ssh-tunnel-agents
feat: SSH Remote Execution for AI Agents
2025-12-29 18:05:42 -06:00
Pedram Amini
558419a755 ## CHANGES
- Bumped Maestro version to 0.13.1 for the latest improvements 🚀
- Added Document Graph IPC handlers to enable live file watching 📈
- Introduced SSH Remote IPC handlers for managing saved SSH configurations 🛰️
- Added a dedicated SSH tab in Settings for cleaner navigation 🗂️
- Updated Settings keyboard tab-cycling to include the new SSH section ⌨️
- Refined Settings UI with a new Server icon for SSH tab branding 🖥️
- Moved SSH Remote hosts configuration into its own SSH Settings panel 🔐
2025-12-29 17:22:06 -06:00
Pedram Amini
43df1a42a6 docs: Add SSH Remote Execution documentation
Add comprehensive documentation for the SSH remote execution feature:
- New ssh-remote-execution.md with full guide
- Update configuration.md with SSH Remotes section reference
- Update features.md with feature highlight
- Add to docs.json navigation
2025-12-29 17:22:06 -06:00
Pedram Amini
431d3a04f1 dropped spec file 2025-12-29 17:22:06 -06:00
Pedram Amini
b3a490e0fa MAESTRO: Add SSH-specific error pattern detection (Phase 8 Tasks T042-T046)
Implements SSH-specific error handling in the process manager output parsing:

- Added SSH_ERROR_PATTERNS to error-patterns.ts covering:
  - permission_denied: SSH authentication failures, host key verification, passphrase prompts
  - network_error: Connection refused, timeouts, hostname resolution, network unreachable
  - agent_crashed: Command not found, agent binary missing, broken pipe, connection drops

- Integrated SSH error detection in process-manager.ts:
  - Checks stdout lines for SSH errors after agent-specific error detection
  - Checks stderr data for SSH errors (SSH errors typically appear on stderr)
  - Checks at process exit for any SSH errors that may have been missed

- Added helper functions:
  - matchSshErrorPattern(): Match a line against SSH-specific patterns
  - getSshErrorPatterns(): Get the SSH error patterns object

- Added 36 new tests for SSH error pattern detection covering all error categories

All 12,265 tests pass.
2025-12-29 17:22:06 -06:00
Pedram Amini
ea6fa534a4 MAESTRO: Implement SSH remote connection status visibility (Phase 7 Tasks T038-T041)
Added visual indicator in session header showing when an agent is running on a
remote SSH host. Implementation includes:

- Session type: Added sshRemote field to track active SSH remote (id, name, host)
- IPC event: Added process:ssh-remote event emitted after process spawn
- Event handler: Added onSshRemote listener in App.tsx to update session state
- UI indicator: Added purple-themed pill badge in MainPanel header with Server
  icon, remote name (truncated to 100px), and tooltip showing full details
- Test fixes: Added getMainWindow mock to process handler tests

The indicator only appears when a session is actively using SSH remote execution,
providing clear visibility into where agent commands are being run.
2025-12-29 17:22:06 -06:00
Pedram Amini
4dfc52ea96 MAESTRO: Mark Phase 6 tasks T033-T037 as completed (connection test functionality)
All Phase 6 tasks were already implemented as part of Phase 3 work:
- T033: ssh-remote:test handler in src/main/ipc/handlers/ssh-remote.ts
- T034: test IPC exposed in src/main/preload.ts
- T035: testConnection function in useSshRemotes hook
- T036: Test Connection button and result display in SshRemoteModal
- T037: Test button per remote in SshRemotesSection list

75 SSH-related tests pass confirming complete functionality.
2025-12-29 17:22:05 -06:00
Pedram Amini
4b90a5e0dc MAESTRO: Add SSH remote dropdown to per-agent configuration (Phase 5 Tasks T030-T032)
- Add SSH remote selection UI to AgentConfigPanel.tsx with dropdown options:
  - "Use Global Default" (follows global SSH remote setting)
  - "Force Local Execution" (override to run locally even if global default is set)
  - Individual SSH remotes by name
- Add status indicator showing effective remote (local vs. SSH with remote name)
- Update NewInstanceModal.tsx to:
  - Load SSH remote configurations when modal opens
  - Pass SSH remote props to AgentConfigPanel
  - Save SSH remote config to agent config store on create
- Update EditAgentModal to:
  - Load and display current SSH remote config
  - Save SSH remote config changes on save
- Add sshRemote mock to test setup for window.maestro API
- T032 was already implemented in Phase 4 (getSshRemoteConfig already checks agent override first)
2025-12-29 17:22:05 -06:00
Pedram Amini
3b74191af7 MAESTRO: Integrate SSH remote execution in process spawn (Phase 4 Tasks T027-T029)
Add SSH remote detection and command wrapping to the process:spawn IPC handler.
When an SSH remote is configured (global default or agent-specific override),
agent commands are wrapped with SSH for remote execution.

Changes:
- Import SSH utilities (getSshRemoteConfig, createSshRemoteStoreAdapter, buildSshCommand)
- Update MaestroSettings interface with sshRemotes and defaultSshRemoteId fields
- Add SSH remote resolution after agent args are built
- Wrap command with buildSshCommand when SSH remote is configured
- Disable PTY when using SSH (SSH handles terminal emulation)
- Pass custom env vars via remote command string, not locally
- Terminal sessions always run locally (need PTY for shell interaction)

Tests:
- 8 new unit tests for SSH remote execution scenarios
- All existing tests pass (12,232 tests)
2025-12-29 17:22:05 -06:00
Pedram Amini
f85615208d MAESTRO: Add SSH remote config resolver utility (Phase 4 Task T026)
- Create src/main/utils/ssh-remote-resolver.ts with:
  - getSshRemoteConfig(): Resolves effective SSH remote with priority order
    (agent-specific disabled > agent remoteId > global default > none)
  - createSshRemoteStoreAdapter(): Factory for wrapping electron-store
  - SshRemoteSettingsStore interface: Abstracts store for testability
  - SshRemoteResolveResult type: Returns config and resolution source

- Uses dependency injection for testability
- Validates remotes are enabled before returning
- Graceful fallback through priority chain

- Add 18 unit tests covering all resolution scenarios
2025-12-29 17:22:05 -06:00
Pedram Amini
34b50d8b15 MAESTRO: Add SSH command builder utilities (Phase 4 Tasks T024-T025)
Create buildSshCommand and buildRemoteCommand functions for remote agent execution:
- buildRemoteCommand: Constructs escaped shell command string with optional cwd and env vars
- buildSshCommand: Builds full SSH command with args for spawn(), merges config and command-specific options

Security: Command name not escaped (trusted from agent config), all user-controllable
values (args, cwd, env values) escaped via shellEscape, env var names validated.

Includes 29 unit tests covering command building, cwd handling, env merging,
tilde expansion, and injection prevention.
2025-12-29 17:22:05 -06:00
Pedram Amini
4c752eeead MAESTRO: Add SSH Remote UI components (Phase 3 Frontend)
- Create SshRemoteModal component for add/edit SSH remote configurations
  - Form fields: name, host, port, username, private key path
  - Optional: remote working directory, environment variables
  - Enabled toggle and connection testing with result display
  - Uses Modal and FormInput components for consistent UI

- Create SshRemotesSection component for Settings modal
  - Lists all SSH remotes with status badges (default, disabled)
  - Inline actions: test connection, set as default, edit, delete
  - Empty state with helpful instructions
  - Integrates with useSshRemotes hook

- Add SSH_REMOTE modal priority (460) in modalPriorities.ts
- Integrate SshRemotesSection into SettingsModal general tab
- Create Settings folder with index.ts exports
2025-12-29 17:22:05 -06:00
Pedram Amini
2e7ae3308d MAESTRO: Create useSshRemotes React hook for SSH remote configuration management
- Created `useSshRemotes` hook in `src/renderer/hooks/remote/useSshRemotes.ts`
  - Manages list of SSH remote configurations with local state caching
  - Tracks global default SSH remote ID
  - Provides CRUD operations (saveConfig, deleteConfig, refresh)
  - Supports connection testing with testingConfigId loading state
  - Handles errors gracefully with user-friendly messages
- Added `sshRemote` API type definitions to `src/renderer/global.d.ts`
- Exported hook from `src/renderer/hooks/remote/index.ts`
- Added 18 unit tests in `src/__tests__/renderer/hooks/useSshRemotes.test.ts`
2025-12-29 17:22:05 -06:00
Pedram Amini
b23af2a1a7 MAESTRO: Add SSH remote IPC handlers and expose API (Phase 3 Backend)
Implement backend infrastructure for SSH remote configuration management:
- Create ssh-remote.ts with 6 IPC handlers (saveConfig, deleteConfig, getConfigs, getDefaultId, setDefaultId, test)
- Register SSH remote handlers in index.ts
- Expose window.maestro.sshRemote API in preload.ts with full TypeScript types
- Update MaestroSettings to include sshRemotes and defaultSshRemoteId fields
- Add 19 unit tests for all IPC handlers
2025-12-29 17:22:04 -06:00
Pedram Amini
df088a17a7 MAESTRO: Implement SshRemoteManager with validation and connection testing (Phase 2)
- Create SshRemoteManager class with dependency injection for testability
- Implement validateConfig() for SSH remote configuration validation
  - Required fields: id, name, host, port, username, privateKeyPath
  - Port range validation (1-65535)
  - Private key file accessibility check
- Implement testConnection() for SSH connection testing
  - Executes SSH to verify connectivity and authentication
  - Retrieves remote hostname
  - Optional agent command availability check
  - User-friendly error messages for common SSH errors
- Implement buildSshArgs() for SSH command-line argument construction
  - Security options: BatchMode=yes, StrictHostKeyChecking=accept-new
  - ConnectTimeout=10 for connection reliability
  - Tilde expansion in private key paths
- Export sshRemoteManager singleton instance
- Add 38 comprehensive unit tests
2025-12-29 17:22:04 -06:00
Pedram Amini
fc1b9dbe6b MAESTRO: Add SSH remote execution types and shell-escape utility (Phase 1)
- Add SshRemoteConfig, SshRemoteStatus, SshRemoteTestResult, and
  AgentSshRemoteConfig interfaces to src/shared/types.ts
- Create shell-escape utility with shellEscape, shellEscapeArgs, and
  buildShellCommand functions for safe SSH command construction
- Add sshRemotes array and defaultSshRemoteId settings to store
- Add 14 unit tests for shell-escape utility

Phase 1 of SSH Remote Agent Execution feature (tasks T001-T006)
2025-12-29 17:22:04 -06:00
Pedram Amini
719b1afcdc ## CHANGES
- Added leaderboard delta submissions for seamless multi-device stat aggregation 🔁
- Leaderboard API now returns server totals for accurate synced progress 📊
- Synopses now summarize only work since the last synopsis timestamp ⏱️
- Tabs persist `lastSynopsisTime` to keep future summaries focused 🧠
- Auto-run synopsis prompt dynamically includes “time since last synopsis” context 🧾
- File Preview gains “Open in Document Graph” action for Markdown files 🗺️
- MainPanel now wires Document Graph opening through the preview flow 🧩
- UI toggle knobs fixed with correct left positioning across modals 🎛️
2025-12-29 17:17:37 -06:00
Pedram Amini
e3c37012c2 ## CHANGES
- Automatically record completed query stats with agent, project, and timing 📊
- Restore preview scroll only when content actually changes for smoothness 🧭
- Debounce search match counting to keep large documents snappy ⏱️
- Task completion counts now compute from saved content, not live edits 
- Token counting now tracks saved content updates for accurate totals 🧮
- Split markdown rendering components to avoid rebuilds during search 🔧
- Enable search highlighting only when active, reducing unnecessary work 🔦
2025-12-29 14:50:14 -06:00
Pedram Amini
d52660fca6 fix: remove explicit arch arrays from Linux targets to prevent cross-arch package contamination
Fixes #116 - electron-builder was building both x64 and arm64 packages on each
runner regardless of CLI flags, causing the ARM64 runner's amd64.deb (with ARM
binaries inside) to overwrite the correct x64 package during artifact deduplication.
2025-12-29 14:12:34 -06:00
Pedram Amini
fa62d78b1c ## CHANGES
- Hardened Linux releases with architecture-safe npm caching to prevent cross-contamination 🛡️
- Added Linux-only prebuild cache purges to avoid wrong-arch native binaries 🧹
- Force rebuild native modules per platform, with explicit x64/arm64 env targeting 🧬
- Cleaned node-pty and better-sqlite3 prebuild directories before Linux packaging 🧱
- Added x64 better-sqlite3 binary architecture verification step in CI 🔍
- Improved Auto Run error handling with rich history entries and recovery guidance 🧾
- Added toast notifications for Auto Run errors with friendly titles and details 🔔
- Extended history entry API to track success/failure for better visibility 
- Enhanced Auto Run pause logging with recoverability flags and raw error context 🧰
- Bumped version to 0.13.1 for this release rollout 🚀
2025-12-29 12:46:53 -06:00
Pedram Amini
7f223ec9e2 ## CHANGES
- Added keyboard shortcut hints to “Open Prompt Composer” tooltips 🧩
- Introduced `Shortcut`-aware props across input components for consistency ⌨️
- Centralized shortcut display formatting via `formatShortcutKeys` utility 🛠️
- Wired shortcuts from `MainPanel` through `InputArea` and `GroupChat` UI 🔗
- Improved discoverability of Prompt Composer without altering core behavior 🧠
2025-12-29 11:19:06 -06:00
Pedram Amini
947071fc8d ## CHANGES
- Markdown AutoRun prose now supports beautifully colored headings by default 🎨
2025-12-29 10:41:59 -06:00
Pedram Amini
dbc2885ec4 ## CHANGES
- Added automatic post-release docs sync, committing updated release notes to repo 📝
- Introduced `scripts/sync-release-notes.mjs` generating docs from GitHub releases via `gh` 🔄
- Published new `docs/releases.md` page with full versioned release history 📚
- Exposed Release Notes in Mintlify navigation under Reference docs section 🧭
- Strengthened Linux x64 packaging checks to hard-fail native arch mismatches 🛡️
- Expanded CI verification to include `better_sqlite3.node` alongside `pty.node` 🧩
2025-12-29 10:37:49 -06:00
Pedram Amini
b6e0d14059 ## CHANGES
- Version stamping now includes package.json version plus short git hash 🧩
- Local build label switched to clearer “(local)” suffix for sanity 🏷️
- Script now reads package.json robustly with safe “unknown” fallback 🛡️
- Added proper ESM path resolution using fileURLToPath/dirname utilities 🧭
2025-12-29 08:03:50 -06:00
Pedram Amini
b2aa5828dd ## CHANGES
- Marked `immer` as a peer dependency for cleaner installs and compatibility 🎯
2025-12-29 07:36:11 -06:00
Pedram Amini
47a3fda5ef Merge pull request #115 from pedramamini/graph-visuals
Usage Dashboard
2025-12-29 07:14:41 -06:00
Pedram Amini
e3f2f902ea ## CHANGES
- Added Usage Dashboard entry in hamburger menu with analytics preview 📊
- Introduced new global shortcut to open Usage Dashboard fast ⌨️
- Wired Usage Dashboard modal open/close handler through App and SessionList 🧩
- Added BarChart3 icon support across UI and tests for dashboard access 🧪
- Improved Usage Dashboard content styling with theme-based background color 🎨
2025-12-29 07:01:30 -06:00
Pedram Amini
2736816fbb ## CHANGES
- Added startup logs for userData, sync, and production config paths 🧭
- Sessions loader now logs count and backing store path for easier debugging 🔎
2025-12-29 06:46:17 -06:00
Pedram Amini
4aeb440d3f fix: update test setup and AutoRun tests for rebased code
- Add directorySize mock to fs API in test setup
- Fix Task Count Display tests with custom text matcher for fragmented text nodes
- Update success color assertion to check correct child element
2025-12-29 06:38:13 -06:00
Pedram Amini
a61fd7103c fix: resolve ESLint warnings in rebased code
- Fix unused variable warnings with void operator and underscore prefix
- Remove unnecessary eslint-disable comments
- Change let to const where variable is never reassigned
- Remove unused date-fns imports
- Remove unused loop index parameter
2025-12-29 06:28:09 -06:00
Pedram Amini
2c1696ccfb MAESTRO: Add Usage Dashboard and Document Graph documentation to CLAUDE.md
- Add 5 new entries to Key Files table for analytics, dashboard, graph, palettes, metrics
- Add Analytics & Visualization IPC API section documenting stats and documentGraph APIs
- Add comprehensive Usage Dashboard section with architecture, patterns, and settings
- Add comprehensive Document Graph section with architecture, patterns, and settings
2025-12-29 06:24:07 -06:00
Pedram Amini
b3c1babe34 MAESTRO: Add keyboard shortcut documentation for Usage Dashboard and Document Graph
Added comprehensive keyboard shortcuts section under Analytics & Visualization:

Usage Dashboard shortcuts:
- Arrow keys for view tab navigation
- Tab/Shift+Tab for section navigation
- Home/End for first/last section
- Escape to close

Document Graph shortcuts:
- Arrow keys for connected node navigation
- Tab to cycle connections
- Enter to open documents/links
- Escape to close

Also documented additional interactions: drag to reposition, scroll to zoom.
2025-12-29 06:23:24 -06:00
Pedram Amini
df97d674e6 MAESTRO: Add Usage Dashboard and Document Graph documentation to README
Added new "Analytics & Visualization" subsection under Features:
- Usage Dashboard: comprehensive analytics with time ranges, agent comparison,
  activity heatmaps, CSV export, real-time updates, colorblind-friendly palettes
- Document Graph: visual knowledge graph with wiki-links and markdown link discovery,
  force/hierarchical layouts, search/filter, keyboard navigation, external links

Added Usage Dashboard keyboard shortcut (Opt+Cmd+U / Alt+Ctrl+U) to shortcuts table.
2025-12-29 06:23:24 -06:00
Pedram Amini
88044eb1d1 MAESTRO: Add comprehensive Settings Integration for Usage & Stats features
- Add "Usage & Stats" settings section to SettingsModal with:
  - Enable/disable stats collection toggle (default: enabled)
  - Default dashboard time range dropdown (day/week/month/year/all)
  - Stats handlers check setting before recording queries/sessions

- Add "Document Graph" settings section with:
  - Default layout mode toggle (force-directed/hierarchical)
  - Show external links by default toggle (default: false)
  - Max nodes slider (50-1000, default: 200)

- Wire up all new settings:
  - useSettings.ts: 4 new settings with state, persistence, validation
  - SettingsModal: New UI controls in Data tab
  - UsageDashboardModal: defaultTimeRange prop with reset on open
  - DocumentGraphView: defaultShowExternalLinks & defaultMaxNodes props
  - stats.ts: Check statsCollectionEnabled before recording

- All settings persist via electron-store and load on app startup
2025-12-29 06:23:23 -06:00
Pedram Amini
d0a4c26ce5 MAESTRO: Add graceful handling for external URLs with special characters in Document Graph
Enhanced the markdown link parser regex to correctly handle external URLs
containing special characters, particularly parentheses which are common
in Wikipedia-style URLs.

Changes:
- Updated MARKDOWN_LINK_PATTERN regex to use balanced parentheses matching
- Pattern now uses (?:[^()\s]|\([^()]*\))+ to handle URLs like:
  - Wikipedia: /wiki/Term_(disambiguation)
  - Multiple parens: /path/(a)/(b)/file
  - Query params: ?q=test&page=1
  - Fragments: #section-2
  - Unicode paths: /文档/测试
  - Real-world URLs from GitHub, YouTube, etc.

Added 28 comprehensive tests covering:
- URLs with parentheses (4 tests)
- Query parameters (3 tests)
- Fragment identifiers (2 tests)
- Special domains with ports/IPs/auth (3 tests)
- Unicode and special characters (4 tests)
- extractDomain edge cases (6 tests)
- Complex real-world URLs (6 tests)
2025-12-29 06:23:23 -06:00
Pedram Amini
3504614b58 MAESTRO: Add comprehensive pagination tests for 1000+ markdown file directories
The Document Graph already had pagination implemented via DEFAULT_MAX_NODES
(50 initial), LOAD_MORE_INCREMENT (25 per click), and viewport culling.
This commit adds comprehensive tests verifying the pagination system works
correctly for very large directories.

New tests in large-directory-pagination.test.ts cover:
- Initial load limits (50 nodes from 1000+ files)
- Progressive loading via "Load more" functionality
- Pagination state accuracy (totalDocuments, loadedDocuments, hasMore)
- Edge creation only between loaded documents
- Memory efficiency with large datasets
- Progress callback behavior during large scans
- UI responsiveness during batch processing
- Edge cases: 1000, 1200, and 10,000+ file scenarios

All 639 tests pass across 11 Document Graph test files.
2025-12-29 06:23:23 -06:00
Pedram Amini
eac6b133d1 MAESTRO: Add graceful handling for large markdown files (>1MB) in Document Graph
- Add LARGE_FILE_THRESHOLD (1MB) and LARGE_FILE_PARSE_LIMIT (100KB) constants
- Truncate content for files >1MB to prevent UI blocking during parsing
- Add BATCH_SIZE_BEFORE_YIELD (5) for chunked processing with event loop yielding
- Add yieldToEventLoop() function using requestAnimationFrame for smooth UI
- Add isLargeFile property to DocumentStats interface for UI indication
- Update DocumentNode to show large file indicator icon (blue FileWarning icon)
- Add tooltip info explaining large file limitations (links may not be detected)
- Preserve accurate file size display even when content is truncated
- Add comprehensive test coverage for large file handling scenarios
2025-12-29 06:23:23 -06:00
Pedram Amini
18648e6709 MAESTRO: Add graceful error handling for malformed markdown in Document Graph
- markdownLinkParser.ts: Handle null/undefined/non-string content, invalid URL encoding, and add try-catch around regex parsing
- documentStats.ts: Handle null/undefined inputs for content, filePath, and fileSize with graceful fallbacks
- resolveRelativePath: Catch decodeURIComponent errors for malformed percent-encoding (e.g., %ZZ)
- Added 56 comprehensive tests for malformed markdown handling including:
  - Null/undefined/non-string content handling
  - Invalid percent-encoded URLs
  - Malformed front matter (missing closing delimiter, invalid YAML)
  - Malformed wiki and markdown links
  - Binary content with null bytes and control characters
  - Very long content and edge case combinations
2025-12-29 06:23:23 -06:00
Pedram Amini
b1a3a9d010 MAESTRO: Add comprehensive circular reference tests for layout algorithms
Verified that both force-directed and hierarchical layout algorithms correctly
handle circular references (A→B→C→A) without infinite loops. The codebase already
had a safe non-recursive design, but this adds explicit documentation tests.

Added 14 new tests in layoutAlgorithms.test.ts under "Circular Reference Handling":
- Force layout: simple chain, self-loop, bidirectional, multi-cycle, 50-node chain
- Hierarchical layout: same scenarios with layout direction verification
- Edge cases: entirely cyclic graphs, cycles with external links, multiple self-loops
2025-12-29 06:23:23 -06:00
Pedram Amini
acb686248b MAESTRO: Add broken internal link detection and warning indicator in Document Graph
- Added `brokenLinks` optional field to DocumentStats interface to track links
  pointing to non-existent files
- Modified graphDataBuilder to identify broken links by comparing internal link
  paths against the set of known file paths in the scanned directory
- Added warning triangle icon (AlertTriangle) to DocumentNode that displays when
  a document contains broken links - icon appears in amber/warning color next to title
- Enhanced tooltip to show list of broken links with emoji and path details
- Added "Status Indicators" section to GraphLegend explaining the broken links warning
- Added comprehensive test coverage:
  - 10 new tests for DocumentNode broken links warning UI
  - 10 new tests for graphDataBuilder broken link detection logic
2025-12-29 06:23:23 -06:00
Pedram Amini
c1aa77b7b3 MAESTRO: Add description truncation with tooltip for Document Graph nodes
- Update MAX_DESCRIPTION_LENGTH from 80 to 100 characters (as specified in design)
- Add tooltip showing full description when text is truncated
- Add isDescriptionTruncated flag for conditional tooltip display
- Add 9 comprehensive tests covering truncation behavior, tooltip, and edge cases
2025-12-29 06:23:23 -06:00
Pedram Amini
50da2bce32 MAESTRO: Add title truncation with ellipsis for Document Graph nodes
Long document titles (>40 chars) are now truncated with ellipsis.
Tooltip shows full title + file path when truncated, file path only otherwise.
Added 7 tests and updated 2 accessibility tests for new behavior.
2025-12-29 06:23:22 -06:00