Skip to content

feat(webview): surface inline-subtask transitions as distinct chat banners - #17

Merged
easonLiangWorldedtech merged 2 commits into
main-task-treefrom
pr-8-inline-ui
Aug 16, 2026
Merged

feat(webview): surface inline-subtask transitions as distinct chat banners#17
easonLiangWorldedtech merged 2 commits into
main-task-treefrom
pr-8-inline-ui

Conversation

@easonLiangWorldedtech

@easonLiangWorldedtech easonLiangWorldedtech commented Aug 16, 2026

Copy link
Copy Markdown
Owner

feat(webview): surface inline-subtask transitions as distinct chat banners

Problem

When new_task hits the nesting limit, two things happen that are currently invisible to the user:

  1. Auto-flatten: with autoFlattenOnLimit, an over-limit subtask runs inline in the current conversation instead of opening a child tab. The model sees it via the tool result ([auto-flattened: ...]), but the webview renders nothing — tool results are not chat rows.
  2. Reject: a nested new_task while an inline phase is already active (or over-limit with auto-flatten off) returns only a tool error, again invisible in the UI.

So "reject create subtask and back to inline mode" had no visual affordance — confirmed by live task 01a00a40, where both the flatten and the reject appeared as plain model text rather than anything the user could recognize at a glance.

Change

Emit two new ClineSay notice types from NewTaskTool and render them as distinct banners:

  • inline_subtask_started (auto-flatten) → amber banner, Split icon: "Subtask flattened to inline" + the limit detail.
  • inline_subtask_rejected (nested-in-progress / over-limit-reject) → red banner, OctagonX icon: "Nested subtask rejected" + reason.

Both are emitted via task.say(...) in addition to the existing tool result (the model still gets it), so nothing changes for the agent — only the user now sees the transition.

  • packages/types: add both to clineSays.
  • NewTaskTool.ts: emit in the three non-delegate branches (flatten, reject-nested, reject-limit).
  • ChatRow.tsx: two new cases rendering themed banners (VS Code tokens, matching WarningRow styling). Each banner carries a settings hint link that deep-links straight into the task-tree settings (switchTab → settings, values.section = "contextManagement") so the user can adjust maxNestingDepth / autoFlattenOnLimit without hunting for them.
  • chatBatchingPredicates.ts: mark both as batching boundaries so they render as their own rows.
  • i18n: subtasks.inlineStarted / subtasks.inlineRejected / subtasks.inlineConfigure plus three localized detail strings (inlineStartedDetail, inlineRejectedLimitDetail, inlineRejectedNestedDetail) across all 18 locales.

Also fixed (found while reviewing the live UI)

  • Task-tree settings rendered raw i18n keys: ContextManagementSettings referenced settings:taskTree.*, but the translations live under contextManagement.taskTree.*. Corrected all six references; added a regression test asserting the nested path resolves.
  • Banner detail text was hardcoded English (e.g. "Nesting limit 2 reached — …"): the say payload is now structured JSON ({ maxDepth } / { reason, maxDepth? }) and the webview renders localized detail strings with interpolation; non-JSON payloads fall back to raw text.

Tests

  • Backend (newTaskInlineFlatten.spec.ts): the Task double now carries a say mock; each branch asserts the right say type + message. 6/6 pass.
  • Webview (new ChatRow.inline-subtask.spec.tsx): both banners render localized title + detail (both reject reasons covered); the settings-hint link deep-links into the task-tree section on click; unrelated say types render neither. 6/6 pass.
  • Settings (ContextManagementSettings.spec.tsx): regression test asserting the nested contextManagement.taskTree.* key path resolves. 36/36 pass.

check-types 11/11. Per-file eslint clean. find-missing-translations.js green across all locales.

@easonLiangWorldedtech
easonLiangWorldedtech merged commit 3a16c7c into main-task-tree Aug 16, 2026
12 checks passed
@easonLiangWorldedtech
easonLiangWorldedtech deleted the pr-8-inline-ui branch August 16, 2026 12:27
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.

2 participants