Skip to content

feat(user): present the User panel with a hero() header, marked attribute sections, and counted RBAC sections; match textual statuses by label and word the guest state for any framework. - #76

Merged
terabytesoftw merged 1 commit into
mainfrom
feat/user-panel-hero
Sep 26, 2026

Conversation

@terabytesoftw

Copy link
Copy Markdown
Contributor

Pull Request

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bugfix (non-breaking change that fixes an issue)
  • CI/build configuration
  • Documentation update
  • New feature (non-breaking change that adds functionality)
  • Refactoring (no functional changes)

…ribute sections, and counted RBAC sections; match textual statuses by label and word the guest state for any framework.
@terabytesoftw terabytesoftw added the enhancement New feature or request label Sep 26, 2026
@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f0f3f5a) to head (ce2c014).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #76   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity      2392      2411   +19     
===========================================
  Files            173       173           
  Lines           8726      8804   +78     
===========================================
+ Hits            8726      8804   +78     

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 16a6d2f2-863b-4a38-a30a-98b276e41768

📥 Commits

Reviewing files that changed from the base of the PR and between f0f3f5a and ce2c014.

⛔ Files ignored due to path filters (1)
  • resources/assets/dist/css/debug.min.css is excluded by !**/dist/**, !**/*.min.css
📒 Files selected for processing (12)
  • resources/src/styles/main.css
  • src/Panel/PanelRenderer.php
  • src/Panel/User/UserDataNormalizer.php
  • src/Panel/User/UserMessage.php
  • src/Panel/User/UserPanel.php
  • src/Theme/Css.php
  • tests/Panel/PanelRendererTest.php
  • tests/Panel/User/UserDataNormalizerTest.php
  • tests/Panel/User/UserPanelTest.php
  • tests/Provider/CssProvider.php
  • tests/Support/PanelViewAccessors.php
  • tests/Theme/CssTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (23)
  • GitHub Check: mutation / PHP 8.5-ubuntu-latest
  • GitHub Check: quality / Markdown (ubuntu-latest)
  • GitHub Check: quality / YAML (ubuntu-latest)
  • GitHub Check: quality / Spelling (ubuntu-latest)
  • GitHub Check: quality / EditorConfig (ubuntu-latest)
  • GitHub Check: quality / Actionlint (ubuntu-latest)
  • GitHub Check: phpstan / PHP 8.5-ubuntu-latest
  • GitHub Check: easy-coding-standard / PHP 8.5-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.5-windows-2022
  • GitHub Check: Verify Vite build reproduces dist.
  • GitHub Check: phpunit / PHP 8.5-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.3-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.4-windows-2022
  • GitHub Check: phpunit / PHP 8.4-ubuntu-latest
  • GitHub Check: composer-require-checker / PHP 8.5-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.3-windows-2022
  • GitHub Check: Analyze (actions)
  • GitHub Check: phpunit / PHP 8.4-windows-2022
  • GitHub Check: phpunit / PHP 8.3-windows-2022
  • GitHub Check: easy-coding-standard / PHP 8.5-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.5-windows-2022
  • GitHub Check: mutation / PHP 8.5-ubuntu-latest
  • GitHub Check: Verify Vite build reproduces dist.
🧰 Additional context used
🪛 PHPMD (2.15.0)
tests/Theme/CssTest.php

[error] 56-56: Avoid using static access to class '\PHPForge\Debug\Theme\Css' in method 'testHeroMapsEveryToneToItsAccentClasses'. (undefined)

(StaticAccess)

src/Panel/PanelRenderer.php

[warning] 66-873: The class PanelRenderer has an overall complexity of 65 which is very high. The configured complexity threshold is 50. (undefined)

(ExcessiveClassComplexity)


[error] 66-873: The class PanelRenderer has a coupling between objects value of 65. Consider to reduce the number of dependencies under 13. (undefined)

(CouplingBetweenObjects)


[error] 439-439: Avoid using static access to class '\PHPForge\Debug\Helper\Badge' in method 'hero'. (undefined)

(StaticAccess)


[error] 469-469: Avoid using static access to class '\PHPForge\Debug\Theme\Css' in method 'hero'. (undefined)

(StaticAccess)

tests/Panel/PanelRendererTest.php

[warning] 23-902: The class PanelRendererTest has 29 non-getter- and setter-methods. Consider refactoring PanelRendererTest to keep number of methods under 25. (undefined)

(TooManyMethods)


[warning] 23-902: The class PanelRendererTest has 29 public methods. Consider refactoring PanelRendererTest to keep number of public methods under 10. (undefined)

(TooManyPublicMethods)


[error] 448-458: Avoid using static access to class '\PHPForge\Debug\Panel\PanelRenderer' in method 'testHeroRendersTheSubjectStatusAndMetricRow'. (undefined)

(StaticAccess)


[error] 454-454: Avoid using static access to class '\PHPForge\Debug\PanelView' in method 'testHeroRendersTheSubjectStatusAndMetricRow'. (undefined)

(StaticAccess)


[error] 455-455: Avoid using static access to class '\PHPForge\Debug\PanelView' in method 'testHeroRendersTheSubjectStatusAndMetricRow'. (undefined)

(StaticAccess)


[error] 456-456: Avoid using static access to class '\PHPForge\Debug\PanelView' in method 'testHeroRendersTheSubjectStatusAndMetricRow'. (undefined)

(StaticAccess)


[error] 479-479: Avoid using static access to class '\PHPForge\Debug\Panel\PanelRenderer' in method 'testHeroWithoutOptionalPartsStaysNeutral'. (undefined)

(StaticAccess)

tests/Panel/User/UserDataNormalizerTest.php

[warning] 21-548: The class UserDataNormalizerTest has 19 public methods. Consider refactoring UserDataNormalizerTest to keep number of public methods under 10. (undefined)

(TooManyPublicMethods)


[error] 338-341: Avoid using static access to class '\PHPForge\Debug\Panel\User\UserDataNormalizer' in method 'testFromIdentityMapsATextualStatusByItsLabel'. (undefined)

(StaticAccess)


[error] 461-471: Avoid using static access to class '\PHPForge\Debug\Panel\User\UserDataNormalizer' in method 'testFromIdentityResolvesAttributeLabelsFromTheLabelMap'. (undefined)

(StaticAccess)

tests/Panel/User/UserPanelTest.php

[warning] 33-157: The method testAuthenticatedIdentityDescribesItsHeroAndAttributeSections() has 125 lines of code. Current threshold is set to 100. Avoid really long methods. (undefined)

(ExcessiveMethodLength)

src/Panel/User/UserPanel.php

[error] 127-130: Avoid using static access to class '\PHPForge\Debug\PanelView' in method 'identity'. (undefined)

(StaticAccess)


[error] 131-131: Avoid using static access to class '\PHPForge\Debug\PanelView' in method 'identity'. (undefined)

(StaticAccess)


[error] 132-135: Avoid using static access to class '\PHPForge\Debug\PanelView' in method 'identity'. (undefined)

(StaticAccess)


[error] 260-260: Avoid using static access to class 'PHPForge\Debug\Panel\User\UserRbacRow' in method 'rbacRows'. (undefined)

(StaticAccess)

🔇 Additional comments (13)
src/Panel/User/UserDataNormalizer.php (2)

197-201: LGTM!


328-333: LGTM!

src/Panel/User/UserMessage.php (1)

48-60: LGTM!

tests/Panel/User/UserDataNormalizerTest.php (1)

336-349: LGTM!

src/Panel/PanelRenderer.php (1)

401-472: LGTM!

src/Theme/Css.php (1)

467-476: LGTM!

resources/src/styles/main.css (1)

3746-3901: LGTM!

tests/Panel/PanelRendererTest.php (1)

416-483: LGTM!

tests/Provider/CssProvider.php (1)

50-61: LGTM!

tests/Support/PanelViewAccessors.php (1)

184-193: LGTM!

tests/Theme/CssTest.php (1)

51-60: LGTM!

src/Panel/User/UserPanel.php (1)

244-285: LGTM!

tests/Panel/User/UserPanelTest.php (1)

355-381: LGTM!


📝 Summary

Summary by CodeRabbit

  • New Features
    • Added a redesigned user identity panel with a status badge and metrics for user ID, roles, permissions, and login count.
    • Grouped identity attributes, roles, and permissions into titled sections, with clear empty-state messages when data is unavailable.
    • Status labels now match regardless of capitalization.
  • Bug Fixes
    • Guest sign-in guidance now provides a complete message about when identity details will appear.

Walkthrough

The user panel now presents identity details in a hero and groups attributes, roles, and permissions into sections. Hero rendering supports optional status and metrics with tone-based styling. Status normalization recognizes configured textual labels without regard to case.

Changes

User identity panel

Layer / File(s) Summary
Normalize user status and identity fields
src/Panel/User/UserDataNormalizer.php, src/Panel/User/UserMessage.php, tests/Panel/User/UserDataNormalizerTest.php
Identity fields and sign-in text changed. Status matching now recognizes configured labels case-insensitively.
Render and style hero blocks
src/Panel/PanelRenderer.php, src/Theme/Css.php, resources/src/styles/main.css, tests/Panel/PanelRendererTest.php, tests/Provider/CssProvider.php, tests/Support/PanelViewAccessors.php, tests/Theme/CssTest.php
Hero blocks render optional identity details, status badges, and metrics. Theme classes and CSS provide tone variants, with tests covering rendering and tone mapping.
Build identity and RBAC sections
src/Panel/User/UserPanel.php, tests/Panel/User/UserPanelTest.php
The panel presents identity details in a hero and wraps attribute groups and RBAC tables or empty states in marked sections.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to ce2c0

The new user-panel presentation and its styles are ready to merge after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to ce2c0

The changes primarily affect debugger presentation. No security issue introduced by the PR was established, but the available evidence does not fully establish who can receive the panel or how all supplied text is encoded.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new generic block-rendering path may be reusable by other panel producers, while the shown identity and RBAC values originate in the User panel's captured payload. The evidence does not establish a wider audience for that payload.

Trust Boundaries and Controls

  • observed — The current presentation path suppresses identity and RBAC rendering for a missing or empty identity payload. It does not itself establish the upstream capture or outer panel-access policy.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 11 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main User panel changes, including the hero header, marked sections, RBAC counts, textual status matching, and guest-state wording.
Description check ✅ Passed The description identifies the pull request as a non-breaking new feature, which matches the documented changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 11 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

This rabbit sees a hero glow,
With badges set in tones that show.
The roles sit neatly in their rows,
While names and status clearly show.
I nibble greens, then hop below.

Comment @coderabbitai help to get the list of available commands.

@terabytesoftw
terabytesoftw merged commit 4499689 into main Sep 26, 2026
43 checks passed
@terabytesoftw
terabytesoftw deleted the feat/user-panel-hero branch September 26, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant