Skip to content

1.0.83

Choose a tag to compare

@morapelker morapelker released this 31 Mar 19:01
· 2283 commits to main since this release

What's Changed

Fix new ticket placement in todo column (#220)

  • Fix default sort order for new kanban tickets: Previously, when creating a new ticket without an explicit sort_order, it defaulted to 0, causing all new tickets to stack at the top of the column and collide with existing tickets. Now, the database is queried for the current maximum sort_order within the same project and column (excluding archived tickets), and the new ticket is placed at the bottom (max + 1).

fix(kanban): resolve session stream failures for sessions not in memory store (#219)

  • DB fallback for session & worktree resolution: When a kanban ticket references a session that isn't in the in-memory Zustand store (e.g. worktree not loaded in sidebar), the modal now falls back to the DB via findSessionById and window.db.worktree.get() to resolve both the session record and its worktree path.
  • Session hydration into Zustand store: New hydrateSession() method on useSessionStore injects DB-loaded sessions into sessionsByWorktree or sessionsByConnection so that getWorktreeStatus() and zustand selectors can find them going forward.
  • sessionsByConnection lookup: Session status and record selectors now also search sessionsByConnection (not just sessionsByWorktree), fixing sessions attached via connections instead of worktrees.
  • pending:: session ID resolution: When the Zustand store still holds a placeholder pending::UUID opencode session ID, the modal now re-reads from the DB to resolve the real materialized ID, and updates the store so other components pick it up.
  • Global session.materialized event handling: useOpenCodeGlobalListener now handles the session.materialized event to update the Zustand store with the real SDK session ID — critical for kanban-created sessions where SessionView/useSessionStream are never mounted.
  • Pre-warm message cache on modal open: A new sessionReady state drives a reconnect → getMessages sequence (mirroring SessionView.initializeSession()) before rendering SessionStreamPanel, ensuring the backend's message cache is warm.
  • Retry logic for empty getMessages results: useSessionStream now retries once (after 800ms) if the initial getMessages call returns empty, handling race conditions where the backend hasn't finished loading session data.
  • Early dual-pane layout commitment: New wantsDualPane flag commits to the dual-pane layout as soon as the ticket has a session ID, showing a loading spinner instead of a narrow empty modal while async lookups resolve. Falls back to standard layout only when the DB lookup definitively fails.
  • Plan review buttons gated on pendingPlan: Action buttons (Implement, Handoff, Supercharge) are now only rendered when pendingPlan is non-null, matching SessionView's gating behavior.
  • Bug fixes: Fixed reconnect call using worktreePath instead of workingPath; preserved connection_id from DB sessions (was hardcoded to null).

Compaction loading state UI & session performance optimizations (#218)

  • Compaction loading state UI: Adds a visual "Compacting" indicator with a red-themed indeterminate progress bar when the AI session is compacting conversation context. The backend now emits a compaction_started event so the UI can show this state before the compaction result arrives.
  • Virtualized message list: Extracts the message rendering loop into a new VirtualizedMessageList component powered by @tanstack/react-virtual, enabling efficient rendering of long conversation threads without mounting every message DOM node at once.
  • Database composite indexes: Adds a schema migration (v16) with composite indexes on sessions and worktrees tables (worktree_id/status/updated_at, connection_id/status/updated_at, project_id/status/last_accessed_at, status/last_message_at) to accelerate common queries.
  • Memoized tab components: Wraps SessionTab and ConnectionSessionTab with React.memo to prevent unnecessary re-renders when sibling tabs update.
  • Granular Zustand selectors in SessionTabs: Replaces the full-store destructure of useSessionStore() with individual selectors and useShallow for collection-valued state, reducing re-render scope.
  • Skip redundant transcript reload on idle reconnect: When reconnecting to an idle session, skips the second loadMessages call since the initial load already has the complete transcript.
  • Scroll container callback ref: Uses a callback ref + useState for the scroll container so that @tanstack/react-virtual's virtualizer reliably receives the element on first render.

perf: fix sessions taking a very long time to open (#217)

  • Virtualized message list: Extract the flat .map() message rendering from SessionView into a new VirtualizedMessageList component using @tanstack/react-virtual. Only visible messages (plus a small overscan buffer) are rendered in the DOM, preventing linear memory/CPU growth in long conversations.
  • Fix virtualizer scroll element timing: The virtualizer's useLayoutEffect ran before the parent's ref was attached (React processes layout effects bottom-up), causing getScrollElement() to return null permanently. Fixed by using a ref callback + useState so the scroll element triggers a re-render when the DOM element becomes available.
  • Fix memo-defeating patterns: Memoize streamingMessage with useMemo, wrap onRedoRevert in useCallback, replace content-aware estimateSize with a static value (since measureElement corrects), and convert renderItem from useCallback to a plain function (consumed synchronously).
  • Granular Zustand selectors in SessionTabs: Replace the single useSessionStore() destructure (~25 properties, re-rendering on ANY store change) with individual selectors. Map/Set state values use useShallow to avoid reference-change re-renders. This prevents SessionTabs from re-rendering during streaming events and other unrelated store updates.
  • Memoize tab components: Wrap SessionTab and ConnectionSessionTab with React.memo() so they only re-render when their props actually change, instead of on every parent state change.
  • Skip redundant loadMessages on idle reconnect: When reconnecting to an existing OpenCode session, initializeSession() was calling loadMessages() twice with the same session ID. The second call is only needed when the session is busy (the agent may have produced new messages in between). For idle/retry sessions the first load already has the complete transcript.
  • Composite database indexes: Add migration v16 with composite indexes on sessions(worktree_id, status, updated_at), sessions(connection_id, status, updated_at), worktrees(project_id, status, last_accessed_at), and worktrees(status, last_message_at) to eliminate full-table scans on filtered sorted queries.

feat: Add Jira integration with JQL query import (#214)

Adds full Jira Cloud integration, allowing users to search and import Jira issues into the kanban board via JQL queries.

New Features

  • JiraProvider (jira-provider.ts): Complete TicketProvider implementation for Jira Cloud REST API v3
    • Basic Auth via base64(email:token) for Jira Cloud API
    • JQL-based issue search using the new /rest/api/3/search/jql endpoint with cursor-based pagination
    • Status category mapping: done → closed, indeterminate → in_progress, new → open
    • Issue status transitions via the Jira transitions API (getAvailableStatuses, updateRemoteStatus)
    • Error handling for 401 (auth), 429 (rate limit), and JQL syntax errors with clear user messages
  • ADF-to-Markdown converter (adf-to-markdown.ts): Lightweight walker that converts Atlassian Document Format JSON to Markdown, supporting all common node types (paragraphs, headings, lists, code blocks, blockquotes, rules) and inline marks (bold, italic, code, links, strikethrough)
  • JiraImportModal (JiraImportModal.tsx): Full-featured import modal with:
    • JQL query input via textarea with Cmd/Ctrl+Enter shortcut
    • 3-state status badges (open / in_progress / closed)
    • Cursor-based pagination (forward/back)
    • Multi-select and bulk import via window.ticketImport
  • Import dropdown: Replaced the single import button in the kanban tab bar with a DropdownMenu offering "Import from GitHub" and "Import from Jira" options
  • Jira provider icon: ClipboardList icon with blue theme colors for visual distinction

Type System & Mapping Updates

  • Added 'jira' to the TicketProviderId union type
  • Extended RemoteIssue.state with 'in_progress' across preload, renderer, and GraphQL adapter types
  • Updated ticket-import handlers and resolvers with 3-way column mapping (closed → done, in_progress → in_progress, default → todo), backward-compatible with GitHub's open/closed states

Bug Fixes

  • Migrated from deprecated Jira search endpoint: Switched from /rest/api/3/search to /rest/api/3/search/jql with cursor-based (nextPageToken) pagination
  • Fixed domain sanitization: All JiraProvider methods now use extractCredentials().domain, stripping https:// prefixes and trailing slashes to prevent double-protocol URLs
  • Fixed credential persistence: Moved provider credentials to a dedicated 'hive-provider-settings' localStorage key so Zustand store updates no longer overwrite them
  • JiraImportModal UX: Added textarea auto-focus and guard against empty JQL searches

Files Changed (17 files, +1019 / −55)

  • src/main/services/ticket-providers/jira-provider.ts — new JiraProvider implementation
  • src/main/services/ticket-providers/adf-to-markdown.ts — new ADF→Markdown converter
  • src/renderer/src/components/kanban/JiraImportModal.tsx — new Jira import modal
  • src/main/index.ts — register JiraProvider alongside GitHubProvider
  • src/main/ipc/ticket-import-handlers.ts — 3-way column mapping, nextPageToken support
  • src/main/services/ticket-providers/ticket-provider-types.ts — type updates
  • src/main/services/ticket-providers/index.ts — export JiraProvider
  • src/preload/index.d.ts, src/preload/index.ts — add in_progress state, nextPageToken
  • src/renderer/src/components/kanban/ImportTicketsModal.tsx — add in_progress state
  • src/renderer/src/components/sessions/SessionTabs.tsx — import dropdown menu
  • src/renderer/src/components/settings/SettingsIntegrations.tsx — Jira credential fields
  • src/renderer/src/components/ui/provider-icon.tsx — Jira icon config
  • src/renderer/src/lib/provider-settings.ts — dedicated provider settings storage
  • src/renderer/src/transport/graphql/adapters/ticket-import.ts — type update
  • src/renderer/src/transport/graphql/resolvers/mutation/ticket-import.resolvers.ts — 3-way mapping

fix(kanban): resolve 'failed to send followup' for sessions not in memory (#213)

Fixes the "Failed to send followup" error that occurs when sending followup prompts from the Kanban board to sessions that are not currently loaded in the in-memory store (e.g. when the associated worktree is not actively selected).

Root Causes Addressed

  1. Session not found in memory — findSessionById only searched the in-memory session store. If the worktree wasn't currently selected, the session wouldn't be present, causing an immediate failure.
  2. Agent SDK map not populated — The Claude Code agent SDK implementer requires sessions to be in its internal Map, which is normally populated by SessionView.initializeSession(). The kanban followup path bypasses SessionView entirely, so the map was never populated.
  3. Missing model resolution fallback — resolveSessionModel couldn't resolve the model when the session wasn't in the store, even if the data was available from the DB.

Changes

  • findSessionById → async with DB fallback: After checking the in-memory store, falls back to window.db.session.get() and window.db.worktree.get() to retrieve session and worktree data directly from the database. Returns additional model fields (model_provider_id, model_id, model_variant) needed for model resolution.
  • resolveSessionModel accepts fallback data: New optional sessionDataFallback parameter allows passing DB-fetched session data when the session isn't in the store.
  • opencodeOps.reconnect before prompt: Ensures the agent SDK's in-memory session map is populated before sending the prompt, preventing "session not found" errors in the SDK layer.
  • Eager session loading via useEffect: When a ticket references a current_session_id that isn't in the store, triggers loadSessions for the ticket's worktree to populate the store proactively.
  • Ticket state update on followup: Calls updateTicket with updated mode and plan_ready: false when sending followups from both PlanReviewModeContent and ReviewModeContent, ensuring the board reflects the correct state.
  • Defensive followup persistence: Wraps window.kanban?.followup?.create() with optional chaining and try/catch since the API may not be fully wired up in all environments.
  • Improved error reporting: Surfaces detailed error messages (including the underlying reason) in toast notifications and logs structured error messages to the console for easier debugging.

feat: add Kanban board support for connections (#212)

Extends the Kanban board to work in connection mode, where a connection aggregates multiple projects and the board displays tickets from all member projects in a unified view.

Kanban Store — connection-level accessors

  • getConnectionProjectIds(connectionId) — resolves unique project IDs from connection members
  • loadTicketsForConnection(connectionId) — fetches tickets for all member projects in parallel, batch-updates the store, with inline isLoading management to prevent race conditions
  • getTicketsByColumnForConnection(connectionId, column) — merges and sorts tickets across all projects for a given column

KanbanBoard — dual-mode rendering

  • Accepts optional connectionId prop; when set, loads and displays connection-aggregated tickets instead of a single project's tickets
  • Passes connectionId down to columns, modals, and ticket cards

KanbanColumn — connection-aware drag-drop

  • In connection mode, searches all connection tickets (not just one project) when resolving cross-column drag-and-drop targets
  • Routes create/import actions through connection-aware modals

KanbanTicketCard — project tags & jump-to-session

  • Displays a project name tag on each card so users can distinguish which project a ticket belongs to
  • "Jump to session" navigates to the correct worktree/session within the connection context
  • Fixed infinite re-render loop caused by non-memoized Zustand selectors

KanbanTicketModal — connection-session linking

  • Session linking respects connection scope — filters and navigates within the active connection

TicketCreateModal — project picker

  • In connection mode, shows a project picker dropdown so users choose which member project owns the new ticket

ImportTicketsModal — project picker

  • In connection mode, shows a project picker populated from connection members, fetches provider repos per selected project

WorktreePickerModal — simplified connection mode

  • Filters worktree list to only those belonging to the connection's member projects

Layout & routing

  • Header: board toggle button now visible for connections (not only projects)
  • MainPane: routes to <KanbanBoard connectionId={…} /> when board view is active in connection mode
  • SessionTabs: hides session-tab-bar board buttons (create/import) in connection board mode — the board itself provides its own in-column equivalents

Tapping provider icon on a ticket opens browser (#211)

  • KanbanTicketCard: Replaced the <a> anchor tag wrapping the provider icon with a <button> that calls window.systemOps.openInChrome() to open the external URL. This ensures the link opens in Chrome via the system's native handler rather than relying on default anchor behavior, which may not work correctly in an Electron context.
  • KanbanTicketModal: Added a provider icon button next to the "Edit Ticket" dialog title. When a ticket has an external provider and URL, clicking the icon opens the external URL in Chrome. Imported ProviderIcon and getProviderLabel from the shared UI components.

Both changes use e.stopPropagation() or direct click handlers to prevent triggering parent card/modal interactions.

Fix checkbox toggle bug in ticket import modal (#210)

  • Fix double-toggle bug on checkboxes in the Import Tickets modal. Clicking a checkbox to select/deselect a ticket appeared to do nothing because both the Checkbox's onCheckedChange handler and the parent div's onClick handler were calling toggleSelect(), causing the selection to toggle twice (on then immediately off).
  • Removed the redundant onCheckedChange prop from the individual issue Checkbox in ImportTicketsModal.tsx. The parent div wrapper already handles the click via its onClick={() => toggleSelect(issue.externalId)}, so the checkbox now correctly reflects the toggled state on a single click.

Fix ticket modal buttons being cut off in review mode (#209)

  • Added overflow-hidden to the plan_review and review modal dialog containers to prevent content from overflowing the modal boundary
  • Added min-h-0 to the plan review and review content scroll areas — a classic flexbox fix that allows flex children to shrink below their intrinsic content size, enabling proper overflow scrolling within the constrained max-h-[80vh] container
  • Added flex-wrap to the DialogFooter in plan review mode so action buttons wrap gracefully instead of being clipped when horizontal space is tight

All changes are in src/renderer/src/components/kanban/KanbanTicketModal.tsx.