Skip to content

A high-performance Android storage analyzer that bypasses MTP using a native C++ daemon, a Rust TCP bridge, and a React Treemap UI.

Rust

Render the storage map with a bounded SVG layout (#137)

Vishnu Srivatsava017cc9bb8ddf
diff --git a/package-lock.json b/package-lock.json
index a54c2e9..1733f94 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,7 +13,6 @@
"@tauri-apps/api": "^2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
- "recharts": "^3.8.1",
"tailwindcss": "^4.3.0"
},
"devDependencies": {
@@ -1015,42 +1014,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/@reduxjs/toolkit": {
- "version": "2.11.2",
- "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.11.2.tgz",
- "integrity": "sha512-Kd6kAHTA6/nUpp8mySPqj3en3dm0tdMIgbttnQ1xFMVpufoj+ADi8pXLBsd4xzTRHQa7t/Jv8W5UnCuW4kuWMQ==",
- "license": "MIT",
- "dependencies": {
- "@standard-schema/spec": "^1.0.0",
- "@standard-schema/utils": "^0.3.0",
- "immer": "^11.0.0",
- "redux": "^5.0.1",
- "redux-thunk": "^3.1.0",
- "reselect": "^5.1.0"
- },
- "peerDependencies": {
- "react": "^16.9.0 || ^17.0.0 || ^18 || ^19",
- "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0"
- },
- "peerDependenciesMeta": {
- "react": {
- "optional": true
- },
- "react-redux": {
- "optional": true
- }
- }
- },
- "node_modules/@reduxjs/toolkit/node_modules/immer": {
- "version": "11.1.8",
- "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.8.tgz",
- "integrity": "sha512-/tbkHMW7y10Lx6i1crLjD4/OhNkRG+Fo7byZHtah0547nIeXYcpIXaUh0IAQY6gO5459qpGGYapcEOHtFXkIuA==",
- "license": "MIT",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/immer"
- }
- },
"node_modules/@rolldown/pluginutils": {
"version": "1.0.0-beta.27",
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz",
@@ -1422,18 +1385,6 @@
"win32"
]
},
- "node_modules/@standard-schema/spec": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
- "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
- "license": "MIT"
- },
- "node_modules/@standard-schema/utils": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz",
- "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==",
- "license": "MIT"
- },
"node_modules/@tailwindcss/node": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.0.tgz",
@@ -2050,69 +2001,6 @@
"@babel/types": "^7.28.2"
}
},
- "node_modules/@types/d3-array": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz",
- "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==",
- "license": "MIT"
- },
- "node_modules/@types/d3-color": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz",
- "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==",
- "license": "MIT"
- },
- "node_modules/@types/d3-ease": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz",
- "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==",
- "license": "MIT"
- },
- "node_modules/@types/d3-interpolate": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz",
- "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==",
- "license": "MIT",
- "dependencies": {
- "@types/d3-color": "*"
- }
- },
- "node_modules/@types/d3-path": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz",
- "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==",
- "license": "MIT"
- },
- "node_modules/@types/d3-scale": {
- "version": "4.0.9",
- "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz",
- "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==",
- "license": "MIT",
- "dependencies": {
- "@types/d3-time": "*"
- }
- },
- "node_modules/@types/d3-shape": {
- "version": "3.1.8",
- "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz",
- "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==",
- "license": "MIT",
- "dependencies": {
- "@types/d3-path": "*"
- }
- },
- "node_modules/@types/d3-time": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz",
- "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==",
- "license": "MIT"
- },
- "node_modules/@types/d3-timer": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz",
- "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==",
- "license": "MIT"
- },
"node_modules/@types/esrecurse": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz",
@@ -2137,7 +2025,7 @@
"version": "19.2.14",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz",
"integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",
- "devOptional": true,
+ "dev": true,
"license": "MIT",
"dependencies": {
"csstype": "^3.2.2"
@@ -2153,12 +2041,6 @@
"@types/react": "^19.2.0"
}
},
- "node_modules/@types/use-sync-external-store": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz",
- "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==",
- "license": "MIT"
- },
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.0.tgz",
@@ -2568,15 +2450,6 @@
],
"license": "CC-BY-4.0"
},
- "node_modules/clsx": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
- "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/convert-source-map": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
@@ -2603,130 +2476,9 @@
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
- "devOptional": true,
+ "dev": true,
"license": "MIT"
},
- "node_modules/d3-array": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",
- "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
- "license": "ISC",
- "dependencies": {
- "internmap": "1 - 2"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-color": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
- "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-ease": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
- "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
- "license": "BSD-3-Clause",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-format": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz",
- "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-interpolate": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
- "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
- "license": "ISC",
- "dependencies": {
- "d3-color": "1 - 3"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-path": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz",
- "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-scale": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",
- "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
- "license": "ISC",
- "dependencies": {
- "d3-array": "2.10.0 - 3",
- "d3-format": "1 - 3",
- "d3-interpolate": "1.2.0 - 3",
- "d3-time": "2.1.1 - 3",
- "d3-time-format": "2 - 4"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-shape": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz",
- "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
- "license": "ISC",
- "dependencies": {
- "d3-path": "^3.1.0"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-time": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",
- "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
- "license": "ISC",
- "dependencies": {
- "d3-array": "2 - 3"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-time-format": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",
- "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
- "license": "ISC",
- "dependencies": {
- "d3-time": "1 - 3"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-timer": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
- "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/debug": {
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
@@ -2745,12 +2497,6 @@
}
}
},
- "node_modules/decimal.js-light": {
- "version": "2.5.1",
- "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz",
- "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==",
- "license": "MIT"
- },
"node_modules/deep-is": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
@@ -2787,16 +2533,6 @@
"node": ">=10.13.0"
}
},
- "node_modules/es-toolkit": {
- "version": "1.46.1",
- "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.46.1.tgz",
- "integrity": "sha512-5eNtXOs3tbfxXOj04tjjseeWkRWaoCjdEI+96DgwzZoe6c9juL49pXlzAFTI72aWC9Y8p7168g6XIKjh7k6pyQ==",
- "license": "MIT",
- "workspaces": [
- "docs",
- "benchmarks"
- ]
- },
"node_modules/esbuild": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz",
@@ -3036,12 +2772,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/eventemitter3": {
- "version": "5.0.4",
- "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
- "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
- "license": "MIT"
- },
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@@ -3229,16 +2959,6 @@
"node": ">= 4"
}
},
- "node_modules/immer": {
- "version": "10.2.0",
- "resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz",
- "integrity": "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==",
- "license": "MIT",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/immer"
- }
- },
"node_modules/imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
@@ -3249,15 +2969,6 @@
"node": ">=0.8.19"
}
},
- "node_modules/internmap": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",
- "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -3899,36 +3610,6 @@
"react": "^19.2.6"
}
},
- "node_modules/react-is": {
- "version": "19.2.6",
- "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.6.tgz",
- "integrity": "sha512-XjBR15BhXuylgWGuslhDKqlSayuqvqBX91BP8pauG8kd1zY8kotkNWbXksTCNRarse4kuGbe2kIY05ARtwNIvw==",
- "license": "MIT",
- "peer": true
- },
- "node_modules/react-redux": {
- "version": "9.2.0",
- "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz",
- "integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==",
- "license": "MIT",
- "dependencies": {
- "@types/use-sync-external-store": "^0.0.6",
- "use-sync-external-store": "^1.4.0"
- },
- "peerDependencies": {
- "@types/react": "^18.2.25 || ^19",
- "react": "^18.0 || ^19",
- "redux": "^5.0.0"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "redux": {
- "optional": true
- }
- }
- },
"node_modules/react-refresh": {
"version": "0.17.0",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz",
@@ -3939,57 +3620,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/recharts": {
- "version": "3.8.1",
- "resolved": "https://registry.npmjs.org/recharts/-/recharts-3.8.1.tgz",
- "integrity": "sha512-mwzmO1s9sFL0TduUpwndxCUNoXsBw3u3E/0+A+cLcrSfQitSG62L32N69GhqUrrT5qKcAE3pCGVINC6pqkBBQg==",
- "license": "MIT",
- "workspaces": [
- "www"
- ],
- "dependencies": {
- "@reduxjs/toolkit": "^1.9.0 || 2.x.x",
- "clsx": "^2.1.1",
- "decimal.js-light": "^2.5.1",
- "es-toolkit": "^1.39.3",
- "eventemitter3": "^5.0.1",
- "immer": "^10.1.1",
- "react-redux": "8.x.x || 9.x.x",
- "reselect": "5.1.1",
- "tiny-invariant": "^1.3.3",
- "use-sync-external-store": "^1.2.2",
- "victory-vendor": "^37.0.2"
- },
- "engines": {
- "node": ">=18"
- },
- "peerDependencies": {
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
- "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
- "react-is": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
- }
- },
- "node_modules/redux": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
- "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",
- "license": "MIT"
- },
- "node_modules/redux-thunk": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz",
- "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==",
- "license": "MIT",
- "peerDependencies": {
- "redux": "^5.0.0"
- }
- },
- "node_modules/reselect": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz",
- "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==",
- "license": "MIT"
- },
"node_modules/rollup": {
"version": "4.60.3",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.3.tgz",
@@ -4101,12 +3731,6 @@
"url": "https://opencollective.com/webpack"
}
},
- "node_modules/tiny-invariant": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
- "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
- "license": "MIT"
- },
"node_modules/tinyglobby": {
"version": "0.2.16",
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz",
@@ -4228,37 +3852,6 @@
"punycode": "^2.1.0"
}
},
- "node_modules/use-sync-external-store": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz",
- "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==",
- "license": "MIT",
- "peerDependencies": {
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
- }
- },
- "node_modules/victory-vendor": {
- "version": "37.3.6",
- "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.3.6.tgz",
- "integrity": "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ==",
- "license": "MIT AND ISC",
- "dependencies": {
- "@types/d3-array": "^3.0.3",
- "@types/d3-ease": "^3.0.0",
- "@types/d3-interpolate": "^3.0.1",
- "@types/d3-scale": "^4.0.2",
- "@types/d3-shape": "^3.1.0",
- "@types/d3-time": "^3.0.0",
- "@types/d3-timer": "^3.0.0",
- "d3-array": "^3.1.6",
- "d3-ease": "^3.0.1",
- "d3-interpolate": "^3.0.1",
- "d3-scale": "^4.0.2",
- "d3-shape": "^3.1.0",
- "d3-time": "^3.0.0",
- "d3-timer": "^3.0.1"
- }
- },
"node_modules/vite": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.7.tgz",
diff --git a/package.json b/package.json
index c9a547d..0f19ba3 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint src tests vite.config.ts eslint.config.js --max-warnings 0",
- "test": "node --test tests/format_bytes.test.mjs tests/scan_view.test.mjs tests/log_history.test.mjs tests/lint_gate.test.mjs tests/devices.test.mjs tests/file_types.test.mjs tests/scan_history.test.mjs tests/largest_files.test.mjs tests/search_results.test.mjs",
+ "test": "node --test tests/format_bytes.test.mjs tests/scan_view.test.mjs tests/log_history.test.mjs tests/lint_gate.test.mjs tests/devices.test.mjs tests/file_types.test.mjs tests/scan_history.test.mjs tests/largest_files.test.mjs tests/search_results.test.mjs tests/storage_map_layout.test.mjs",
"preview": "vite preview",
"tauri": "tauri"
},
@@ -17,7 +17,6 @@
"@tauri-apps/api": "^2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
- "recharts": "^3.8.1",
"tailwindcss": "^4.3.0"
},
"devDependencies": {
diff --git a/src/ResultScreen.tsx b/src/ResultScreen.tsx
index 0398239..d2f4a2a 100644
--- a/src/ResultScreen.tsx
+++ b/src/ResultScreen.tsx
@@ -1,6 +1,5 @@
import { useEffect, useState } from "react";
-import { Treemap, ResponsiveContainer, Tooltip as RechartsTooltip } from "recharts";
-import type { TreemapNode } from "recharts";
+import { StorageMap } from "./StorageMap";
import { formatBytes } from "./formatBytes";
import type { ScanResponse } from "./scanView";
import { useScanView } from "./useScanView";
@@ -23,42 +22,6 @@ function StatCard({ label, value, accent = false }: { label: string; value: stri
);
}
-// ── Custom Treemap Content ──────────────────────────────────────────────────
-
-const TreemapContent = (props: TreemapNode & { bgColors: string[] }) => {
- const { x, y, width, height, index, name, value, bgColors } = props;
- if (width < 30 || height < 30) return null;
- const bgColor = bgColors ? bgColors[index % bgColors.length] : "#0f172a";
-
- return (
- <g>
- <rect
- x={x}
- y={y}
- width={width}
- height={height}
- style={{
- fill: bgColor,
- stroke: "#ffffff20",
- strokeWidth: 1,
- }}
- />
- {width > 50 && height > 30 && name && (
- <text x={x + 6} y={y + 18} fill="#fff" fontSize={11} className="font-sans font-medium pointer-events-none drop-shadow-md truncate max-w-full">
- {name}
- </text>
- )}
- {width > 50 && height > 45 && value !== undefined && (
- <text x={x + 6} y={y + 32} fill="#94a3b8" fontSize={9} className="font-mono pointer-events-none">
- {formatBytes(value)}
- </text>
- )}
- </g>
- );
-};
-
-// ── Result Screen ───────────────────────────────────────────────────────────
-
export function ResultScreen({
data,
onRescan,
@@ -93,12 +56,6 @@ export function ResultScreen({
if (view.error === "Scan node is no longer available") onZoom(data.root.id);
}, [view.error, data.root.id]);
- const bgColors = [
- "#0d9488", "#0284c7", "#4f46e5", "#7c3aed",
- "#c026d3", "#e11d48", "#ea580c", "#ca8a04",
- ];
-
- const treemapData = (page?.chart ?? []).map(tile => ({ ...tile, nodeId: tile.node_id }));
const breadcrumbs = page?.breadcrumbs ?? [];
return (
@@ -179,39 +136,8 @@ export function ResultScreen({
className={`px-3 py-2 rounded-lg text-xs ${mode === "search" ? "bg-zinc-700 text-white" : "bg-zinc-900 text-zinc-400"}`}>Search</button>
</div>
{mode === "types" ? <FileTypes scope={data} busy={busy} /> : mode === "largest" ? <LargestFiles scope={data} busy={busy} onZoom={onZoom} onNuke={onNuke} /> : mode === "search" ? <SearchFiles scope={data} busy={busy} onZoom={onZoom} onNuke={onNuke} /> : <div className="flex-1 min-h-0 grid grid-rows-[7rem_minmax(0,1fr)] md:grid-rows-1 md:grid-cols-[minmax(0,1fr)_minmax(0,2fr)] gap-3 px-4 pb-3">
- {/* Treemap */}
<div className="min-h-0 min-w-0">
- <div className="glass-card rounded-xl p-2 w-full h-full relative group">
- <ResponsiveContainer width="100%" height="100%">
- <Treemap
- data={treemapData}
- dataKey="size"
- aspectRatio={4 / 3}
- stroke="#fff"
- content={node => <TreemapContent {...node} bgColors={bgColors} />}
- isAnimationActive={false}
- onClick={(e) => {
- if (!busy && typeof e?.nodeId === "number") onZoom(e.nodeId);
- }}
- >
- <RechartsTooltip
- content={({ active, payload }) => {
- if (active && payload && payload.length) {
- const p = payload[0].payload;
- return (
- <div className="bg-zinc-900 border border-zinc-800 p-2 rounded shadow-xl text-xs z-50">
- <p className="font-semibold text-zinc-200">{p.name}</p>
- <p className="text-zinc-400 font-mono mt-1">{formatBytes(p.size)}</p>
- {p.node_id !== null && <p className="text-zinc-600 mt-1">Click to Zoom</p>}
- </div>
- );
- }
- return null;
- }}
- />
- </Treemap>
- </ResponsiveContainer>
- </div>
+ <StorageMap page={page} busy={busy} onZoom={onZoom} />
</div>
{/* File tree */}
diff --git a/src/StorageMap.tsx b/src/StorageMap.tsx
new file mode 100644
index 0000000..e2cf555
--- /dev/null
+++ b/src/StorageMap.tsx
@@ -0,0 +1,54 @@
+import { useLayoutEffect, useRef, useState } from "react";
+import { formatBytes } from "./formatBytes";
+import type { ScanView } from "./scanView";
+import { layoutStorageMap } from "./storageMapLayout";
+
+const colors = ["#0d9488", "#0284c7", "#4f46e5", "#7c3aed", "#c026d3", "#e11d48", "#ea580c", "#ca8a04"];
+
+export function StorageMap({ page, busy, onZoom }: {
+ page: ScanView | undefined;
+ busy: boolean;
+ onZoom: (id: number) => void;
+}) {
+ const container = useRef<HTMLDivElement>(null);
+ const [size, setSize] = useState({ width: 0, height: 0 });
+ useLayoutEffect(() => {
+ const element = container.current;
+ if (!element) return;
+ const observer = new ResizeObserver(([entry]) => {
+ const { width, height } = entry.contentRect;
+ setSize({ width, height });
+ });
+ observer.observe(element);
+ return () => observer.disconnect();
+ }, []);
+ const tiles = page ? layoutStorageMap(page.chart, page.node.size, size.width, size.height) : [];
+ return <div className="glass-card rounded-xl p-2 w-full h-full">
+ <div ref={container} className="h-full relative">
+ {page && !page.chart.length && <p className="text-xs text-zinc-400 p-2">No scanned child bytes to display.</p>}
+ <svg className="absolute inset-0 w-full h-full" role="group" aria-label="Storage map of scanned bytes">
+ {tiles.map(({ node_id, name, size, x, y, width, height }, index) => {
+ const interactive = node_id !== null && !busy;
+ const label = `${name} · ${formatBytes(size)}`;
+ return <g key={node_id ?? "other"} role={node_id === null ? "img" : "button"}
+ aria-label={label} aria-disabled={node_id !== null && busy ? true : undefined}
+ tabIndex={interactive ? 0 : undefined}
+ className={interactive ? "cursor-pointer focus-visible:brightness-125" : undefined}
+ onClick={interactive ? () => onZoom(node_id) : undefined}
+ onKeyDown={interactive ? event => {
+ if (event.key !== "Enter" && event.key !== " ") return;
+ event.preventDefault();
+ onZoom(node_id);
+ } : undefined}>
+ <title>{label}</title>
+ <rect x={x} y={y} width={width} height={height} fill={node_id === null ? "#52525b" : colors[index % colors.length]} stroke="#ffffff20" />
+ {width > 46 && height > 22 && <svg x={x} y={y} width={width} height={height} overflow="hidden" aria-hidden="true" className="pointer-events-none">
+ <text x={6} y={16} fill="white" fontSize={11} fontWeight={600}>{name}</text>
+ {height > 36 && <text x={6} y={30} fill="white" fontSize={9}>{formatBytes(size)}</text>}
+ </svg>}
+ </g>;
+ })}
+ </svg>
+ </div>
+ </div>;
+}
diff --git a/src/storageMapLayout.ts b/src/storageMapLayout.ts
new file mode 100644
index 0000000..63a9cfd
--- /dev/null
+++ b/src/storageMapLayout.ts
@@ -0,0 +1,37 @@
+import type { ScanView } from "./scanView";
+
+type Tile = ScanView["chart"][number];
+type Bounds = { x: number; y: number; width: number; height: number };
+
+export function layoutStorageMap(chart: readonly Tile[], total: number, width: number, height: number) {
+ const tiles = chart.filter(tile => tile.size > 0);
+ const layout: (Tile & Bounds)[] = [];
+ if (!tiles.length || width <= 0 || height <= 0 || tiles.reduce((sum, tile) => sum + tile.size, 0) !== total) return layout;
+
+ function divide(start: number, end: number, bytes: number, bounds: Bounds) {
+ if (end - start === 1) {
+ layout.push({ ...tiles[start], ...bounds });
+ return;
+ }
+
+ // Split at the nearest byte midpoint, then divide along the longer side.
+ let split = start + 1;
+ let firstBytes = tiles[start].size;
+ while (split < end - 1 && Math.abs(bytes / 2 - firstBytes - tiles[split].size) < Math.abs(bytes / 2 - firstBytes)) {
+ firstBytes += tiles[split++].size;
+ }
+ const fraction = firstBytes / bytes;
+ if (bounds.width >= bounds.height) {
+ const left = bounds.width * fraction;
+ divide(start, split, firstBytes, { ...bounds, width: left });
+ divide(split, end, bytes - firstBytes, { ...bounds, x: bounds.x + left, width: bounds.width - left });
+ } else {
+ const top = bounds.height * fraction;
+ divide(start, split, firstBytes, { ...bounds, height: top });
+ divide(split, end, bytes - firstBytes, { ...bounds, y: bounds.y + top, height: bounds.height - top });
+ }
+ }
+
+ divide(0, tiles.length, total, { x: 0, y: 0, width, height });
+ return layout;
+}
diff --git a/tests/scan_ui_fixture.js b/tests/scan_ui_fixture.js
index 27cf901..8ac54f5 100644
--- a/tests/scan_ui_fixture.js
+++ b/tests/scan_ui_fixture.js
@@ -612,12 +612,22 @@
await pause(30);
check(calls.filter(item => item.command === "get_scan_view").length === before, "Other tile zoomed");
+ const mapFolder = document.querySelector('svg [role="button"][aria-label^="large-folder"]');
+ check(mapFolder, "Storage map folder is not keyboard accessible");
+ mapFolder.focus();
+ check(document.activeElement === mapFolder, "Storage map folder did not receive focus");
+ await pressKey("Enter");
+ await waitFor(() => button("← Back to Root") && rows().length === 129, "Keyboard map zoom failed");
+ button("← Back to Root").click();
+ await waitFor(() => !button("← Back to Root") && rows().some(row => row.textContent.includes("large-folder")), "Map zoom did not return to root");
+
for (const invalidPath of ["object", "outside"]) {
badDetail = invalidPath;
- const toastsBeforeBadDetail = document.querySelectorAll("#toast-container > div").length;
+ const toastsBeforeBadDetail = new Set(document.querySelectorAll("#toast-container > div"));
const deletesBeforeBadDetail = calls.filter(call => call.command === "delete_item").length;
document.querySelector('[aria-label="Delete file-0 "]').click();
- await waitFor(() => !document.querySelector("#btn-rescan") || button("NUKE IT") || document.querySelectorAll("#toast-container > div").length > toastsBeforeBadDetail, "Malformed confirmation was not reported");
+ await waitFor(() => !document.querySelector("#btn-rescan") || button("NUKE IT") || [...document.querySelectorAll('#toast-container [role="alert"]')].some(toast =>
+ !toastsBeforeBadDetail.has(toast) && toast.textContent.includes("Scan node response does not match this scan")), "Malformed confirmation was not reported");
check(document.querySelector("#btn-rescan") && !button("NUKE IT"), "Malformed confirmation crashed results or opened a delete dialog");
check(calls.filter(call => call.command === "delete_item").length === deletesBeforeBadDetail, "Malformed confirmation issued a delete");
}
diff --git a/tests/storage_map_layout.test.mjs b/tests/storage_map_layout.test.mjs
new file mode 100644
index 0000000..e8c5ca0
--- /dev/null
+++ b/tests/storage_map_layout.test.mjs
@@ -0,0 +1,32 @@
+import assert from "node:assert/strict";
+import { readFile } from "node:fs/promises";
+import test from "node:test";
+import ts from "typescript";
+
+const source = await readFile(new URL("../src/storageMapLayout.ts", import.meta.url), "utf8");
+const { outputText } = ts.transpileModule(source, {
+ compilerOptions: { target: ts.ScriptTarget.ES2020, module: ts.ModuleKind.ESNext },
+});
+const { layoutStorageMap } = await import(`data:text/javascript;base64,${Buffer.from(outputText).toString("base64")}`);
+
+test("each tile, including Other, covers its share of the full byte total", () => {
+ const chart = Array.from({ length: 64 }, (_, id) => ({ node_id: id + 1, name: ` file ${id} `, size: 100 - id }));
+ chart.push({ node_id: null, name: "Other", size: 5000 });
+ const total = chart.reduce((sum, tile) => sum + tile.size, 0);
+ for (const [width, height] of [[1600, 100], [200, 700]]) {
+ const layout = layoutStorageMap(chart, total, width, height);
+ assert.equal(layout.length, chart.length);
+ for (const [index, tile] of layout.entries()) {
+ assert.equal(tile.name, chart[index].name);
+ assert.equal(tile.node_id, chart[index].node_id);
+ assert.ok(Math.abs(tile.width * tile.height / (width * height) - tile.size / total) < 1e-12);
+ assert.ok(tile.x >= 0 && tile.y >= 0 && tile.x + tile.width <= width + 1e-9 && tile.y + tile.height <= height + 1e-9);
+ }
+ }
+});
+
+test("empty, zero-byte and incomplete charts do not fill the storage map", () => {
+ assert.deepEqual(layoutStorageMap([], 0, 100, 100), []);
+ assert.deepEqual(layoutStorageMap([{ node_id: 1, name: "empty", size: 0 }], 0, 100, 100), []);
+ assert.deepEqual(layoutStorageMap([{ node_id: 1, name: "partial", size: 1 }], 2, 100, 100), []);
+});