Skip to content

Commit da72889

Browse files
authored
Updates chrome url and how object and array properties are expanded (#15)
* Update version to 0.1.1 and improve documentation - Bumped version in package.json from 0.1.0 to 0.1.1. - Updated Chrome Web Store link in README.md for direct access. - Enhanced user guidance in Popup component regarding ad blockers affecting event visibility. * Enhance PropertyRow component and update README - Modified the initial state logic in PropertyRow to conditionally expand properties based on their type and length, improving user experience. - Updated the Chrome Web Store link in README.md for direct access to the Analytics X-Ray extension. * Update version to 0.1.2 in package.json
1 parent cf29863 commit da72889

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Open to adding support for other Analytics services.
6767

6868
### Chrome Web Store
6969

70-
1. Visit the [Chrome Web Store listing](https://chromewebstore.google.com/detail/nabnhcbhcecfohhaodnpoipanaaapkpi)
70+
1. Visit the [Chrome Web Store listing](https://chromewebstore.google.com/detail/analytics-x-ray/nabnhcbhcecfohhaodnpoipanaaapkpi)
7171
2. Click **"Add to Chrome"**
7272
3. Confirm the installation
7373
4. Open Chrome DevTools (F12 or Cmd+Option+I) and look for the "Analytics X-Ray" tab

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "analytics-x-ray",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Analytics X-Ray is a tool that helps you analyze your analytics data.",
55
"license": "MIT",
66
"repository": {

src/pages/devtools/components/detail/primitives/PropertyRow/PropertyRow.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,25 @@ export const PropertyRow = React.memo(
3333
onTogglePin,
3434
showPinButton = false,
3535
}: Readonly<PropertyRowProps>) {
36-
const [state, setState] = useState<PropertyRowState>({
37-
isExpanded: false,
38-
copied: false,
39-
useJsonView: false,
40-
visibleChunks: new Set([0]), // First chunk visible by default
36+
const [state, setState] = useState<PropertyRowState>(() => {
37+
// Only expand top-level properties (depth === 0) by default
38+
if (depth !== 0 || !isExpandable(value)) {
39+
return {
40+
isExpanded: false,
41+
copied: false,
42+
useJsonView: false,
43+
visibleChunks: new Set([0]),
44+
};
45+
}
46+
// For arrays, only expand if length < 50
47+
// For objects, always expand (no length check)
48+
const shouldExpand = Array.isArray(value) ? value.length < 50 : true;
49+
return {
50+
isExpanded: shouldExpand,
51+
copied: false,
52+
useJsonView: false,
53+
visibleChunks: new Set([0]), // First chunk visible by default
54+
};
4155
});
4256

4357
// Helper for partial updates

0 commit comments

Comments
 (0)