**Layout refactor (Phase 1):** - UnifiedTopBar replacing Header.tsx — chat title editing, project folder, commit/push split button, Git branch+dirty badge, terminal/file-tree toggles - PanelZone renders FileTree, GitPanel, PreviewPanel side-by-side on the right - Independent panel toggle states in PanelContext - ResizeHandle unified across all panels - Removed old RightPanel, Header, DocPreview components **Git backend (Phase 2):** - src/lib/git/service.ts — execFile-based Git operations with timeout + injection safety - API routes: status, branches, checkout, log, commit, push, commit-detail, worktrees, derive - Worktree derive creates DB session inheriting source session settings **Git frontend (Phase 3):** - GitPanel with 4 collapsible sections: Status, Branches, History, Worktrees - CommitDialog with commit vs commit-and-push modes - GitBranchSelector with inline error, worktree-occupied branches disabled - GitWorktreeSection with switch-to/derive actions, current/dirty indicators - useGitStatus polled in AppShell, derived into context (no redundant setState) **Terminal (Phase 4):** - electron/terminal-manager.ts — child_process.spawn fallback (PTY upgrade documented) - IPC handlers + TerminalDrawer/TerminalInstance components **Polish (Phase 5):** - Push inline feedback with 4s auto-dismiss - Branch detection fix, commit diff exit-code handling - Removed redundant git state: currentBranch/gitDirtyCount now derived, not setState - useTerminal isElectron uses lazy initializer instead of effect - i18n keys (en + zh), user tutorial docs, handover document Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
1.5 KiB
Markdown
36 lines
1.5 KiB
Markdown
# QQ Bridge Channel Integration
|
|
|
|
## Status: IN PROGRESS
|
|
|
|
## Scope
|
|
Add QQ as a new bridge channel. First version: private chat text + image inbound only. No group/channel, no Markdown, no active messages, no stream preview.
|
|
|
|
## Implementation Steps
|
|
|
|
### Phase 1: Foundation
|
|
- [x] `types.ts`: Add `qq: 2000` to PLATFORM_LIMITS
|
|
- [x] `qq-api.ts`: QQ HTTP/WS protocol helpers (token, gateway, heartbeat, send)
|
|
- [x] `qq-adapter.ts`: Full adapter (lifecycle, WS, event parsing, auth, image download)
|
|
- [x] `adapters/index.ts`: Register `import './qq-adapter'`
|
|
|
|
### Phase 2: Settings & API
|
|
- [x] `src/app/api/settings/qq/route.ts`: GET/PUT QQ settings
|
|
- [x] `src/app/api/settings/qq/verify/route.ts`: Verify token + gateway
|
|
- [x] `src/app/api/bridge/settings/route.ts`: Add QQ keys
|
|
|
|
### Phase 3: UI
|
|
- [x] `QqBridgeSection.tsx`: Settings UI component
|
|
- [x] `BridgeLayout.tsx`: Add QQ sidebar item
|
|
- [x] `BridgeSection.tsx`: Add QQ channel toggle
|
|
- [x] `i18n/en.ts` + `i18n/zh.ts`: QQ translations
|
|
|
|
### Phase 4: replyToMessageId Threading
|
|
- [x] `bridge-manager.ts`: Thread `msg.messageId` through all reply paths (deliver, deliverResponse, command replies, error replies, permission broker)
|
|
|
|
## Key Decisions
|
|
- No `getPreviewCapabilities()` — QQ passive reply window is tight
|
|
- No `channel_offsets` — WS-based, not polling
|
|
- Permission: text `/perm` fallback only, no buttons
|
|
- `msg_seq` generation in qq-api.ts (auto-increment per reply)
|
|
- Image: download attachments, convert to FileAttachment, 20MB limit
|