Skip to content

Commit aa87f23

Browse files
authored
Merge pull request #7 from Bitslix/feat/agent-chat-maximize
feat(agent): chat maximize toggle in Agent tab
2 parents 15a50cb + 46f3902 commit aa87f23

42 files changed

Lines changed: 3507 additions & 1354 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/plans/PLANS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ Persistent plans for multi-step work on **blxcode**. Individual plans live as Ma
1515
| planned | [kanban-board-view.md](kanban-board-view.md) | Kanban-View im Plans-Panel fuer alle Plan-Tasks eines Workspaces: Status-Spalten, Drag-and-Drop fuer Karten und Spalten, Spalten ein-/ausblenden und Markdown-Writeback |
1616
| done | [coordinated-subagents.md](coordinated-subagents.md) | Coordinated Subagents fuer BLXCode Agent mit Rollen, i18n Live-Subcards, Provider-Reuse, Environment Detection, Shell/Git/Web Toolsets und scoped Toolgruppen |
1717
| done | [better-harness.md](better-harness.md) | BetterHarness: Shrink system prompt by extracting tool docs into 6 embedded Core Skills; Skills tab gets Core/User sub-tabs |
18+
| done | [agent-chat-maximize.md](agent-chat-maximize.md) | Agent-Tab: Chat-Maximize-Toggle vor Reset; Voice-Hero kompakt (`agent-hero--compact`), mehr Platz fuer Chat-Verlauf |
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Agent Chat Section Maximize
2+
3+
**Status:** done (implemented on `feat/agent-chat-maximize`)
4+
5+
## Summary
6+
7+
Icon-Toggle im Agent-Tab-Chat-Header (vor Reset): maximiert die Chat-Sektion, indem der Voice-Hero (`agent-hero`) in eine kompakte Leiste wechselt. Tasks, Context und Compose bleiben sichtbar. Nur innerhalb des Agent-Right-Panel-Tabs.
8+
9+
## Decisions
10+
11+
- Voice minimieren via `agent-hero--compact`, kein Ausblenden von Tasks/Context.
12+
- Lokales `chat_maximized` RwSignal, nicht in `WorkspaceEntry`.
13+
- Feature-Branch: `feat/agent-chat-maximize` von `main`.
14+
15+
## Tests
16+
17+
- Agent-Tab: Toggle links vom Reset; Hero kompakt/voll; andere Tabs unberührt.
18+
- `cargo check -p blxcode-ui --target wasm32-unknown-unknown`
19+
20+
## Tasks
21+
22+
- [x] `git-branch` - Branch von main
23+
- [x] `plan-file` - Plan + PLANS.md Index
24+
- [x] `i18n-keys` - AgChatMaximize / AgChatRestore
25+
- [x] `ui-toggle` - Button + Signal + Hero-Modifier
26+
- [x] `css-hero-compact` - Compact hero + icon button styles
27+
- [x] `manual-verify` - wasm check

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
- **Subagent protocol & UI**: new `AgentEvent::Subagent{Started,Step,ToolCall,Finished}` events, `TimelineItem::SubagentGroup` (tolerant serde for older `sessions.json`), inline subcards with live steps and compact tool-call icons, ~50 ms debounce for parallel event bursts.
2929
- **Core skills**: embedded harness skills `subagents.md`, `environment.md`, `shell.md`, `git.md`, `web.md` plus updated `file-access.md` / `harness.md` (harness-vs-shell boundary). `system_prompt.rs` skill/tool index expanded with subagent activation triggers.
3030
- **i18n**: subagent UI states, role display names (Scout / Review / Security Analyst with auto-suffix on conflict), all new tool/environment/shell/git/web labels and the web-disabled hint added to every locale.
31+
- **Agent chat maximize**: new maximize/minimize icon button in the agent chat header (before Reset). Toggles a compact voice hero (`agent-hero--compact`) inside the Agent right-panel tab only — smaller orb and status line, tagline hidden — so the chat log gains vertical space while Tasks, Context and compose stay visible. Session-local `chat_maximized` state (not persisted per workspace). i18n: `AgChatMaximize`, `AgChatRestore` in all locales.
32+
- **Subagent live streaming**: subagent HTTP calls switched from non-streaming to SSE on both the OpenAI-compatible (OpenRouter / OpenAI / Azure-routed) and Anthropic paths. New `AgentEvent::Subagent{AssistantDelta,ThinkingDelta,ThinkingDone}` events stream the model's text + reasoning per agent. `SubagentCard` gained `live_text` / `live_thinking` / `thinking_done` fields (tolerant serde for older snapshots), the card renders a collapsible Thinking block, a live assistant-text pre-block, and a pulsing three-dot indicator while `status == "running"`. Buffers are cleared on `SubagentFinished` so the final `summary` takes over.
33+
- **Subagent tool inventory in prompt**: subagent system prompt now lists the actually-provisioned tools grouped by purpose (Workspace, Diffs, Git, Memory, Plans, Tasks, Rules & Skills, Web) — generated from `registry_filtered` so the prompt cannot drift from the schema. Adds an explicit anti-hallucination clause directing the subagent to attempt `list_workspace_files` / `read_workspace_file` before claiming a lack of tools. Stops weaker models from instantly returning `blocked`.
34+
- **Timeline tool-call compaction**: consecutive identical tool calls in the chat timeline collapse into a single row with a live `×N` counter badge that grows as new calls stream in. Expand chevron reveals each invocation's args + detail in a sub-list. Single-call rows keep the prior layout; merged rows aggregate status (any pending → pending, any fail → fail, else ok).
35+
- **Tool group horizontal wrap**: `.agent-tool-group` switched from vertical stack to `flex-direction: row` with `flex-wrap: wrap`, so consecutive tool-call chips sit side-by-side and only wrap when the chat column runs out of width.
36+
- **Per-turn usage stats footer**: new `AgentEvent::TurnUsage { input_tokens, output_tokens, ttft_ms, elapsed_ms }` emitted at the end of each turn from both the OpenAI-compatible (`stream_options.include_usage`) and Anthropic (`message_start.usage` + `message_delta.usage`) paths. TTFT is measured from request send to first streamed content/reasoning delta. The frontend accumulates per-workspace totals in a new `ChatUsageStats` field on `WorkspaceEntry` (serde-default so old snapshots load) and renders a compact mono footer under the chat log: `N turns · in {tokens} · out {tokens} · {tok/s} · ttft {ms|s}`. Footer is hidden until the first turn produces data; resets on Reset Conversation.
37+
- **Copy + Redo buttons on assistant answers**: each assistant chat bubble grew an action row with a Copy button (writes the markdown to the system clipboard via `navigator.clipboard`, switches to a check icon for 1.4 s) and a Redo button (re-submits the previous user-turn prompt). `DisplayTimelineItem::Assistant` carries the preceding user text so Redo knows what to replay; the Redo button is hidden for the welcome bubble. Actions fade up from `opacity: 0.55` to full on hover for visual restraint.
38+
- **Subagent prompt hardening**: subagent system prompt restructured into `# Tools` / `# Required execution flow` / `# Forbidden behaviors` sections with a mandatory first `list_workspace_files {"path":"."}` call when `workspace_read` is provisioned. Explicit ban on `status:"blocked"` without a prior workspace probe and on paraphrasing tool errors as "tools unavailable".
39+
- **Subagent server-side blocked-without-trying guard**: new `validate_submit` rejects a `submit_result` with `status:"blocked"` when the role had `workspace_read` but the agent never called `list_workspace_files`, `read_workspace_file`, or `workspace_search`. The rejection is fed back into the conversation as a tool response so the loop continues, forcing the model to actually probe access before re-submitting. `handle_tool_call` now returns a `ToolCallOutcome` enum (`SubmitAccepted` / `SubmitRejected(msg)` / `NotSubmit`) wired into both the OpenAI and Anthropic subagent loops. 4 unit tests pin the contract.
40+
- **`allowedToolGroups` schema constrained**: `subagents.run` JSON schema now enums `allowedToolGroups.items` to the 9 valid group strings (`environment_read`, `workspace_read`, `diff_read`, `git_read`, `memory_read`, `plans_read`, `tasks_read`, `rules_skills_read`, `web_read`). Previously the array was `{type: string}` with no constraint, so the coordinator could invent names like `"file_access"` / `"files"` and silently end up with an empty subagent toolset.
41+
- **Strict toolgroup parser + role-defaults fallback**: new `parse_allowed_groups_strict(names) → (valid, unknown)` separates parseable groups from typos. `subagents::run` surfaces the unknowns via a `SubagentStep` with `status:"warning"` listing the bad names and the valid alternatives, and falls back to the role's defaults instead of spawning a subagent with only `submit_result`. 2 new unit tests cover the path.
42+
- **Subagent tool-roster diagnostic step**: every subagent emits a `SubagentStep` immediately after `SubagentStarted` listing the actual provisioned tools (`Provisioned N tool(s): list_workspace_files, read_workspace_file, …`). When a model claims "no tools" the operator can compare against this list in one glance and tell hallucination from real misprovisioning.
43+
- **Subagent tools list `×N` compaction**: consecutive same-named tool calls inside a subagent card collapse into one row with a `×N` mint-green badge — same merge logic the main timeline uses. `Search workspace ×5` instead of five identical rows.
3144

3245
### Changed
3346

3447
- **Docs**: README, developer setup, build guide, and `.env.release.example` now document the setup and cross-platform release automation paths.
48+
- **Plans panel — Rules-style card UI**: the right-panel Plans tab now mirrors the Rules card flow with inline create/view/edit, header edit toggle, grouped state filters, task-state chips, and compact per-card status lines instead of the old split list/editor layout.
3549
- **Dependencies**: upgraded `leptos` 0.7 → 0.8, `leptos_icons` 0.5 → 0.7, `icondata` 0.5 → 0.7. Leptos 0.8 is backward-compatible for the signal / effect / callback / event-listener APIs in use; only Lucide icon renames required code changes (`LuFileEdit → LuFilePenLine`, `LuPlusCircle → LuCirclePlus`, `LuSendHorizonal → LuSendHorizontal`, `LuAlertTriangle → LuTriangleAlert`, `LuTerminalSquare → LuSquareTerminal`, `LuPlayCircle / LuAlertCircle / LuCheckCircle / LuMinusCircle → LuCircle*` variants).
50+
- **Command palette shortcut**: tmux-style chord moved from `Ctrl+B :` to `Ctrl+B p`. To free `p`, `ToggleRightPanel` (formerly `Ctrl+B p`) was reassigned to `Ctrl+B r`. Classic-mode shortcuts (`Ctrl+Shift+P` palette, `Ctrl+P` side panel) unchanged. Hint strings in `en_us.rs` / `de_de.rs` updated.
51+
- **Subagent card polish**: dedicated CSS for the subagent timeline group — name and status now separated by a baseline-aligned `gap` (no more `scanblocked` run-together), font sizes shrunk (`0.7rem` name / `0.62rem` status / `0.68rem` summary / `0.64rem` tools), default `<details>` marker hidden in favour of the existing chevron pattern.
52+
- **Tool-loop round budgets raised**: `MAX_ROUNDS` for both the OpenAI-compatible and Anthropic coordinator loops bumped from `12 → 36`; `MAX_SUBAGENT_ROUNDS` from `8 → 24`. The previous limits aborted long multi-step turns mid-investigation, especially in subagents that need several file-read rounds before they can synthesize findings.
53+
- **Subagent skill doc — `allowedToolGroups` documented**: `harness_skills/subagents.md` now lists every valid `allowedToolGroups` string with its tool-coverage, recommends omitting the field entirely (defaults are sensible), and explicitly warns against invented names like `"file_access"` / `"files"` / `"shell_exec"`.
3654

3755
### Fixed
3856

57+
- **Plans panel polish**: fixed new-plan composer scroll anchoring so the composer is visible immediately after pressing `+`, centered wrapped plan-state filter rows, and added a visible header edit/preview toggle for plan cards.
58+
- **Azure tool-name validation**: tool names containing `.` (`subagents.run`, `harness.create_workspace`, `harness.open_terminal`, `harness.list_terminals`, `harness.send_terminal_keys`, `harness.send_agent_context`, `harness.read_terminal_output`) failed Azure's `^[a-zA-Z0-9_-]+$` regex when OpenRouter routed to an Azure-hosted model (`invalid_request_error` on `input[N].name`). The OpenAI-compatible tool catalog now sanitizes `.``_` at render time via `sanitize_openai_tool_name`, and inbound `tool_calls` are mapped back to the internal dotted form via `openai_tool_name_to_internal` before dispatch. Assistant-message replay keeps the sanitized form, matching provider expectations. Anthropic path's existing `to_anthropic_name` / `from_anthropic_name` unchanged.
59+
- **Project Explorer flicker on chat updates**: the file-tree on the left was wiping its `children_cache` and reloading every time the agent panel pushed a `TimelineItem` (chat delta, tool result, …). Root cause was a Memo that returned the full `WorkspaceEntry` — any field change, including the timeline, invalidated it. Memo narrowed to project `Option<(id, cwd, configuring)>`, so unrelated workspace state no longer triggers a reload. Mirrors the same fix previously applied to the Git History sidebar.
60+
- **Subagents reporting "no file-system tools were provisioned"**: subagents would fail with `blocked` claiming their tool schema was empty even when they had `workspace_read` in their role defaults. Root cause was `parse_allowed_groups` silently dropping any string the coordinator invented in `subagents.run`'s `allowedToolGroups` argument — `["file_access", "files", "workspace"]` would all parse to `[]`, leaving the subagent with only `submit_result` in its schema. The model was reporting honestly; the catalog really was empty. Fix combines schema-level `enum` constraint, a strict parser that surfaces unknown names, fallback to role defaults when nothing parses, a startup `Provisioned N tool(s)` diagnostic, and the existing prompt-level "you DO have file-system access" guard. Backed by a regression test (`no_subagent_reachable_group_contains_dotted_tool_names`) that asserts no subagent-reachable group exposes dotted tool names, so the Azure `.` sanitization can stay coordinator-only.
61+
3962
### Removed
4063

4164

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Welcome to the BLXCode docs. User guides explain how to run and use the app; dev
2727
- [Getting Started](user/getting-started.md) — prerequisites, run BLXCode, first workspace, where data lives.
2828
- [Workspaces](user/workspaces.md) — creation, terminal grids, sidebar explorer, Git graph, handoff, persistence.
2929
- [Memory And Tasks](user/memory-and-tasks.md) — Memory panel (Files, Graph, Search), dynamic categories, tasks, agent memory tools.
30-
- [Plans](user/plans.md)`.agents/plans/`, task syntax, Plans panel, plan-linked tasks, agent tools.
31-
- [Rules And Skills](user/rules-and-skills.md)`.agents/rules/`, `.agents/skills/`, core vs user skills, install dialog.
30+
- [Plans](user/plans.md)`.agents/plans/`, Kanban board, task syntax, Plans panel, agent tools.
31+
- [Rules And Skills](user/rules-and-skills.md)expandable rule/skill cards, core vs user skills, install dialog.
3232
- [Agent Harness](user/agent-harness.md) — core skills, slim prompt, environment/shell/git/web, web API keys.
3333
- [Subagents](user/subagents.md) — parallel runs, roles, timeline, tool groups, limits.
3434
- [Keyboard Shortcuts](user/keyboard-shortcuts.md) — tmux prefix vs legacy chords, notification toasts.

docs/images/rules-panel.png

159 KB
Loading

docs/images/skills-panel.png

-155 KB
Loading

docs/user/plans.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ The panel provides:
6262

6363
On workspace activation, BLXCode restores the last active plan path (`activePlanPath` in the workbench snapshot).
6464

65+
## Kanban board view
66+
67+
Switch the Plans toolbar to **Kanban** (alongside **Editor** and **Preview**).
68+
69+
- Aggregates tasks from all plan files in the workspace (`PLANS.md` index is excluded).
70+
- **Free tasks** without `planPath` stay in the Agent task list only — not on the board.
71+
- Columns match task statuses: pending, in progress, blocked, completed, cancelled.
72+
- **Drag cards** between columns to change status; BLXCode writes the matching `[ ]` / `[>]` / `[!]` / `[x]` / `[-]` marker back into the plan Markdown.
73+
- **Drag columns** to reorder; hide or show empty columns. Layout persists in `.blxcode/kanban/index.json`.
74+
75+
Quick-add and delete actions on cards keep the board and plan files in sync. When a card’s task is mirrored in `.blxcode/tasks/`, status updates best-effort sync there too.
76+
6577
## Plan-linked tasks
6678

6779
Tasks in `.blxcode/tasks/index.json` can reference a plan:

docs/user/rules-and-skills.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ Do not hand-edit `index.json` unless you know what you are doing; use the UI or
2323

2424
Open **Rules** from the right workbench rail (`LuShield` icon).
2525

26-
Each card shows:
26+
Each rule is an **expandable card** (same pattern as Skills):
2727

28-
- Title and summary from the rule file
29-
- **Enabled** / **Disabled** pill
30-
- Toggle, read, and remove controls
28+
| Collapsed | Expanded |
29+
|-----------|----------|
30+
| Title, summary, **Enabled** / **Disabled** pill, enable toggle | Full rule body (Markdown), inline **edit** and save, remove |
31+
32+
Use **Create rule** at the top of the tab to add a new `rule-*.md` file. The form validates name and body before writing to `.agents/rules/`.
33+
34+
<p align="center">
35+
<img src="../images/rules-panel.png" alt="Rules panel with create-rule form and expandable rule cards" />
36+
</p>
3137

3238
Disabled rules are invisible to the agent — the system prompt treats them as if they did not exist.
3339

@@ -38,7 +44,7 @@ Active rules are **binding and non-negotiable**; they outrank skill guidance whe
3844
Open **Skills** from the right workbench rail (`LuPuzzle` icon).
3945

4046
<p align="center">
41-
<img src="../images/skills-panel.png" alt="Skills panel with install dialog and skill cards showing source badges" />
47+
<img src="../images/skills-panel.png" alt="Skills panel with Core and User tabs and expandable skill cards" />
4248
</p>
4349

4450
### Core vs User tabs
@@ -54,10 +60,14 @@ Core skills show a **core** badge. You can enable or disable them per workspace,
5460

5561
The **web** core skill may show **disabled_no_key** when no Tavily/Brave API key is configured — configure keys under Harness settings → Agent → Web Tools ([Agent Harness](agent-harness.md)). The **subagents** core skill documents `subagents.run` — see [Subagents](subagents.md).
5662

57-
Each card shows:
63+
Use the **Core** / **User** pill tabs at the top of the panel (counts per tab).
64+
65+
Each skill is an **expandable card**:
66+
67+
| Collapsed | Expanded |
68+
|-----------|----------|
69+
| Name, summary, source badge (`core`, `git`, `npm`, `local`, `agent`), enable switch | Lazy-loaded `SKILL.md` body on first expand |
5870

59-
- Skill name and summary
60-
- Source badge: `core`, `git`, `npm`, `local`, or `agent`
6171
- **SKILL.md missing** warning (user skills only) when the folder has no top-level `SKILL.md`
6272
- Enable/disable; **remove** only for non-core skills
6373

0 commit comments

Comments
 (0)