feat: display variable descriptions in interactive mode prompts#117
Merged
feat: display variable descriptions in interactive mode prompts#117
Conversation
- Add support for displaying variable descriptions in interactive prompts - Support both 'description' and 'help' fields for backward compatibility - Display descriptions only when available, maintaining clean prompts otherwise - Add comprehensive tests for the new functionality - Update documentation to explain the new feature Closes #116
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
==========================================
+ Coverage 68.06% 68.70% +0.63%
==========================================
Files 20 20
Lines 1522 1553 +31
Branches 269 279 +10
==========================================
+ Hits 1036 1067 +31
Misses 411 411
Partials 75 75 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Replace basic description display with clean Option 4 format - Add contextual icons based on variable names and types - Implement cleaner two-line format for variables with descriptions - Maintain compact inline format for variables without descriptions - Add comprehensive test coverage for icon selection logic - Update documentation with new formatting examples Icons included: 🚀 Project/app names | 🌍 Environment vars | 🔌 Network/ports 🗄️ Database configs | ⚡ Boolean toggles | 🔐 Auth/secrets 🏷️ Versions/tags | 📁 Paths/directories | 🔧 General vars
- Use ANSI escape codes to make variable names bold in interactive prompts - Improves readability and visual hierarchy of prompts - Update test assertions to match new bold formatting - Update documentation to mention bold variable names - All tests passing with new formatting
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.
Description
This PR implements the feature requested in issue #116 to display variable descriptions in interactive mode prompts, enhancing the user experience when generating project structures.
Changes Made
Core Implementation
struct_module/template_renderer.py: Updated theprompt_for_missing_varsmethod to display variable descriptions during interactive promptsdescriptionandhelpfields for backward compatibilityTesting
test_prompt_with_description_display()intests/test_template_renderer.pydescriptionfieldhelpfieldDocumentation
docs/template-variables.md: Added explanation of the new description display featuredescriptionandhelpfieldsExample Output
Before (without descriptions)
After (with descriptions)
Backward Compatibility
✅ Fully backward compatible
helpfield in addition todescriptionBenefits
Testing
Closes #116