Skip to content

refactor: extract headphones UI into dedicated component#2858

Merged
lifeart merged 1 commit into
masterfrom
refactor/extract-headphones-component
Mar 11, 2026
Merged

refactor: extract headphones UI into dedicated component#2858
lifeart merged 1 commit into
masterfrom
refactor/extract-headphones-component

Conversation

@lifeart
Copy link
Copy Markdown
Collaborator

@lifeart lifeart commented Mar 11, 2026

Summary

Extracts the headphones management UI from the profile component into a standalone ui/headphones component, adapted from the approach in #2490.

Changes

  • New ui/headphones component — all headphone CRUD logic (load, add, delete) extracted from profile
  • Ui::Button usage — replaces raw <button> elements with the existing component
  • Internationalized type labels — headphone types (e.g. "On-ear Bluetooth", "Over-ear Wired") now use i18n translations (en-us + ru-ru) instead of hardcoded English strings
  • 10 integration tests — loading state, empty state, translated type labels, add/delete flows, validation, ARIA accessibility
  • Profile component simplified — reduced by ~130 lines, now renders <UiHeadphones /> instead of inline headphone logic

Test results

  • 17/17 headphones tests pass (7 existing acceptance + 10 new integration)
  • 13/13 profile tests pass (all existing tests still green)

Inspired by #2490

@github-actions
Copy link
Copy Markdown

Frontend test coverage: 70.89% (+0.14% compared to 70.75% on base)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 11, 2026

Gradle Unit and Integration Test Results

523 tests  ±0   521 ✔️ ±0   38s ⏱️ -1s
116 suites ±0       2 💤 ±0 
116 files   ±0       0 ±0 

Results for commit 1abbf49. ± Comparison against base commit 328009b.

♻️ This comment has been updated with latest results.

@lifeart lifeart force-pushed the refactor/extract-headphones-component branch from aee0393 to af80b42 Compare March 11, 2026 05:38
@github-actions
Copy link
Copy Markdown

Frontend test coverage: 70.89% (+0.14% compared to 70.75% on base)

@lifeart lifeart force-pushed the refactor/extract-headphones-component branch from af80b42 to b15a666 Compare March 11, 2026 07:57
@github-actions
Copy link
Copy Markdown

Frontend test coverage: 70.94% (+0.15% compared to 70.79% on base)

- Extract headphone CRUD logic from profile into app/components/ui/headphones
- Use Ui::Button component instead of raw <button> elements
- Internationalize headphone type labels (en-us + ru-ru)
- Add 10 integration tests for the new component
- Profile component reduced by ~130 lines

Inspired by #2490

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lifeart lifeart force-pushed the refactor/extract-headphones-component branch from b15a666 to 1abbf49 Compare March 11, 2026 09:46
@github-actions
Copy link
Copy Markdown

Frontend test coverage: 70.87% (+0.08% compared to 70.79% on base)

@sonarqubecloud
Copy link
Copy Markdown

@lifeart lifeart merged commit c8b5acf into master Mar 11, 2026
10 checks passed
@lifeart lifeart deleted the refactor/extract-headphones-component branch March 11, 2026 09:54
@lifeart lifeart mentioned this pull request Mar 11, 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.

1 participant