Skip to content

refactor: item name capitalization improvements#1730

Merged
pedrolamas merged 2 commits into
fluidd-core:developfrom
pedrolamas:pedrolamas/improved-capitalization
Nov 5, 2025
Merged

refactor: item name capitalization improvements#1730
pedrolamas merged 2 commits into
fluidd-core:developfrom
pedrolamas:pedrolamas/improved-capitalization

Conversation

@pedrolamas

Copy link
Copy Markdown
Member

Follow up on #1468, this changes the rules to the following:

  • Replace any continuous group of or _ with (single space)
  • Trim spaces
  • Find words (made of letters or numbers in any order) and capitalize the first letter

This fixes "active (running)" showing as "Active (running)" instead of the expected "Active (Running)"

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas pedrolamas added the Code - Optimizations Everything that relates to code optimizations! label Nov 5, 2025
@pedrolamas pedrolamas added this to the 1.34.5 milestone Nov 5, 2025
@pedrolamas pedrolamas requested a review from Copilot November 5, 2025 10:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 prettyCase implementation from split/filter/map/join to regex replace operations
  • Added comprehensive test coverage for prettyCase function
  • Updated SystemCommands.vue to use prettyCase filter 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

Comment thread src/util/string-formatters.ts Outdated
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas pedrolamas requested a review from Copilot November 5, 2025 10:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

@pedrolamas pedrolamas merged commit d4e32cf into fluidd-core:develop Nov 5, 2025
10 checks passed
@pedrolamas pedrolamas deleted the pedrolamas/improved-capitalization branch November 5, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code - Optimizations Everything that relates to code optimizations!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants