Skip to content

feat: パーミッションUI改善 — SDK v2対応 + コンパクトなキュー表示#93

Merged
ktmage merged 3 commits into
developmentfrom
feat/92-permission-ui-redesign
Mar 8, 2026
Merged

feat: パーミッションUI改善 — SDK v2対応 + コンパクトなキュー表示#93
ktmage merged 3 commits into
developmentfrom
feat/92-permission-ui-redesign

Conversation

@ktmage
Copy link
Copy Markdown
Owner

@ktmage ktmage commented Mar 8, 2026

Summary

  • opencode サーバー v1.2.20 が送信する v2 SDK イベントに対応するため、@opencode-ai/sdk@opencode-ai/sdk/v2 に全面移行
  • パーミッションUIを MessageItem 内の埋め込み表示から、InputArea 直上のキュー型バーに変更
  • TodoHeader / FileChangesHeader と統一されたコンパクトなバースタイルに刷新

Commits

  1. feat: migrate opencode agent to SDK v2 — SDK v2 への移行(agent + core 層)
  2. feat: redesign permission UI as compact inline queue — UI アーキテクチャ変更 + デザイン刷新(webview 層)
  3. feat: add ShieldIcon and permission.title locale key — アイコン追加 + 全8ロケール対応

Design

┌──────────────────────────────────────────────┐
│ 🛡 Permissions  3  ▶                         │  ← ヘッダーバー
├──────────────────────────────────────────────┤
│  Bash  echo hello    [Allow] [Once] [Deny]   │  ← 先頭1件は常に表示
│─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │
│  Edit  file.ts       [Allow] [Once] [Deny]   │  ← 展開時のみ表示
│  External Dir  /tmp  [Allow] [Once] [Deny]   │
└──────────────────────────────────────────────┘

Verification

  • tsc --noEmit: 3パッケージすべてパス
  • webview テスト: 71ファイル 1,520テスト パス
  • ext host テスト: 3ファイル 75テスト パス
  • opencode agent テスト: 2ファイル 85テスト パス

Closes #92
Related: #91

ktmage added 3 commits March 8, 2026 16:01
Migrate from @opencode-ai/sdk to @opencode-ai/sdk/v2 to match
opencode server v1.2.20 which sends v2-format events.

Key changes:
- Import path: @opencode-ai/sdk → @opencode-ai/sdk/v2
- API calls: nested path params → flat params
- Event names: permission.updated → permission.asked
- Permission type: Permission → PermissionRequest fields
- Reply methods: raw fetch → client.permission.reply / question.reply
- SSE subscription: positional → options arg
Replace the stacked warning-box permission UI with a compact bar-style
queue that matches TodoHeader / FileChangesHeader design patterns.

- Move permissions from MessageItem to a dedicated PermissionQueue above InputArea
- Show first pending permission expanded, collapse the rest behind a count badge
- Click header bar to expand/collapse remaining permissions
- Use ShieldIcon with warning accent color for visual distinction
- Buttons use sm size for compact layout
- Reply uses permission.sessionID for correct child-session handling
- Add ShieldIcon (VscShield) to icon components for permission header
- Add 'permission.title' key to all 8 locale files (en, ja, zh-cn,
  zh-tw, ko, es, pt-br, ru)
@ktmage ktmage merged commit 2dd4f44 into development Mar 8, 2026
1 check passed
@ktmage ktmage deleted the feat/92-permission-ui-redesign branch March 8, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant