Skip to content

Add new editable text prompt to make the edit experience better#53

Merged
karl-sjogren merged 3 commits into
developfrom
feature/edit-prompt
Dec 30, 2025
Merged

Add new editable text prompt to make the edit experience better#53
karl-sjogren merged 3 commits into
developfrom
feature/edit-prompt

Conversation

@karl-sjogren
Copy link
Copy Markdown
Owner

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 87.14286% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.92%. Comparing base (7a19d67) to head (34a078c).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
src/Karls.BetterSecretsTool/Tool.cs 45.45% 3 Missing and 3 partials ⚠️
...ls.BetterSecretsTool/Prompts/EditableTextPrompt.cs 94.82% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #53      +/-   ##
===========================================
+ Coverage    66.28%   68.92%   +2.63%     
===========================================
  Files            9       10       +1     
  Lines          436      502      +66     
  Branches        65       81      +16     
===========================================
+ Hits           289      346      +57     
- Misses         108      112       +4     
- Partials        39       44       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 introduces a new EditableTextPrompt class that provides an improved text input experience with full cursor navigation support (arrow keys, Home/End, Backspace/Delete) and the ability to cancel with Escape. This replaces the simple Ask<string> prompts previously used for adding and editing secrets.

  • Added EditableTextPrompt class with comprehensive cursor navigation and editing capabilities
  • Updated Tool.cs to use the new editable prompt for secret key and value input with escape-to-cancel support
  • Modified integration tests to simulate the new editing behavior by manually clearing default values and entering new text

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 21 comments.

Show a summary per file
File Description
src/Karls.BetterSecretsTool/Prompts/EditableTextPrompt.cs New prompt class implementing IPrompt<string?> with full cursor navigation, editing capabilities, and Escape-to-cancel functionality
src/Karls.BetterSecretsTool/Extensions/AnisConsoleExtensions.cs Added EditablePrompt extension method to IAnsiConsole for convenient access to the new prompt
src/Karls.BetterSecretsTool/Tool.cs Updated EditSecret and AddSecret methods to use EditablePrompt instead of Ask, with null checks for cancelled operations
test/Karls.BetterSecretsTool.Tests/Prompts/EditableTextPromptTests.cs Comprehensive test suite covering all navigation keys, editing operations, default values, and edge cases
test/Karls.BetterSecretsTool.Tests/ConsoleUIIntegrationTests.cs Updated integration tests to simulate new editable prompt behavior by clearing existing values before entering new text
test/Karls.BetterSecretsTool.Tests/EndToEndIntegrationTests.cs Updated end-to-end tests to match the new prompt's input requirements

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

Comment thread src/Karls.BetterSecretsTool/Prompts/EditableTextPrompt.cs Outdated
Comment thread test/Karls.BetterSecretsTool.Tests/ConsoleUIIntegrationTests.cs
Comment thread test/Karls.BetterSecretsTool.Tests/EndToEndIntegrationTests.cs
Comment thread test/Karls.BetterSecretsTool.Tests/Prompts/EditableTextPromptTests.cs Outdated
Comment thread test/Karls.BetterSecretsTool.Tests/Prompts/EditableTextPromptTests.cs Outdated
Comment thread test/Karls.BetterSecretsTool.Tests/Prompts/EditableTextPromptTests.cs Outdated
Comment thread test/Karls.BetterSecretsTool.Tests/Prompts/EditableTextPromptTests.cs Outdated
Comment thread test/Karls.BetterSecretsTool.Tests/Prompts/EditableTextPromptTests.cs Outdated
Comment thread test/Karls.BetterSecretsTool.Tests/Prompts/EditableTextPromptTests.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 6 out of 6 changed files in this pull request and generated no new comments.


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

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