# 🚀 Epic: Context-First Workflow UX

## 📌 Context
- **Status:** ✅ Done
- **Feasibility:** 🟢 POSSIBLE (8.5/10)

## 🎯 Goal
Bắt buộc user phải mở workflow n8n → chọn platform → mới được chat. AI luôn biết đang sửa workflow nào.

## 📋 Execution Checklist

### Phase 1: Background State — Workflow Context Manager
- [x] Task 1.1: Tạo `src/superassistant/workflowContext.ts` — state manager (set/get/clear active workflow)
- [x] Task 1.2: Update `bg/index.ts` — add message handlers for context (set/get/clear/fetch-workflow)

### Phase 2: Popup UX — n8n Detection + Platform Launcher
- [x] Task 2.1: Tạo `src/components/WorkflowLauncher.vue` — detect n8n tab, show workflow info, platform buttons
- [x] Task 2.2: Update `Popup.vue` — integrate WorkflowLauncher component

### Phase 3: Content Script — Context Injection
- [x] Task 3.1: Update `src/superassistant/index.ts` — on init, fetch context from background + inject into chat
- [x] Task 3.2: Update `src/superassistant/bridge.ts` — auto-attach workflowId to tool calls

### Phase 4: Build & Verify
- [x] Task 4.1: Build passes (`npm run build`) ✅
- [x] Task 4.2: Manifest confirmed — content script injected into 9 AI platforms
