Skip to content

Fix MCP permissions focus and save interaction - #1694

Merged
Aaronontheweb merged 4 commits into
devfrom
fix/mcp-permissions-focus-confirmation
Jul 18, 2026
Merged

Fix MCP permissions focus and save interaction#1694
Aaronontheweb merged 4 commits into
devfrom
fix/mcp-permissions-focus-confirmation

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Summary

  • repaint MCP permission header and tool focus without resetting the scroll container
  • use the existing full-width config selection treatment instead of a color-only marker
  • make Enter the visible default Save action while preserving Y, N, and Esc
  • add rendered-background regression coverage and a native staged-save tape flow

Validation

  • dotnet test src/Netclaw.Cli.Tests/Netclaw.Cli.Tests.csproj --filter FullyQualifiedName~McpToolPermissionsPageTests --no-restore (15 passed)
  • dotnet slopwatch analyze (0 issues)
  • pwsh ./scripts/Add-FileHeaders.ps1 -Verify (passed)
  • native mcp-permissions screenshot tape completed Down, Space, confirmation, and Enter-save successfully
  • reviewed and updated mcp-permissions-tool-grid screenshot baseline for the intentional full-row highlight

Scope

This intentionally changes only the MCP permissions screen and its focused automated proof. It does not modify Termina or other NetClaw configuration screens.

Comment thread src/Netclaw.Cli/Mcp/McpToolPermissionsPage.cs Fixed

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

This PR improves the MCP tool permissions TUI by making focus/selection repaint without resetting the scroll container, standardizing selection visuals using the existing full-width highlight row treatment, and updating the staged-save confirmation UX to make Enter the visible default while keeping Y/N/Esc.

Changes:

  • Split MCP permissions header rows vs tool rows into separate dynamic layout nodes to repaint focus without recreating the scroll container.
  • Switch header/tool row rendering to ConfigSelectionRow for full-row focus highlighting.
  • Update save confirmation to support [Enter/Y] Save, and add both headless rendered-background assertions plus a native tape for Enter-save.

Reviewed changes

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

File Description
tests/smoke/tapes/screenshots/mcp-permissions.tape Adds a native regression path to exercise staged save using the default Enter action.
src/Netclaw.Cli/Mcp/McpToolPermissionsPage.cs Refactors grid rendering to avoid scroll resets, adopts ConfigSelectionRow, and updates confirmation key handling + footer text.
src/Netclaw.Cli.Tests/Mcp/McpToolPermissionsPageTests.cs Adds background-render regression assertions and a test covering Enter→Enter save confirmation flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Netclaw.Cli/Mcp/McpToolPermissionsPage.cs Outdated
Comment thread src/Netclaw.Cli/Mcp/McpToolPermissionsPage.cs Outdated
Comment thread src/Netclaw.Cli/Mcp/McpToolPermissionsPage.cs Outdated
Comment on lines +28 to +29
private readonly TextNode _confirmSaveFooterNode = new TextNode(
"Save changes? [Enter/Y] Save [N] Discard [Esc] Continue editing")
@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) July 18, 2026 20:56

@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 - reviewed the tape footage and it looks like what I'd expect going forward.

@Aaronontheweb
Aaronontheweb merged commit 783bf86 into dev Jul 18, 2026
21 checks passed
@Aaronontheweb
Aaronontheweb deleted the fix/mcp-permissions-focus-confirmation branch July 18, 2026 21:24
@Aaronontheweb Aaronontheweb mentioned this pull request Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants