Skip to content

Conversation

@ahmadshaheer
Copy link
Collaborator

@ahmadshaheer ahmadshaheer commented Dec 4, 2025

📄 Summary

Updated BodyTitleRenderer to copy only field values (without keys) when clicking on fields in the log body JSON view.


🔍 Related Issues

Closes https://github.com/SigNoz/engineering-pod/issues/3386


📸 Screenshots / Screen Recording (if applicable / mandatory for UI related changes)

Before:

Screen.Recording.2025-12-04.102502.mp4

After:

Screen.Recording.2025-12-04.102354.mp4

📋 Checklist

  • Dev Review
  • Test cases added (Unit/ Integration / E2E)
  • Manually tested the changes

👀 Notes for Reviewers


Note

Updates copy-to-clipboard to copy raw values (or pretty JSON for objects) without keys, and adjusts tests accordingly.

  • Frontend
    • frontend/src/container/LogDetailedView/BodyTitleRenderer.tsx
      • Change handleNodeClick to copy only the value:
        • Primitives/array elements: copy raw value (no key, no quotes wrapping strings).
        • Objects/arrays: copy pretty-printed JSON.stringify(value, null, 2) without the key.
      • Keeps success notifications, referencing the clicked key.
  • Tests
    • frontend/src/container/LogDetailedView/__tests__/BodyTitleRenderer.test.tsx
      • Update expectations to match new copy behavior for primitives, array elements, and objects.

Written by Cursor Bugbot for commit dcd8b17. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added the bug Something isn't working label Dec 4, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

const valueStr = typeof value === 'string' ? `"${value}"` : String(value);
copyText = `"${cleanedKey}": ${valueStr}`;
const valueStr = typeof value === 'string' ? value : String(value);
copyText = valueStr;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Empty string values copy without showing success notification

When value is an empty string, the new code sets copyText to "" (a falsy value), causing the if (copyText) check to fail and skip the success notification. The copy operation on line 105 still executes, so the empty string is copied to the clipboard, but users won't see the "copied to clipboard" notification. Previously, copyText included the key prefix (e.g., "key": ""), which was truthy and displayed the notification correctly.

Fix in Cursor Fix in Web

@nityanandagohain
Copy link
Member

let's hold till we have more clarity on how should it behave for nested keys

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants