Skip to content

feat: allow deleting providers from provider manager list - #1726

Merged
Aaronontheweb merged 4 commits into
netclaw-dev:devfrom
Aaronontheweb:feature/provider-manager-delete
Aug 1, 2026
Merged

feat: allow deleting providers from provider manager list#1726
Aaronontheweb merged 4 commits into
netclaw-dev:devfrom
Aaronontheweb:feature/provider-manager-delete

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Adds Delete keybinding to the netclaw provider list so configured providers can be removed without opening Details first.

Changes:

  • Show [Delete] Remove in the provider list footer
  • Route Delete to a remove confirmation flow for configured rows
  • Prevent deleting unconfigured provider type rows with an error message
  • Reuse existing model-role guard and dual-file removal logic

Files changed:

  • src/Netclaw.Cli/Tui/ProviderManagerPage.cs
  • src/Netclaw.Cli/Tui/ProviderManagerViewModel.cs

Copilot AI review requested due to automatic review settings July 31, 2026 23:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 1, 2026 00:02
@Aaronontheweb
Aaronontheweb force-pushed the feature/provider-manager-delete branch from dbfa82e to c6afbd6 Compare August 1, 2026 00:02
@Aaronontheweb Aaronontheweb added enhancement New feature or request providers Provider integrations and capability detection across OpenAI-compatible backends. tui Terminal UI (Termina) issues labels Aug 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
    {

Copilot AI review requested due to automatic review settings August 1, 2026 00:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copilot AI review requested due to automatic review settings August 1, 2026 01:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.

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.
Copilot AI review requested due to automatic review settings August 1, 2026 02:04
@Aaronontheweb
Aaronontheweb force-pushed the feature/provider-manager-delete branch from 9fc5471 to 0aca3fd Compare August 1, 2026 02:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

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.
Copilot AI review requested due to automatic review settings August 1, 2026 02:41
@Aaronontheweb
Aaronontheweb force-pushed the feature/provider-manager-delete branch from 0aca3fd to f1fbe5c Compare August 1, 2026 02:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@Aaronontheweb
Aaronontheweb merged commit 75b944c into netclaw-dev:dev Aug 1, 2026
15 checks passed
@Aaronontheweb Aaronontheweb mentioned this pull request Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request providers Provider integrations and capability detection across OpenAI-compatible backends. tui Terminal UI (Termina) issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants