Skip to content

Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.

docs: correct upload, hooks and test layout descriptions

spacesdrive2f8b2c2acb4a
diff --git a/docs/architecture/frontend/API_LAYER.md b/docs/architecture/frontend/API_LAYER.md
index c31ff8c..d33ac50 100644
--- a/docs/architecture/frontend/API_LAYER.md
+++ b/docs/architecture/frontend/API_LAYER.md
@@ -128,7 +128,7 @@ These are the only calls in `api.js` that do not go to the Worker.
uploadImage(file, cloudConfig)
```
-Used for tracked item screenshots. It posts the image with `fetch` to `https://api.cloudinary.com/v1_1/<cloudName>/image/upload` and resolves with `secure_url`. It throws an `Error` with Cloudinary's own message, or `'Cloudinary did not return an image URL'`, and network or JSON failures reject with the browser's own error. This is the exact behaviour the tracked content page had before the refactor.
+Used for tracked item screenshots. It posts the image with `fetch` to `https://api.cloudinary.com/v1_1/<cloudName>/image/upload` and resolves with `secure_url`. It throws an `Error` with Cloudinary's own message, or `'Cloudinary did not return an image URL'`, and network or JSON failures reject with the browser's own error. The tracked content editor shows that `err.message` after `Image upload failed.` in an error toast.
```js
uploadToCloudinary(file, cloudConfig, { onProgress, resourceType })
@@ -151,9 +151,8 @@ Failures reject with an `Error` that carries a `reason` so each page keeps its o
| `rejected` | Cloudinary answered with a non-2xx status | `Upload failed` | `cloudinaryMessage` (Cloudinary's `error.message`, if any) or `parseMessage` (the body was not JSON) |
The bulk upload shows the default messages. The single post flow maps the error to its own
-wording (`singleUploadMessage` in `features/publishing/publishHelpers.js`), and so does the Tracked
-Content image upload (`imageUploadMessage` in `features/analytics/tracked/trackedList.js`), which
-passes `resourceType: 'image'` and no progress callback.
+wording (`singleUploadMessage` in `features/publishing/publishHelpers.js`). Tracked Content does
+not use this function: its screenshots go through `uploadImage()` above.
## Authentication
diff --git a/docs/architecture/frontend/REACT_ARCHITECTURE.md b/docs/architecture/frontend/REACT_ARCHITECTURE.md
index e9d72d7..ad176e3 100644
--- a/docs/architecture/frontend/REACT_ARCHITECTURE.md
+++ b/docs/architecture/frontend/REACT_ARCHITECTURE.md
@@ -82,6 +82,7 @@ frontend/src/
use-command-palette-shortcut.js Ctrl+K / Cmd+K toggle
use-smooth-theme.js useSmoothTheme(), theme cross-fade
use-cloudinary-config.js useCloudinaryConfig(reloadKey), shared by Publish and Tracked content
+ use-account-analytics.js useAccountAnalytics(account, fetchAnalytics, label), shared by Instagram and Reddit analytics
layout/
index.jsx AppShell: SidebarProvider + AppSidebar + TopBar + Outlet + CommandPalette
navigation.js NAV_GROUPS and route titles (single source for sidebar, top bar, palette)
diff --git a/docs/workflows/TESTING.md b/docs/workflows/TESTING.md
index 374f44e..f739798 100644
--- a/docs/workflows/TESTING.md
+++ b/docs/workflows/TESTING.md
@@ -9,7 +9,7 @@ cd backend && npm test
cd frontend && npm test
```
-Frontend tests cover `src/lib/`: hold-to-confirm timing, command palette ranking, library filtering and paging, platform helpers, and a check that every Lucide icon imported in `src` exists. Keep testable logic in `src/lib/` free of JSX and `@/` imports so Node can load it directly.
+Frontend tests (`npm test` runs every `src/**/*.test.js`) cover shared helpers in `src/lib/` and `src/utils/` (hold-to-confirm timing, command palette ranking, library filtering and paging, platform helpers, and a check that every Lucide icon imported in `src` exists) and page helpers that sit beside their feature in `src/features/**` and `src/docs/**`, such as `features/analytics/overview/overviewStats.js`. A testable helper is a plain `.js` file with no JSX and no `@/` imports, and its imports of project files are relative paths that end in `.js`, so Node can load it directly.
Test files sit next to the module they cover as `*.test.js` (for example `services/instagram.test.js`). Wrangler only bundles files reachable from `server.js`, so test files never ship in the Worker.