Commit Graph

407 Commits

  • refactor(dashboard): rename gold CSS variables to accent
    Rename all gold-related CSS custom properties, Tailwind classes,
    and keyframe animations from "gold" to "accent" to prepare for
    the theme system where the accent color is user-configurable.
    
    - --color-gold -> --color-accent (plus -dim and -bright variants)
    - @keyframes goldPulse -> accentPulse
    - .animate-gold-pulse -> .animate-accent-pulse
    - All text-gold, bg-gold, border-gold, ring-gold Tailwind classes
    
    No behavioral or visual change — pure mechanical rename.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • refactor(dashboard): remove swim-lane flow view
    The swim-lane layout needs more design work before shipping. Remove the
    flow view toggle, useFlowViewGraph hook, applySwimLaneLayout, and
    related store/breadcrumb code. Hierarchical lens navigation is retained.
  • Merge pull request #42 from Lum1104/feat/dashboard-robustness
    feat: dashboard robustness — permissive graph loading with user-friendly warnings
  • feat(dashboard): surface graph validation issues and add messy graph fixtures
    Add a --messy mode to the large graph generator so robustness cases can be
      tested with null fields, aliases, dangling refs, and other malformed data.
    
      Update the dashboard to preserve non-fatal validation issues, log
      auto-corrected and dropped items, and show a warning banner with expandable
      details plus copy-to-clipboard support.
  • feat(core): permissive graph validation with tiered auto-fix pipeline
    - Add sanitizeGraph (Tier 1): null cleanup, lowercase enums
    - Add autoFixGraph (Tier 2): default missing fields, alias maps, weight coercion
    - Rewrite validateGraph: per-item validation, drop broken items, referential integrity
    - Add GraphIssue type for structured issue tracking
    - Update persistence layer for new ValidationResult API
    - 52 schema tests covering all tiers
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Expand core tests and add vitest coverage dep
    Add several unit tests to improve robustness and coverage across the core package: plugin-discovery (handle missing/invalid plugins field and add serializePluginConfig tests), plugin-registry (unregister behavior, language detection, and import resolution delegation), persistence (invalid graph validation and option to skip validation), and tree-sitter-plugin (export aliases and arrow functions without params). Also add @vitest/coverage-v8 as a devDependency to enable V8-based coverage reporting.
  • Merge pull request #37 from Lum1104/fix/normalize-llm-type-aliases
    fix: normalize LLM-generated type aliases before schema validation
  • test: add alias chain detection guards
    Ensures no alias value is itself an alias key, which would cause
    single-pass normalization to produce a non-canonical value that
    Zod then rejects. Catches this class of bug at test time.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • fix: remove unsafe tests→tested_by alias that inverts edge direction
    The "tests" alias silently rewrites to "tested_by" without swapping
    source/target, which inverts the relationship meaning and produces
    incorrect edges. Direction-inverting aliases should fail validation
    so the LLM gets explicit feedback to fix the edge.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • fix: normalize LLM-generated type aliases before schema validation
    LLMs systematically abbreviate node types (e.g. "func" instead of
    "function") and edge types (e.g. "extends" instead of "inherits"),
    causing dashboard validation failures. This combines two fixes:
    
    Option A: Rename the ambiguous `func:` ID prefix to `function:` across
    all prompts, source code, tests, and example data so LLMs see consistent
    naming. Also fix `relates_to` ghost edge type in django.md.
    
    Option B: Add NODE_TYPE_ALIASES and EDGE_TYPE_ALIASES normalization maps
    in schema.ts that transparently correct common abbreviations before Zod
    validation, as a runtime safety net.
    
    Closes #36
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Merge branch 'main' of github.com:fishinakleinbottle/Understand-Anything into feat/improve-dashboard-ux
    # Conflicts:
    #	understand-anything-plugin/packages/dashboard/src/App.tsx
    #	understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx
    #	understand-anything-plugin/packages/dashboard/src/utils/layout.ts
  • feat: lens-based graph navigation with flow view and sidebar history
    Replace flat all-nodes-at-once graph with a two-level drill-down:
    - Level 1: layer cluster nodes (free-form graph of architectural layers)
    - Level 2: file nodes within a layer + portal nodes to adjacent layers
    - Breadcrumb navigation with Escape key to go back
    
    Add swim-lane "Flow" view showing all files in columns ordered by
    request lifecycle (API → Middleware → Service → Data → etc.) using
    dagre for within-lane vertical positioning.
    
    Sidebar improvements:
    - Navigation history trail (← Back + clickable breadcrumbs)
    - Directional connection labels (imports/imported by, contains/contained in)
    - Separate "Defined in this file" section for child classes/functions
    - Fix search dropdown overlapping breadcrumbs (z-index)
    - Remove redundant CodeViewer auto-open on node click
    
    Layer detector: add External Services and Background Tasks patterns.
  • Merge pull request #32 from fishinakleinbottle/feat/language-agnostic-understanding
    feat: language-agnostic analysis with dynamic prompt injection
  • Merge pull request #23 from mengdehong/main
    fix(dashboard): optimize pan/zoom performance for large graphs
  • fix(dashboard): optimize pan/zoom interaction performance
    - Widen transition to [box-shadow,outline,opacity,filter] to exclude
      transform (the pan/zoom culprit) while preserving ring animations
      (Tailwind v4 outline) and diff-fade opacity/filter transitions
    - Replace inline boxShadow with Tailwind shadow-[] utility so
      .node-glow/.diff-*-glow CSS classes compose correctly
    - Disable nodesDraggable, nodesConnectable, edgesFocusable,
      edgesReconnectable, elementsSelectable for read-only visualization
  • chore: bump version to 1.2.0 and sync all plugin manifests
    - Sync .claude-plugin/plugin.json (was stuck at 1.1.0) and .cursor-plugin/plugin.json (was 1.0.5) to match main version
    - Update CLAUDE.md versioning section to list all four files that must be kept in sync
    - Document scripts/generate-large-graph.mjs in CLAUDE.md
  • Merge pull request #18 from AnnulusLabs/fix/large-graph-dashboard-perf
    fix: move dagre layout to Web Worker for large graphs
  • chore: add large graph generator script for perf testing
    Generates fake knowledge-graph.json with configurable node count
    for testing Web Worker layout performance. Forward-only edges to
    avoid dagre stack overflow on cyclic graphs.
    
    Usage: node scripts/generate-large-graph.mjs [nodeCount]
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • docs: add Gemini CLI and Pi Agent platform support
    Add INSTALL.md for Gemini CLI and Pi Agent, and update all four
    READMEs (EN, ZH, JA, TR) with install instructions and compatibility
    table entries.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • fix: keyboard shortcuts bugs and add shortcut hint
    - Fix ? shortcut: add shiftKey: true so it matches on standard keyboards
    - Fix Escape: keep hook always enabled so ESC closes the modal
      (remove dead showKeyboardHelp branch, read all state at invocation time)
    - Fix formatShortcutKey: don't show redundant ⇧ for shifted punctuation
    - Remove stale showKeyboardHelp from useMemo deps
    - Add "Press ? for keyboard shortcuts" hint in graph area
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Specify host in Vite dev server command
    Updated Vite dev server command to specify host.
  • Implement access token and enhance endpoint security
    Added a one-time access token for secure data fetching and improved endpoint protection.
  • Refactor keyboard shortcuts; add Turkish README
    Use dashboard store state at handler runtime and simplify shortcut wiring to avoid stale closures. App.tsx: replace many useDashboardStore selectors with runtime getState() calls inside keyboard shortcut actions and reduce useMemo dependencies to showKeyboardHelp. KeyboardShortcutsHelp.tsx: remove local Escape key effect (handled globally). useKeyboardShortcuts.ts: ignore shortcuts while typing in inputs/textareas/contentEditable (allow Escape), and improve Mac detection via userAgentData.platform fallback; use the same isMac flag in formatShortcutKey. README (zh-CN & ja-JP): add link to Turkish README (README.tr-TR.md).
  • fix: move dagre layout to Web Worker for large graphs
    Fixes #14 — dashboard becomes unusable with large knowledge graphs (2,700+ nodes).
    
    - Web Worker for dagre layout: graphs above 200 nodes compute layout off the
      main thread via a dedicated Web Worker, keeping the UI responsive
    - Request ID correlation: concurrent layout calls are routed by incrementing
      request ID, preventing race conditions where results cross-wire
    - Worker error handling: onerror rejects pending promises; GraphView catches
      errors and clears the loading spinner
    - Cancellation cleanup: effect cleanup clears layouting state to prevent
      stuck spinners when the graph switches below the async threshold
    - Topology/visual split: dagre only re-runs when graph structure changes;
      node selection, tour highlights, and search results are applied as a
      cheap O(n) overlay without triggering relayout
    - React.memo on CustomNode: prevents O(n) re-renders when selecting
      individual nodes in large graphs
    - Zero overhead for small graphs: below 200 nodes, the original synchronous
      layout path is used unchanged
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  • fix: address PR review feedback (C1-C4, I1-I5)
    Critical fixes:
    - C1: Remove unused treeSitter.nodeTypes from configs and schema — extraction
      logic is TS/JS-specific, nodeTypes gave false impression of generality
    - C2+C3: Remove blocking temp dir prompt, default to .understand-anything/tmp/,
      update all 5 prompt templates to use project-local paths instead of /tmp/
    - C4: Fix false-positive framework detection — use "next": (with quotes) for
      Next.js, remove cors/body-parser from Express keywords
    
    Important fixes:
    - I1: Change FrameworkConfig.language to languages[] array — React/Express/Vue
      now correctly listed under both typescript and javascript
    - I2: Fix getByExtension case sensitivity — .TS now resolves same as .ts
    - I3: languageKeyFromPath returns null instead of throwing for unknown extensions
    - I4: Duplicate framework registration is now a no-op instead of corrupting array
    - I5: SKILL.md now says "skip silently" when language/framework snippet not found
    
    Also: getForLanguage returns a defensive copy, 3 new tests added (157 total).
  • Update OpenCode instructions in Turkish README
    Replace the previous opencode.json example with a directive to fetch and follow the INSTALL.md from the Understand-Anything repo's .opencode path. Also update the OpenCode table entry to indicate "AI güdümlü kurulum" (AI-guided installation). Changes apply to README.tr-TR.md to streamline installation instructions.
  • Merge pull request #13 from Lum1104/feat/language-agnostic-support
    feat: language-agnostic support for 12 languages
  • Merge pull request #26 from Lum1104/refactor/unify-skills-install
    refactor: unify skills install method across all platforms
  • feat: improve dashboard navigation for large graphs
    - Enable touchpad panning (panOnScroll) so two-finger scroll pans
      instead of zooming
    - Color-code layer groups with distinct colors (blue, green, purple,
      gold, pink, teal, slate) instead of identical gold for all layers
    - Show NodeInfo panel alongside LearnPanel when a node is clicked,
      so connections are always accessible regardless of persona mode
    - Add clickable connections in NodeInfo sidebar that navigate and
      zoom to the target node
    - Add edge highlighting on node selection: connected edges glow,
      unrelated nodes/edges dim to 20% opacity
    - Add focus mode to isolate a node's 1-hop neighborhood
    - Set minZoom=0.05, maxZoom=4, and scale dagre spacing for 50+ nodes
  • feat: add hooks for auto-update prompts and change classification logic
    - Introduced hooks in `hooks.json` for PostToolUse and SessionStart events to prompt users about knowledge graph updates based on commit and session changes.
    - Implemented `change-classifier.ts` to classify updates based on structural changes, including SKIP, PARTIAL_UPDATE, ARCHITECTURE_UPDATE, and FULL_UPDATE actions.
    - Added comprehensive tests for change classification in `change-classifier.test.ts` to ensure correct behavior across various scenarios.
    - Created `fingerprint.ts` to manage file fingerprints, including content hashing, structural analysis, and comparison of fingerprints to detect changes.
    - Developed tests for fingerprint extraction and comparison in `fingerprint.test.ts` to validate functionality and ensure accurate change detection.
  • fix: ask user for temp directory and improve prompt discovery
    - Add blocking step in Phase 0 asking where to write temp files
      ($PROJECT_ROOT/.understand-anything/tmp/ or /tmp/), with explicit
      STOP-and-wait language to prevent premature execution
    - Make language/framework file discovery explicit in Phase 2 and
      Phase 4 with concrete path examples and ls fallback, fixing
      issue where Claude's Search tool couldn't find files in subdirs
    - Clean up $TMP_DIR alongside intermediate files in Phase 7
  • Add keyboard shortcuts UI and CONTRIBUTING.md
    Introduce keyboard shortcuts to the dashboard and add contributor docs. Adds a reusable useKeyboardShortcuts hook (with formatShortcutKey), a KeyboardShortcutsHelp modal component, and integrates shortcuts into App.tsx (registering keys like ?, Escape, /, ArrowLeft/Right, l, d and wiring store actions). Adds related styles (.glass-heavy, .kbd) to index.css. Also adds a comprehensive CONTRIBUTING.md with setup, workflow, testing, and PR guidelines.
  • Add Turkish README and update language links
    Add a new Turkish translation file README.tr-TR.md with the full localized documentation and quickstart instructions. Update README.md to include a link to the Turkish README in the language selector so Turkish-speaking users can access the translated docs.
  • refactor: unify skills install method across all platforms
    Replace platform-specific install approaches with a consistent
    per-skill symlink pattern for OpenCode and Codex (both share
    ~/.agents/skills/), matching the OpenCode docs requirement of
    <name>/SKILL.md discovery.
    
    Changes:
    - OpenCode: migrate from opencode.json plugin config to direct
      skill symlinks in ~/.agents/skills/<name>/
    - Codex: replace broken bundle symlink (understand-anything/ had
      no SKILL.md at root) with individual per-skill symlinks, matching
      OpenCode exactly
    - All platforms: add universal ~/.understand-anything-plugin symlink
      so understand-dashboard SKILL.md can reliably find packages/dashboard/
    - All platforms: use idempotent [ -e ] || [ -L ] || ln -s guard to
      handle multi-platform installs on the same machine
    - All platforms: use ln -sf and rm -f for robust re-installs and
      partial uninstalls
    - understand-dashboard/SKILL.md: replace fragile dirname-based path
      resolution with a prioritized candidate loop with explicit error
      guard
    - Remove orphaned .opencode/plugins/understand-anything.js and its
      build scaffolding
    - Update all three README variants (en, zh-CN, ja-JP) to reflect
      new OpenCode AI-driven install method
    
    Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
  • feat: language-agnostic analysis with config-driven registry and framework detection
    Replace the TypeScript/JavaScript-biased analysis pipeline with a truly
    language-agnostic system. The core architecture was already language-neutral
    (graph schema, dashboard, search) — the bias lived in agent prompts,
    tree-sitter plugin, and language-lesson system.
    
    Core changes:
    - LanguageConfig + FrameworkConfig types with Zod validation
    - LanguageRegistry (12 languages) and FrameworkRegistry (10 frameworks)
    - Config-driven TreeSitterPlugin replacing hardcoded TS/JS grammars
    - PluginRegistry now delegates to LanguageRegistry for extension mapping
    - Language-lesson system uses config for display names and concepts
    
    Prompt system:
    - SKILL.md generalized: dynamic injection of language snippets and
      framework addendums instead of hardcoded if/else conditionals
    - 12 language prompt snippets (languages/*.md) with concepts, patterns,
      frameworks per language
    - 10 framework addendums (frameworks/*.md) with canonical file roles,
      edge patterns, architectural layers — Django/FastAPI/Flask preserved
      and split, plus React/Next.js/Express/Vue/Spring/Rails/Gin added
    - Extended entry points, directory patterns, and test patterns across
      all 12 language ecosystems in base prompts