Skip to content

1.0.69

Choose a tag to compare

@morapelker morapelker released this 22 Mar 11:36
· 2460 commits to main since this release

What's Changed

Add connection rename UI with tooltip and improved blur handling (#152)

This PR enhances the ConnectionItem component with a key UX improvement for connections with custom names:

  • Tooltip for custom connection names: When a connection has a custom name, hovering shows a tooltip with the underlying project name(s) and branch(es)

This feature helps users understand which projects are part of a connection when they've given it a custom name.

Add GitHub PR review comments viewer tab (#151)

Adds a full-featured PR Review Comments tab to the file sidebar that lets users browse, filter, and navigate inline GitHub PR review comments — and optionally attach them as context to AI chat sessions.

New IPC channel: git:getPRReviewComments

  • Uses GitHub CLI's GraphQL API to fetch all review threads (with replies) for a given PR number
  • Extracts baseRefName, comment metadata, thread structure, diff hunks, and author info
  • Exposed through preload as window.gitOps.getPRReviewComments()

New shared type: PRReviewComment (src/shared/types/git.ts)

  • Typed interface for review comments shared across main, preload, and renderer processes

New Zustand store: usePRReviewStore

  • Manages comments keyed by worktree ID, with loading/error states
  • Provides selection (checkbox) tracking, reviewer filtering (hide/show by author), and "attach to chat" workflow
  • Derived helpers: getVisibleComments, getGroupedByFile, getThreads, getUniqueReviewers

New components

  • PrReviewViewer — Main sidebar panel with reviewer filter chips, refresh button, file-grouped comment list, and a sticky footer for "Add to chat" action
  • PrReviewFileGroup — Collapsible file section showing root comments with reply counts
  • PrCommentCard — Compact comment row with avatar, author, line number, snippet preview, outdated badge, and checkbox
  • PrCommentGutter — Monaco view-zone integration that renders threaded comment cards inline between diff lines (like GitHub's "Files changed" tab), using createPortal into Monaco view zones with ResizeObserver-based auto-sizing

Enhancements to existing components

  • FileSidebar — New "Comments" tab (visible only when a PR is attached to the worktree); auto-switches away if PR is detached
  • MonacoDiffView — Accepts scrollToLine, scrollTrigger, and prReviewWorktreeId props; auto-scrolls to target line after editor + view zones are ready; defaults to inline mode for PR review diffs
  • MainPane — Passes new PR review props through to MonacoDiffView; uses compound key to force remount on PR review navigation
  • SessionView — PR comment attachments are serialized as <pr-comment> XML blocks prepended to prompts (code, plan, and ask modes); attachments are cleared after send; inline PrCommentAttachments chip bar shown above the textarea
  • useFileViewerStore — ActiveDiff and DiffTab types extended with scrollToLine, scrollTrigger, prReviewWorktreeId; setActiveDiff auto-increments scroll trigger

Styling

  • Added .pr-comment-html CSS rules for rendering GitHub bodyHTML (code blocks, links, lists, blockquotes, images)
  • Updated CSP to allow img-src https: for GitHub avatars

Add drag-and-drop file attachment from Finder (#150)

  • Drag-and-drop from Finder: Users can now drag files from macOS Finder (or any file manager) directly into the Hive window to attach them to the active coding session. A visual overlay appears during the drag — blue when a session is active, amber warning when no session is open.
  • Attachment type refactor: The Attachment type is now a discriminated union (kind: 'data' for inline base64 images/PDFs, kind: 'path' for file-path references). Images dropped from Finder are read as base64 data URLs; all other file types are attached by path and serialized as XML <attached_files> references in the message.
  • Shared utilities extracted: buildMessageParts, MAX_ATTACHMENTS, and isImageMime are moved to a new file-attachment-utils.ts module, eliminating three duplicated message-building blocks in SessionView.tsx.
  • File-type restriction removed: AttachmentButton no longer restricts to image/*,.pdf — any file type can now be attached.

Improve command parsing and security settings UX (#149)

This PR enhances the command approval security system with robust bash command parsing and improved user experience in security settings:

  • Smart Bash Command Parser: Implements a sophisticated parser that correctly handles quotes (single/double), heredocs, command substitutions ($(...) and backticks), nested structures, and escaped characters when splitting commands on &&
  • Security Settings Search: Adds search/filter functionality to the allowlist and blocklist in security settings, making it easier to manage large pattern lists
  • Improved Pattern Suggestions: Refines the suggestion algorithm to provide exactly 4 relevant options (or fewer for short commands), ordered from most general to most specific
  • Better Command Display: Updates the command approval prompt to use the smart parser for accurate command visualization
  • Consistent Parsing Logic: Mirrors the parsing implementation between CommandFilterService (main process) and permissionUtils (renderer) to ensure consistent behavior across OpenCode and Claude Code security systems
  • Comprehensive Tests: Adds test suite covering edge cases like nested quotes, heredocs, command substitutions, and complex real-world commands

Replace SyntaxHighlighter with CodeMirror 6 inline editor (#147)

Replaces the read-only react-syntax-highlighter code viewer with a full CodeMirror 6 editor embedded in the FileViewer, enabling inline file editing with a complete save pipeline, dirty-state tracking, and external change detection.

CodeMirror 6 Editor

  • New CodeMirrorEditor.tsx component with oneDark theme, line numbers, bracket matching, undo/redo, and native Cmd+F search
  • cm-languages.ts maps ~30 file extensions to CodeMirror language extensions for syntax highlighting
  • Removed FileSearch.tsx (superseded by CodeMirror's built-in search) and all Prism/react-syntax-highlighter imports
  • Installed codemirror and 17 @codemirror/* packages

File Save Pipeline

  • Backend: file-ops.ts service with content validation and directory checks; new IPC write-file handler
  • Preload: window.fileOps.writeFile() bridge
  • Editor: CM6 Mod-s keymap triggers save with toast feedback and git status refresh

Dirty State Tracking

  • Per-file unsaved change tracking by comparing editor content against original loaded content
  • Dirty indicator in tabs (dot replaces ✕ icon; ✕ reappears on hover)
  • UnsavedChangesDialog with three-button flow (Save / Don't Save / Cancel) shown before closing dirty tabs
  • Keyboard shortcut (Cmd+W) routed through requestCloseFile so dirty files always prompt
  • Background dirty tabs are focused before showing dialog to ensure correct FileViewer is mounted
  • Bulk close operations (closeAll, closeOthers, closeToRight) clean up dirty state maps

External File Change Detection

  • ExternalChangesBanner — amber warning banner when an open file changes on disk (e.g., AI agent edit, git pull)
  • File watcher subscription with own-save suppression to avoid false positives
  • Reload / Keep Mine options
  • Handles file deletion events with error state and store cleanup

Preview Sync

  • Markdown preview renders edited (unsaved) content via latestContentRef fallback
  • SVG preview regenerates data URI from edited content on mode switch

Tests

  • 19 new tests in test/file-viewer/file-editor.test.ts covering store actions and cm-languages mappings