Skip to content

feat: Display Associated Labels in Explore Entity Panel BED-9168 - #3102

Open
justin-prime1 wants to merge 1 commit into
mainfrom
feature/explore-entity-panel-labels
Open

feat: Display Associated Labels in Explore Entity Panel BED-9168#3102
justin-prime1 wants to merge 1 commit into
mainfrom
feature/explore-entity-panel-labels

Conversation

@justin-prime1

@justin-prime1 justin-prime1 commented Aug 5, 2026

Copy link
Copy Markdown

Description

Displays every custom label associated with the selected entity in Explore's Object Information panel.

The shared UI derives associated label-type asset-group tags from the selected node's kinds, excludes zone, ownership, and unrelated tags, and renders multiple labels comma-separated on one row with natural wrapping when horizontal space is unavailable.

Review size: 23 production-code additions and 3 deletions, plus 63 test additions and 1 test deletion.

Motivation and Context

Resolves BED-9168

Analysts currently cannot see an entity's associated custom labels from the Explore entity panel. They must leave their investigation context or use another workflow to determine how the entity has been categorized.

Displaying the labels alongside the existing object information makes this context immediately available without changing the underlying label or asset-group behavior.

How Has This Been Tested?

Environment:

  • Isolated local BloodHound Enterprise development stack
  • Official Active Directory and Entra ID sample data
  • Entity with three associated labels for multi-label rendering coverage

Automated validation:

  • just prepare-for-codereview
  • Focused shared UI unit tests: 11 passed
  • Shared UI TypeScript type checking
  • Playwright entity-panel regression coverage

Manual browser validation:

  • Confirmed all three associated labels appear in the Object Information panel
  • Confirmed only associated label-type tags are displayed
  • Confirmed labels are comma-separated on the same row when space permits
  • Confirmed labels naturally wrap when the row is constrained
  • Confirmed the entity panel remains usable at 200% browser zoom
  • Confirmed no browser console errors and successful UI/API responses

Screenshots (optional):

Explore context

Explore context

Entity panel

Entity panel

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have met the contributing prerequisites
  • I have ensured that related documentation is up-to-date
    • No OpenAPI or user-facing documentation changes are required
    • Existing code comments and JSDoc remain accurate
  • I have followed proper test practices
    • Added/updated tests to cover my changes
    • All relevant new and existing tests passed

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change extracts matching custom label names from asset-group tags and displays them in entity information fields. Tests cover label filtering and entity rendering while excluding zone, owned, unrelated, and unassociated tags.

Changes

Entity label display

Layer / File(s) Summary
Label matching and field rendering
packages/javascript/bh-shared-ui/src/hooks/useAssetGroupTags/useAssetGroupTags.tsx, packages/javascript/bh-shared-ui/src/views/Explore/BasicObjectInfoFields.tsx, packages/javascript/bh-shared-ui/src/hooks/useAssetGroupTags/useAssetGroupTags.test.tsx
getLabelNamesFromKinds filters matching label tags. BasicObjectInfoFields accepts labels and renders them as comma-separated text. Unit tests cover the filtering behavior.
Entity information integration
packages/javascript/bh-shared-ui/src/components/EntityInfo/EntityObjectInformation.tsx, packages/javascript/bh-shared-ui/src/components/EntityInfo/EntityInfoContent.test.tsx
Entity information derives labels from queried tags and selected node kinds. Integration tests verify that only associated labels are displayed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: urangel

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly identifies the feature: displaying associated labels in the Explore entity panel.
Description check ✅ Passed The description covers the change, motivation, ticket, testing, screenshots, change type, and completed checklist.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/explore-entity-panel-labels

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/javascript/bh-shared-ui/src/views/Explore/BasicObjectInfoFields.tsx`:
- Around line 80-87: Update the fieldValues construction in
BasicObjectInfoFields so labels is undefined when the labels array is empty,
while preserving the joined label string for non-empty arrays. Keep the existing
field rendering guard unchanged so the Labels row is omitted when no labels
exist.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 3fb6be4d-be54-4f57-ba0f-bd62f19bdeb5

📥 Commits

Reviewing files that changed from the base of the PR and between d919b43 and ae11c12.

📒 Files selected for processing (5)
  • packages/javascript/bh-shared-ui/src/components/EntityInfo/EntityInfoContent.test.tsx
  • packages/javascript/bh-shared-ui/src/components/EntityInfo/EntityObjectInformation.tsx
  • packages/javascript/bh-shared-ui/src/hooks/useAssetGroupTags/useAssetGroupTags.test.tsx
  • packages/javascript/bh-shared-ui/src/hooks/useAssetGroupTags/useAssetGroupTags.tsx
  • packages/javascript/bh-shared-ui/src/views/Explore/BasicObjectInfoFields.tsx

@justin-prime1 justin-prime1 added enhancement New feature or request user interface A pull request containing changes affecting the UI code. javascript Pull requests that update javascript code labels Aug 6, 2026
@justin-prime1 justin-prime1 self-assigned this Aug 6, 2026

@urangel urangel 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.

lgtm 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request javascript Pull requests that update javascript code user interface A pull request containing changes affecting the UI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants