feat: allow deleting providers from provider manager list - #1726
Merged
Aaronontheweb merged 4 commits intoAug 1, 2026
Merged
Conversation
Aaronontheweb
force-pushed
the
feature/provider-manager-delete
branch
from
August 1, 2026 00:02
dbfa82e to
c6afbd6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/Netclaw.Cli/Tui/ProviderManagerPage.cs:1009
- Clear ErrorMessage before you start the remove flow. The Delete handler can set an error for an unconfigured row. That error stays visible during remove confirmation and shows incorrect status.
if (item.IsConfigured)
{
ViewModel.RemoveSelectedProvider(item);
}
else
src/Netclaw.Cli.Tests/Tui/ProviderManagerPageTests.cs:96
- The PR description lists only two changed files. This PR also changes src/Netclaw.Cli.Tests/Tui/ProviderManagerPageTests.cs. Update the PR description file list so it stays accurate.
[Fact]
public async Task DeleteKey_OnSecondRow_RemovesHighlightedProvider()
{
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/Netclaw.Cli/Tui/ProviderManagerViewModel.cs:749
- Clear ErrorMessage before you enter the remove flow. A stale list error (for example from Delete on an unconfigured row) will hide later StatusMessage updates because the status bar prefers ErrorMessage.
if (item is not { IsConfigured: true, ConfiguredName: not null })
return;
DetailProvider = item;
StartRemove();
src/Netclaw.Cli.Tests/Tui/ProviderManagerPageTests.cs:126
- This test enqueues navigation keys before the app enters ProviderManagerState.List. It can fail if probing becomes asynchronous in the test probe (or in future refactors). Start the app first, wait for List state, then enqueue keys.
var (_, app, vm) = CreateHeadlessApp(out var input);
input.EnqueueKey(ConsoleKey.DownArrow); // move highlight off row 0 -> bravo-ollama
input.EnqueueKey(ConsoleKey.Delete); // start remove for highlighted row
input.EnqueueKey(ConsoleKey.Enter); // confirm "Yes, remove"
The Delete keybinding read ViewModel.SelectedProviderIndex, which only updates on Enter (SelectionConfirmed). Arrow-key navigation never syncs it, so Delete after navigating removed the wrong provider. Same bug class as the approvals revoke fix (netclaw-dev#1721). - Re-type the provider list to SelectionListNode<ProviderDisplayItem> so keybindings can read the live HighlightedItem (sentinel row matched by reference). - Delete now calls RemoveSelectedProvider(item) with the highlighted row. - VM RemoveSelectedProvider takes the target item directly; index out of the removal path. - RouteInputToActiveComponent no longer downcasts _lastFocusedList to SelectionListNode<string> (InvalidCastException with typed lists). - Add DeleteKey_OnSecondRow_RemovesHighlightedProvider regression test mirroring netclaw-dev#1721's RevokeKey_OnSecondRow test.
Aaronontheweb
force-pushed
the
feature/provider-manager-delete
branch
from
August 1, 2026 02:04
9fc5471 to
0aca3fd
Compare
After an unconfigured-row Delete shows 'Cannot remove an unconfigured provider type.', a subsequent successful removal leaves the stale red error on screen — the status bar renders error over success. Clear it in StartRemove, mirroring StartRename. Found by adversarial review: MEDIUM-1.
Aaronontheweb
force-pushed
the
feature/provider-manager-delete
branch
from
August 1, 2026 02:41
0aca3fd to
f1fbe5c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/Netclaw.Cli/Tui/ProviderManagerViewModel.cs:741
- The XML doc comment says this method removes a provider. The method only starts the remove-confirmation flow. This can confuse readers and future callers.
/// <summary>
/// Remove a configured provider. Used by the Delete keybinding on the list.
/// Takes the target item directly (resolved from the list's live highlight)
/// rather than the selection index, which only updates on Enter.
/// </summary>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Delete keybinding to the
netclaw providerlist so configured providers can be removed without opening Details first.Changes:
Files changed: