refactor: item name capitalization improvements#1730
Merged
pedrolamas merged 2 commits intoNov 5, 2025
Merged
Conversation
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the prettyCase string formatter to use a more efficient regex-based approach and ensures consistent text capitalization across the UI by replacing CSS text-transform: capitalize with the prettyCase filter.
- Simplified
prettyCaseimplementation from split/filter/map/join to regex replace operations - Added comprehensive test coverage for
prettyCasefunction - Updated
SystemCommands.vueto useprettyCasefilter for service names and states
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/util/string-formatters.ts | Refactored prettyCase to use regex-based string replacement instead of split/map/join |
| src/util/tests/string-formatters.spec.ts | Added test suite with 4 test cases covering edge cases like extra whitespace, mixed case, and special characters |
| src/components/common/SystemCommands.vue | Replaced CSS text-transform: capitalize with prettyCase filter for service display names and states |
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
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.
Follow up on #1468, this changes the rules to the following:
or_with(single space)This fixes "active (running)" showing as "Active (running)" instead of the expected "Active (Running)"