Skip to content

chore: improve indicator for non system records with empty notes Bed 8922 - #3000

Merged
LucasParraF merged 5 commits into
mainfrom
BED-8922-improve-indicator-for-non-system-records-with-empty-notes
Jul 21, 2026
Merged

chore: improve indicator for non system records with empty notes Bed 8922#3000
LucasParraF merged 5 commits into
mainfrom
BED-8922-improve-indicator-for-non-system-records-with-empty-notes

Conversation

@LucasParraF

@LucasParraF LucasParraF commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

Updated the History table to change how the absence of notes is displayed for records not created by BloodHound. Instead of rendering a disabled note icon, the table now displays a - character. The tooltip behavior was also updated to provide appropriate messaging depending on whether the action was performed by BloodHound or by another source.

Motivation and Context

Resolves BED-8922

How Has This Been Tested?

Tested locally and added new test cases to cover the changes

Screenshots (optional):

Video with demo attached to the Jira ticket

Types of changes

  • Chore (a change that does not modify the application functionality)

Checklist:

Summary by CodeRabbit

Summary

  • Bug Fixes
    • Improved rendering of history notes when no note is available, using clearer “No notes” messaging tailored to the entry type.
    • Note controls now show a “-” placeholder when missing, and provide consistent “Show note” / “Hide note” tooltips when notes are present.
  • Tests
    • Updated note cell tests to use userEvent and added/adjusted tooltip coverage for missing-note scenarios.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 60b83f17-4f26-40cc-a0b0-257330cea1fc

📥 Commits

Reviewing files that changed from the base of the PR and between e0fe3bf and 28c6ec5.

📒 Files selected for processing (1)
  • packages/javascript/bh-shared-ui/src/views/PrivilegeZones/History/NoteCell.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/javascript/bh-shared-ui/src/views/PrivilegeZones/History/NoteCell.tsx

📝 Walkthrough

Walkthrough

NoteCell renders missing notes as tooltip-enabled dashes and available notes as selectable buttons with state-based labels. Tests centralize history context setup and cover actor-specific missing-note tooltips.

Changes

NoteCell note handling

Layer / File(s) Summary
Note rendering and tooltip coverage
packages/javascript/bh-shared-ui/src/views/PrivilegeZones/History/NoteCell.tsx, packages/javascript/bh-shared-ui/src/views/PrivilegeZones/History/NoteCell.test.tsx
NoteCell bases rendering on note presence, derives toggle labels from selection state, and provides actor-specific missing-note tooltips. Tests update context mocking, add hover coverage, and remove the obsolete disabled-button assertion.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the PR's main change: changing the empty-note indicator and tooltip behavior for non-BloodHound records.
Description check ✅ Passed The description includes the required sections and covers the change, motivation, testing, screenshots note, type, and checklist.
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.
✨ 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 BED-8922-improve-indicator-for-non-system-records-with-empty-notes

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

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

@LucasParraF LucasParraF changed the title chore: improve indicator for non system records with empty notes Bed 8922 chore: improve indicator for non system records with empty notes Bed 8922 Jul 16, 2026

@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/PrivilegeZones/History/NoteCell.tsx`:
- Around line 35-39: Update the no-note placeholder in the NoteCell rendering
branch to add tabIndex={0} to the <p> element wrapped by Tooltip, making the “No
notes” tooltip trigger keyboard-accessible while preserving the existing
placeholder content and styling.
🪄 Autofix (Beta)

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: 99df937d-549b-435a-a46f-dd567b0c1c47

📥 Commits

Reviewing files that changed from the base of the PR and between c786b1e and 0323751.

📒 Files selected for processing (2)
  • packages/javascript/bh-shared-ui/src/views/PrivilegeZones/History/NoteCell.test.tsx
  • packages/javascript/bh-shared-ui/src/views/PrivilegeZones/History/NoteCell.tsx

Comment thread packages/javascript/bh-shared-ui/src/views/PrivilegeZones/History/NoteCell.tsx Outdated
@LucasParraF LucasParraF self-assigned this Jul 16, 2026
@LucasParraF LucasParraF added the user interface A pull request containing changes affecting the UI code. label Jul 16, 2026
{actor === BloodHoundString ? (
<Tooltip tooltip={`No notes for ${BloodHoundString} history`}>
{!note ? (
<Tooltip tooltip={noNoteTooltip}>

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.

Could we potentially move this tooltip to wrap the entire cell div instead? the <p> tag itself is only as wide as the dash character and only triggers when the mouse is directly on top, which feels a little too difficult to trigger

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.

agreed and that way only use Tooltip component once.


const noteIsActive = selected?.id === id;
const tip = !note ? 'No notes' : noteIsActive ? 'Hide note' : 'Show note';
const tip = noteIsActive ? 'Hide note' : 'Show note';

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.

nit(ish): Maybe we can make tip two words and will it help make it more descriptive.

Comment on lines +29 to +35
const noteToolTipContent = note
? noteIsActive
? 'Hide note'
: 'Show note'
: actor === BloodHoundString
? `No notes for ${BloodHoundString} history`
: 'No notes';

@specter-flq specter-flq Jul 20, 2026

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.

Thank you for the changes, wonder if we could benefit with readability by breaking this done further. Maybe creating a variable for the first condition and for the second and you then end up with a one line terniary:

const activeNoteTooltipContent = noteIsActive  ? 'Hide note' : 'Show note';
const isSystemNote = actor ===  BloodHoundString;
const systemNoteTooltipContent = isSystemNote  ? `No notes for ${BloodHoundString} history` : 'No notes';
const noteTooltipContent = note ? activeNoteTooltipContent : systemNoteTooltipContent

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

works great, appreciate the change!

@specter-flq specter-flq 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! Thank you for the changes!

@LucasParraF
LucasParraF merged commit 2a32f9d into main Jul 21, 2026
13 checks passed
@LucasParraF
LucasParraF deleted the BED-8922-improve-indicator-for-non-system-records-with-empty-notes branch July 21, 2026 14:30
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

user interface A pull request containing changes affecting the UI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants