Skip to content

Commit

Permalink
Remove address from inline attributes
Browse files Browse the repository at this point in the history
Summary:
This is very noisey and makes it hard to see things like blok state which we want to highlight.

Show it in the side bar instead

Reviewed By: lblasa

Differential Revision: D55251460

fbshipit-source-id: f8476af4b8baaf588a51958d155aa2e401251e73
  • Loading branch information
Luke De Feo authored and facebook-github-bot committed Mar 25, 2024
1 parent 8060f11 commit 386bd58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ - (NSString*)nameForNode:(id)node {
}

- (UIDInlineAttributes*)inlineAttributesForNode:(id)node {
return @{@"address" : [NSString stringWithFormat:@"%p", node]};
return nil;
}

- (UIDGenericAttributes*)hiddenAttributesForNode:(id)node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import "UIDSnapshot.h"
#import "UIView+UIDDescriptor.h"

static UIDMetadataId AddressAttributeId;
static UIDMetadataId UIViewAttributeId;
static UIDMetadataId FrameAttributeId;
static UIDMetadataId BoundsAttributeId;
Expand Down Expand Up @@ -83,6 +84,9 @@ - (nonnull NSString*)UID_name {
- (void)UID_aggregateAttributes:(nonnull UIDMutableAttributes*)attributes {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
AddressAttributeId = [[UIDMetadataRegister shared]
registerMetadataWithType:UIDEBUGGER_METADATA_TYPE_ATTRIBUTE
name:@"Address"];
UIViewAttributeId = [[UIDMetadataRegister shared]
registerMetadataWithType:UIDEBUGGER_METADATA_TYPE_ATTRIBUTE
name:@"UIView"];
Expand Down Expand Up @@ -345,6 +349,11 @@ - (void)UID_aggregateAttributes:(nonnull UIDMutableAttributes*)attributes {

NSMutableDictionary* viewAttributes = [NSMutableDictionary new];

[viewAttributes
setObject:[UIDInspectableText
fromText:[NSString stringWithFormat:@"%p", self]]
forKey:AddressAttributeId];

[viewAttributes setObject:[UIDInspectableBounds fromRect:self.frame]
forKey:FrameAttributeId];
[viewAttributes setObject:[UIDInspectableBounds fromRect:self.bounds]
Expand Down

0 comments on commit 386bd58

Please sign in to comment.