Skip to content

fix(tui): revoke the highlighted approval - #1721

Merged
Aaronontheweb merged 1 commit into
devfrom
fix/1703-approvals-highlighted-row
Jul 31, 2026
Merged

fix(tui): revoke the highlighted approval#1721
Aaronontheweb merged 1 commit into
devfrom
fix/1703-approvals-highlighted-row

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Summary

  • Use typed approval rows in the approvals manager.
  • Pass the highlighted approval directly to the view model.
  • Remove the stale selected index.
  • Add headless and native regression tests for row-two revocation.

Fixes #1703

Test Evidence

  • dotnet test src/Netclaw.Cli.Tests/Netclaw.Cli.Tests.csproj --filter FullyQualifiedName~ApprovalsManagerPageTests passed 9 tests.
  • ./scripts/smoke/run-smoke.sh approvals passed three consecutive runs.
  • ./scripts/smoke/run-smoke.sh light passed 22 tapes and 9 scenarios.
  • dotnet slopwatch analyze passed with zero issues.
  • pwsh ./scripts/Add-FileHeaders.ps1 -Verify passed.

Copilot AI review requested due to automatic review settings July 31, 2026 16:52

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.

@Aaronontheweb Aaronontheweb added the tui Terminal UI (Termina) issues label Jul 31, 2026
@Aaronontheweb
Aaronontheweb marked this pull request as ready for review July 31, 2026 17:11

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

LGTM

@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) July 31, 2026 17:12
@Aaronontheweb
Aaronontheweb merged commit 4f21fcf into dev Jul 31, 2026
21 checks passed
@Aaronontheweb
Aaronontheweb deleted the fix/1703-approvals-highlighted-row branch July 31, 2026 17:20
Aaronontheweb added a commit to Aaronontheweb/netclaw that referenced this pull request Aug 1, 2026
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 added a commit to Aaronontheweb/netclaw that referenced this pull request Aug 1, 2026
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 added a commit to Aaronontheweb/netclaw that referenced this pull request Aug 1, 2026
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 added a commit that referenced this pull request Aug 1, 2026
* feat: allow deleting providers from provider manager list

* fix: route provider Delete to live highlighted row (not stale index)

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 (#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 #1721's RevokeKey_OnSecondRow test.

* fix: clear ErrorMessage when starting provider remove

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI (Termina) issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ApprovalsManagerPage revokes index 0 regardless of selected row

2 participants