# Investibook Changelog

## 2026-04-14

### Bug Fixes
- **Jira search API v2→v3 migration**: All search commands (`search-by-cluster`, `search-by-tenant`, `search-by-alert-name`) migrated from deprecated `GET /rest/api/2/search` (HTTP 410) to `POST /rest/api/3/search/jql`. Fields are now passed as a JSON array in the POST body, fixing the v3 response returning empty fields (`?`).

### Improvements
- **Issue-ready notification no longer impersonates assistant**: When a Jira source finishes loading, the workspace now shows a compact system notification (`role: 'system'`) instead of a synthetic `role: 'assistant'` message. The old behavior persisted the message to backend history, causing the AI agent to treat it as its own prior output. The notification is now local-only, clearly labels the Jira comments summary as auto-generated, and does not guide next actions.

---

## 2026-04-03

### Improvements
- **System prompt language matching**: AI now responds in the same language the user writes in (Chinese in, Chinese out). Previously defaulted to English due to all-English system prompt.

### Removed
- **clinic-screenshot MCP cleanup**: Removed all legacy code for the `clinic-screenshot` MCP server which was already disabled in `opencode.json.template` but left dead code in 9 files:
  - `_extract_screenshots_from_tool_output` function and its caller in `acp.py`
  - `SCREENSHOT TOOL USAGE` section from system prompt
  - `/workspace-screenshots` static file mount
  - `/api/workspace/{id}/screenshot/{filename}` API endpoint
  - `grafana_storage_state.json` upload in admin API and frontend
  - Playwright storage state validation in request models
  - `grafana-screenshot` skill placeholder in workspace sources
  - Screenshot token injection in `MessagePartView`

---

## Initial Release

### New Features

#### Workspace Management
- **Home Page** (`app/page.tsx`): Workspace list with grid layout
  - Create new workspaces with name and description
  - View all existing workspaces
  - Delete workspaces with confirmation
  - Beautiful gradient background design

#### Workspace Detail Page
- **Dynamic Route** (`app/workspace/[id]/page.tsx`): Individual workspace view
  - Header with workspace name, description, and back button
  - Three-column layout (Sources, Chat, Studio)
  - Workspace-specific session management

#### Workspace Utilities
- **Workspace Management** (`lib/workspaces.ts`):
  - `getWorkspaces()`: Retrieve all workspaces
  - `createWorkspace()`: Create new workspace
  - `updateWorkspace()`: Update workspace metadata
  - `deleteWorkspace()`: Delete workspace and cleanup data
  - `getWorkspace()`: Get single workspace by ID

#### Enhanced Context Provider
- **WorkspaceProvider** (`lib/workspace.tsx`):
  - Added `workspaceId` prop for workspace-specific storage
  - Automatic loading of workspace data from localStorage
  - Automatic saving of sources and artifacts per workspace
  - Backward compatible (works without workspaceId)

### Data Storage

All data stored in browser localStorage:
- `investibook_workspaces`: Master list of workspaces
- `workspace_{id}_sources`: Sources for each workspace
- `workspace_{id}_artifacts`: Artifacts for each workspace  
- `workspace_{id}_session`: Session ID for each workspace

### UI/UX Improvements

- Gradient purple background on home page
- Card-based workspace display
- Hover effects and smooth transitions
- Modal dialog for workspace creation
- Confirmation dialog for workspace deletion
- Workspace header with navigation

### Core Functionality

All existing functionality maintained:
- Three-column layout
- Sources panel with file tree
- Chat panel with AI agent
- Studio panel with artifacts
- InsightReport component
- AnomaliesPanel component
- All chart components
- ACP backend integration
- OpenCode/Claude agent support

### Technical Details

- Next.js 16 App Router with dynamic routes
- React 18 with hooks
- TypeScript for type safety
- Ant Design components
- localStorage for persistence
- Suspense boundaries for loading states
