From 386bd58f1ed0272532f7e7eb7ce1239b74e66ab0 Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Mon, 25 Mar 2024 07:01:19 -0700 Subject: [PATCH] Remove address from inline attributes 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 --- .../Descriptors/UIDNodeDescriptor.m | 2 +- .../Descriptors/UIView+UIDDescriptor.m | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIDNodeDescriptor.m b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIDNodeDescriptor.m index f3f7bb671ab..3b576ce45cc 100644 --- a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIDNodeDescriptor.m +++ b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIDNodeDescriptor.m @@ -20,7 +20,7 @@ - (NSString*)nameForNode:(id)node { } - (UIDInlineAttributes*)inlineAttributesForNode:(id)node { - return @{@"address" : [NSString stringWithFormat:@"%p", node]}; + return nil; } - (UIDGenericAttributes*)hiddenAttributesForNode:(id)node { diff --git a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIView+UIDDescriptor.m b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIView+UIDDescriptor.m index a6ea0c6c940..4ecfaff9d68 100644 --- a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIView+UIDDescriptor.m +++ b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIView+UIDDescriptor.m @@ -14,6 +14,7 @@ #import "UIDSnapshot.h" #import "UIView+UIDDescriptor.h" +static UIDMetadataId AddressAttributeId; static UIDMetadataId UIViewAttributeId; static UIDMetadataId FrameAttributeId; static UIDMetadataId BoundsAttributeId; @@ -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"]; @@ -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]