Skip to content

1.0.47

Choose a tag to compare

@morapelker morapelker released this 28 Feb 20:08
· 2903 commits to main since this release

What's Changed

Add worktree context injection and disable command filtering by default (#78)

  • Worktree-specific context: Adds a new context column to the worktrees table (schema v8) that allows users to write markdown context per worktree. This context is automatically injected into the first prompt of each new AI session, providing persistent background information (e.g., feature descriptions, API endpoints, conventions) without requiring manual re-entry.
  • Context editor UI: New WorktreeContextEditor component with edit/preview modes, markdown rendering, Cmd+S save shortcut, unsaved-changes protection, and a dedicated tab in the session tabs bar. Accessible via "Edit Context" in worktree dropdown/context menus.
  • Context duplication: When duplicating a worktree, the source worktree's context is automatically copied to the new worktree.
  • Command filtering default disabled: Changes the default commandFiltering.enabled setting from true to false so new sessions start without command filtering restrictions.

Fix run tab lag: reduce buffer limits, line-split output, optimize URL detection (#77)

Fixes performance issues causing the Run tab to become laggy during high-output script execution.

  • Reduced ring buffer limits: Lowered MAX_CHARS from 500K → 200K and BUFFER_CAPACITY from 50K → 10K entries to reduce memory pressure and improve rendering performance
  • Line-split output before buffering: Script output (event.data) is now split by newlines before appending to the ring buffer — each entry is a single line instead of a raw multi-line chunk. Applied to both useScriptStore (run scripts) and useWorktreeStore (setup scripts)
  • Optimized dev server URL detection: Replaced useMemo with useEffect + useState in BottomPanel — once a URL is detected, scanning stops entirely with zero cost per subsequent output version bump. Resets on run stop so the next run can detect a fresh URL
  • Updated tests: Adjusted buffer limit assertions to match new 200K cap; exported MAX_CHARS constant from output-ring-buffer.ts for DRY test assertions

Add worktree-specific context with editor UI and session injection (#76)

Adds a worktree-specific context feature that allows users to attach custom context/instructions to individual worktrees. This context is automatically injected into AI coding sessions on the first prompt, giving per-worktree guidance to the AI assistant.

What's included

  • Database layer (schema v8): New nullable context TEXT column on the worktrees table, with migration, type updates across main/preload layers, updateWorktreeContext and getWorktreeByPath DB methods
  • IPC & preload bridge: worktree:getContext and worktree:updateContext channels exposed via window.worktreeOps
  • Context editor UI: Full WorktreeContextEditor component with markdown preview/edit toggle, unsaved changes indicator, confirmation dialog on close, and Cmd+S/Ctrl+S save shortcut
  • Session integration: New context tab type in SessionTabs alongside file and diff tabs; lazy-loaded routing in MainPane
  • AI session injection: On the first prompt of each AI session, the worktree's context (if set) is prepended to the user message — tracked via a module-level Set with proper cleanup on disconnect
  • Worktree duplication: Context is copied to new worktrees when duplicating
  • UX polish: "Edit Context" menu item in worktree dropdown/context menus, activateContextEditor store method to avoid redundant tab opens, unsaved changes warning dialog

Files changed (14 files, +505 / −10)

File Change
src/main/db/database.ts Add context column mapping, updateWorktreeContext, getWorktreeByPath methods
src/main/db/schema.ts Schema v8 migration — add context column to worktrees
src/main/db/types.ts Add context field to Worktree type
src/main/ipc/opencode-handlers.ts Inject worktree context on first AI session prompt, cleanup tracking
src/main/ipc/worktree-handlers.ts Add worktree:getContext and worktree:updateContext IPC handlers
src/main/services/worktree-ops.ts Copy context on worktree duplication
src/preload/index.d.ts Type declarations for new worktree context APIs
src/preload/index.ts Expose getWorktreeContext and updateWorktreeContext on worktreeOps
src/renderer/src/components/layout/MainPane.tsx Add lazy-loaded WorktreeContextEditor route
src/renderer/src/components/sessions/SessionTabs.tsx Add context tab type with unsaved indicator
src/renderer/src/components/worktrees/WorktreeContextEditor.tsx Full editor component (markdown preview, edit, save, keyboard shortcut)
src/renderer/src/components/worktrees/WorktreeItem.tsx "Edit Context" menu item in dropdown and context menus
src/renderer/src/stores/useFileViewerStore.ts Context editor state, tab management, activateContextEditor

Upgrade Claude Agent SDK to ^0.2.62 (#75)

  • Bumps @anthropic-ai/claude-agent-sdk from ^0.2.50 to ^0.2.62 in package.json
  • Updates pnpm-lock.yaml to resolve the new SDK version (0.2.62) along with transitive dependency changes:
    • Adds minimatch@5.1.9 (replacing 5.1.6 usage in readdir-glob)
    • Updates integrity hashes for the SDK package