Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Named workspaces hold **up to four independent agents each**. Keyboard shortcuts

## A new way to work in the terminal — v0.16.0

**Patch v0.16.1:** fixes a startup race around prompt activation, keeps prompt state updates on the UI dispatcher, and includes clipboard and component lifecycle improvements. See the [release notes](docs/CHANGELOG.md#0161---2026-10-21).
**Patch v0.16.2:** fixes the startup screen that filled with repeated prompt borders and left the first agent unable to take input. See the [release notes](docs/CHANGELOG.md#0162---2026-11-11).

Built on **RazorConsole 0.6.0**, this release brings multiple workspaces, up to four independent agents per workspace, agent collaboration, portable context snapshots, and saved-agent history into one terminal interface. Explore your files, manage MCP servers and Skills, and keep working while other agents handle their tasks.

Expand Down
21 changes: 20 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,31 @@

All notable changes to MandoCode will be documented in this file.

## [Unreleased]
## [0.16.2] - 2026-11-11

**The startup screen no longer fills with repeated prompt borders.** On some launches the first agent drew its prompt as rows of bottom borders and could not take input; the workaround was to open a second agent and close the first. The 0.16.1 startup change did not address this. RazorConsole remains at 0.6.0.

![The startup screen before this fix: every row below the agent header shows a prompt border](images/startup-repeated-borders-before-0.16.2.png)

*Before 0.16.2: what the first agent could look like on launch.*

**Highlights**

- Fix the corrupted startup prompt that left the first agent unusable.
- Focus requests raised while a component finishes rendering now run after the render batch completes.

### Fixed

- Stop the prompt, and any panel that takes focus as it opens, from being inserted into the interface twice. A focus request made from `OnAfterRenderAsync` dispatched its focus events inside the render batch still in progress, and RazorConsole 0.6.0 then applied that batch a second time. Whether this happened depended on thread timing, so it appeared on some launches and not others. These requests now go through `DeferredFocus`, which waits for the batch to finish. Focus changes from key and click handlers are unchanged. RazorConsole 0.7.0 corrects the dispatch itself; this release does not upgrade to it.

### Changed

- Group CLI components into feature folders for shell, workspaces, conversations, input, project browsing, sessions, settings, onboarding, and activity. Keep component namespaces and behavior unchanged, and document where new components belong.

### Test coverage

- The full suite passes on net10.0 and net8.0 (1,247 tests each). No automated regression covers this failure: it was reproduced, and the fix confirmed, by launching the built CLI in a pseudo-terminal with the timing forced.

## [0.16.1] - 2026-10-21

**Startup and component stability.** The chat prompt now waits for model validation and MCP initialization to finish. Prompt state changes run together on the UI dispatcher, and agents closed during startup cannot start an input loop afterward. RazorConsole remains at 0.6.0.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Activity/PlanStepEditor.razor
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (Pane is not null) Pane.FocusKey = _hook;
if (firstRender && (Pane is null || Pane.Active)) await Focus.FocusAsync(_hook);
if (firstRender && (Pane is null || Pane.Active)) await Focus.FocusDeferredAsync(_hook);
}

private void HandleChanged() => StateHasChanged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
if (Pane is not null && Pane.FocusKey is null)
{
Pane.FocusKey = _focusKey;
if (Pane.Active) await Focus.FocusAsync(_focusKey);
if (Pane.Active) await Focus.FocusDeferredAsync(_focusKey);
}
}
public void Scroll(string key)
Expand Down
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Input/ApprovalSelect.razor
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
if (Pane is not null) Pane.FocusKey = _focusKey;
if ((Pane is null || Pane.Active) && (firstRender || _requestFocus || !Focus.IsFocused(_focusKey)))
{
await Focus.FocusAsync(_focusKey);
await Focus.FocusDeferredAsync(_focusKey);
// A newly mounted selector may not yet be in the framework's focus
// snapshot. Keep retrying until its registered target owns focus.
_requestFocus = !Focus.IsFocused(_focusKey);
Expand Down
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Input/PromptInput.razor
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
if ((Pane is null || Pane.Active) && (firstRender || _focusPicker))
{
_focusPicker = false;
await Focus.FocusAsync(_hook);
await Focus.FocusDeferredAsync(_hook);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Onboarding/OllamaPullPanel.razor
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
protected override void OnInitialized() { _ = Animate(); _ = Load(); }
private Task Load() => Run(async ct => { _newestModels = await Library.Models(ct, newest: true); if (_newestModels.Count == 0) throw new IOException("The library could not be read. Type a model name and press Ctrl+P to pull it."); _status = ""; });
protected override void OnParametersSet() { if (ExplorerFocus is not null) { ExplorerFocus.NavigateTab = Cycle; ExplorerFocus.FocusExplorer = FocusPanel; } }
protected override async Task OnAfterRenderAsync(bool firstRender) { if ((Pane is null || Pane.Active) && !Focus.IsFocused(_searchFocused ? _searchKey : _focusKey)) { if (_searchFocused) await FocusSearch(); else await FocusPanel(); } }
protected override async Task OnAfterRenderAsync(bool firstRender) { if ((Pane is null || Pane.Active) && !Focus.IsFocused(_searchFocused ? _searchKey : _focusKey)) { await DeferredFocus.AfterRenderBatch(); if (_searchFocused) await FocusSearch(); else await FocusPanel(); } }
private async Task FocusPanel() { if (Pane is not null && !Pane.Active) return; if (Pane is not null) Pane.FocusKey = _focusKey; ExplorerFocus?.SetPromptFocused(false); await Focus.FocusAsync(_focusKey); }
private async Task Cycle(bool reverse) {
if (_busy) return;
Expand Down
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Onboarding/SetupWizardPanel.razor
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ else
if (_browsing || Pane is not null && !Pane.Active) return;
var key = _urlInput ? _urlKey : _key;
if (Pane is not null) Pane.FocusKey = key;
if (!Focus.IsFocused(key)) await Focus.FocusAsync(key);
if (!Focus.IsFocused(key)) await Focus.FocusDeferredAsync(key);
}
private async Task Animate() { try { while (!_stop.IsCancellationRequested) { await Task.Delay(120, _stop.Token); if (_choices.Length == 0 && !_browsing && !_urlInput) { _frame++; if (!_disposed) await InvokeAsync(StateHasChanged); } } } catch (OperationCanceledException) { } }
public void Dispose() { _disposed = true; _stop.Cancel(); _operations.Dispose(); if (ExplorerFocus?.NavigateTab == Cycle) ExplorerFocus.NavigateTab = null; }
Expand Down
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Project/AgentFileExplorer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
if (Pane is not null && (firstRender || Focus.IsFocused(_focusKey))) Pane.FocusKey = _focusKey;
if ((Pane is null || Pane.Active) &&
(firstRender || (ExplorerFocus is { Active: true, PromptFocused: false } && !Focus.IsFocused(_focusKey))))
await FocusExplorerAsync();
{ await DeferredFocus.AfterRenderBatch(); await FocusExplorerAsync(); }
}
private string Caption(AgentFileTree.Entry? item, int index)
{
Expand Down
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Project/AgentGitChanges.razor
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if ((Pane is null || Pane.Active) && (firstRender || (ExplorerFocus is { Active: true, PromptFocused: false } && !Focus.IsFocused(_focusKey)))) await FocusPanel();
if ((Pane is null || Pane.Active) && (firstRender || (ExplorerFocus is { Active: true, PromptFocused: false } && !Focus.IsFocused(_focusKey)))) { await DeferredFocus.AfterRenderBatch(); await FocusPanel(); }
}
private async Task FocusPanel()
{
Expand Down
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Project/DirectoryBrowser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (Pane is not null) Pane.FocusKey = _focusKey;
if ((Pane is null || Pane.Active) && !Focus.IsFocused(_focusKey)) await Focus.FocusAsync(_focusKey);
if ((Pane is null || Pane.Active) && !Focus.IsFocused(_focusKey)) await Focus.FocusDeferredAsync(_focusKey);
}
private async Task Navigate(string path)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if ((Pane is null || Pane.Active) && (firstRender || ExplorerFocus?.PromptFocused == false && !Focus.IsFocused(_focusKey))) await FocusPanel();
if ((Pane is null || Pane.Active) && (firstRender || ExplorerFocus?.PromptFocused == false && !Focus.IsFocused(_focusKey))) { await DeferredFocus.AfterRenderBatch(); await FocusPanel(); }
}
private async Task FocusPanel()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
}
private void StoreChanged() { if (!_disposed) _ = InvokeAsync(() => { ResetBrowser(_selectionId); StateHasChanged(); }); }
protected override void OnParametersSet() { if (ExplorerFocus is not null) { ExplorerFocus.NavigateTab = Cycle; ExplorerFocus.FocusExplorer = FocusPanel; } }
protected override async Task OnAfterRenderAsync(bool firstRender) { if ((Pane is null || Pane.Active) && !Focus.IsFocused(_inputFocused ? _inputKey : _focusKey)) { if (_inputFocused) await FocusInput(); else await FocusPanel(); } }
protected override async Task OnAfterRenderAsync(bool firstRender) { if ((Pane is null || Pane.Active) && !Focus.IsFocused(_inputFocused ? _inputKey : _focusKey)) { await DeferredFocus.AfterRenderBatch(); if (_inputFocused) await FocusInput(); else await FocusPanel(); } }
private async Task FocusPanel() { _inputFocused = false; if (Pane is not null) Pane.FocusKey = _focusKey; ExplorerFocus?.SetPromptFocused(false); await Focus.FocusAsync(_focusKey); }
private async Task FocusInput() { if (_busy || _offer || _confirmDelete || _choosingModel) return; _previewFocused = false; _inputFocused = true; if (Pane is not null) Pane.FocusKey = _inputKey; await Focus.FocusAsync(_inputKey); }
private async Task Cycle(bool reverse) {
Expand Down
4 changes: 2 additions & 2 deletions src/MandoCode/Components/Settings/AgentSettingsPanel.razor
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@
if (Pane is not null && !Pane.Active) return;
if (_custom)
{
if (_focusCustom && _customInput is not null) { _focusCustom = false; await _customInput.FocusPromptAsync(); }
if (_focusCustom && _customInput is not null) { _focusCustom = false; await DeferredFocus.AfterRenderBatch(); await _customInput.FocusPromptAsync(); }
}
else if (!Focus.IsFocused(_focusKey)) await FocusPanel();
else if (!Focus.IsFocused(_focusKey)) { await DeferredFocus.AfterRenderBatch(); await FocusPanel(); }
}
private async Task FocusPanel()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (_input is null && _tools is null && !_installBrowser && (Pane is null || Pane.Active) && !Focus.IsFocused(FocusTarget))
await FocusPanel();
{ await DeferredFocus.AfterRenderBatch(); await FocusPanel(); }
}

private async Task FocusPanel()
Expand Down
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Settings/McpToolsViewer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
protected override async Task OnAfterRenderAsync(bool firstRender) {
if (firstRender && (Pane is null || Pane.Active)) {
if (Pane is not null) Pane.FocusKey = _focusKey;
await Focus.FocusAsync(_focusKey);
await Focus.FocusDeferredAsync(_focusKey);
}
}
private async Task Key(KeyboardEventArgs key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
{
_lastFocusVersion = Workspace.FocusVersion;
_lastFocusKey = key;
await Focus.FocusAsync(key);
await Focus.FocusDeferredAsync(key);
}
}
public void Dispose() { Workspace.Changed -= Changed; Viewport.OnResized -= Changed; }
Expand Down
2 changes: 1 addition & 1 deletion src/MandoCode/Components/Workspaces/WorkspacePicker.razor
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender) await Focus.FocusAsync(_hook);
if (firstRender) await Focus.FocusDeferredAsync(_hook);
}
protected override void OnParametersSet()
{
Expand Down
4 changes: 2 additions & 2 deletions src/MandoCode/MandoCode.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<PackageId>MandoCode</PackageId>

<!-- NuGet metadata -->
<Version>0.16.1</Version>
<Version>0.16.2</Version>
<Authors>Armando Fernandez (DevMando)</Authors>
<Description>An AI coding assistant built for the developer workflow: independent agents, workspaces, portable context, and local or cloud models through Ollama.</Description>
<PackageProjectUrl>https://github.com/DevMando/MandoCode</PackageProjectUrl>
<RepositoryUrl>https://github.com/DevMando/MandoCode</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>ai;cli;coding-assistant;ollama;agent-framework;razorconsole;multi-agent;local-llm;dotnet10;dotnet8</PackageTags>
<PackageReleaseNotes>v0.16.1 fixes a startup race that could activate the chat prompt before model and MCP initialization finished, keeps prompt updates on the UI dispatcher, and prevents closed agents from starting input. Includes clipboard fixes, component lifecycle refactoring, and stronger regression testing. Full release notes: https://github.com/DevMando/MandoCode/blob/v0.16.1/docs/CHANGELOG.md</PackageReleaseNotes>
<PackageReleaseNotes>v0.16.2 fixes the startup screen that filled with repeated prompt borders and left the first agent unable to take input. Focus requests made while a component finishes rendering now wait for the render in progress to complete. Full release notes: https://github.com/DevMando/MandoCode/blob/v0.16.2/docs/CHANGELOG.md</PackageReleaseNotes>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>MC.png</PackageIcon>
<ApplicationIcon>MC.ico</ApplicationIcon>
Expand Down
30 changes: 30 additions & 0 deletions src/MandoCode/Services/Rendering/DeferredFocus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Runtime.CompilerServices;
using RazorConsole.Core.Focus;

namespace MandoCode.Services;

/// <summary>
/// Keeps focus requests made from OnAfterRender out of the render batch that raised them.
/// </summary>
/// <remarks>
/// FocusManager.FocusAsync dispatches focusin/focusout as soon as the key is a known focus
/// target. OnAfterRender runs while the renderer is still inside its batch, so that dispatch
/// starts the event's own render pass before the batch has been cleared. The renderer then hands
/// the same edits to the display a second time and every component the batch created is inserted
/// twice. At startup that batch is the one that creates the prompt, which then drew as rows of
/// bottom borders and could not take input. Whether the key was already a known target depended
/// on a thread-pool observer, which made the failure intermittent.
/// Event handlers are not affected: they run outside a batch and may call FocusAsync directly.
/// </remarks>
public static class DeferredFocus
{
/// <summary>Resumes on the renderer's dispatcher once the batch in progress has finished.</summary>
public static YieldAwaitable AfterRenderBatch() => Task.Yield();

/// <summary>Requests focus after the batch in progress has finished. Use from OnAfterRender.</summary>
public static async Task<bool> FocusDeferredAsync(this FocusManager focus, string key, CancellationToken token = default)
{
await AfterRenderBatch();
return await focus.FocusAsync(key, token);
}
}
Loading