Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.
feat(publishing): rename the Publish page to Instagram publishing
spacesdrive2aa2206b6948
diff --git a/README.md b/README.mdindex dcf22e5..4bb0e43 100644--- a/README.md+++ b/README.md@@ -56,7 +56,7 @@ Twiligent puts them in one dashboard that you host yourself. Your data stays in</tr><tr><td width="50%" valign="top">- <img src="docs/media/publish.webp" alt="The Publish page with post settings" width="100%" />+ <img src="docs/media/publish.webp" alt="The Instagram publishing page with post settings" width="100%" /><h4>Publish now, or at the hour you pick</h4><p>Post photos, Reels and Stories to Instagram, or schedule them. The server publishes within 15 minutes of that time, even with your browser closed.</p></td>diff --git a/backend/mcp/tools/scheduledPostTools.ts b/backend/mcp/tools/scheduledPostTools.tsindex 4de6781..2fc9bde 100644--- a/backend/mcp/tools/scheduledPostTools.ts+++ b/backend/mcp/tools/scheduledPostTools.ts@@ -49,7 +49,7 @@ function describeFields(fields: Partial<ScheduledPostRequest>): string {// the validators accept more fields than these tools publish; anything a client was not told about is refusedfunction refuseUnlisted(args: Record<string, unknown>, allowed: string[]): void {const unlisted = Object.keys(args).filter(name => name !== 'confirmationToken' && !allowed.includes(name));- if (unlisted.length > 0) throw new ValidationError(`These fields cannot be set from Claude: ${unlisted.join(', ')}. Use the Publish page for them.`);+ if (unlisted.length > 0) throw new ValidationError(`These fields cannot be set from Claude: ${unlisted.join(', ')}. Use the Instagram publishing page for them.`);}export const listScheduledPosts = defineTool<{ status: PostStatus | undefined; page: Page }>({@@ -103,7 +103,7 @@ export const scheduleInstagramPost = defineTool<ScheduledPostRequest>({parse(args) {refuseUnlisted(args, ['accountId', 'mediaUrl', 'mediaType', ...Object.keys(postFields)]);const request = parseScheduledPost(args);- if (request.mediaType === 'CAROUSEL') throw new ValidationError('Carousels can be scheduled from the Publish page; this tool takes one image or video.');+ if (request.mediaType === 'CAROUSEL') throw new ValidationError('Carousels can be scheduled from the Instagram publishing page; this tool takes one image or video.');return request;},async run(request, { services, principal }) {diff --git a/backend/services/mediaService.ts b/backend/services/mediaService.tsindex c003655..57b4cfd 100644--- a/backend/services/mediaService.ts+++ b/backend/services/mediaService.ts@@ -95,7 +95,7 @@ export function createMediaService({ media, audit, config, context }: MediaDeps)if (!config.cloudinary) throw new NotConfiguredError('Cloudinary is not set up on this server.');// only a file on this instance's own cloud, at the exact address Cloudinary gives the id it namesif (!isDeliveryAddressFor(upload.url, config.cloudinary.cloudName, upload.resourceType, upload.publicId)) {- throw new ValidationError('The file is not on this server\'s Cloudinary account. Upload it from the Publish page.');+ throw new ValidationError('The file is not on this server\'s Cloudinary account. Upload it from the Instagram publishing page.');}// the size decides every chunk boundary, so it is measured, not taken from the browserconst bytes = await fileSize(upload.url, signal);diff --git a/docs/architecture/data-flows/SCHEDULING.md b/docs/architecture/data-flows/SCHEDULING.mdindex daf1fad..4ebfe8d 100644--- a/docs/architecture/data-flows/SCHEDULING.md+++ b/docs/architecture/data-flows/SCHEDULING.md@@ -163,6 +163,6 @@ Step-by-step instructions for a person setting this up: `docs/workflows/SCHEDULI- Publish explains, next to the schedule fields, that the server publishes within 15 minutes after the chosen time.- A `pending` post that is being retried shows `Trying again on the next run` under its status, and the reason of the last attempt in its error tooltip (`isRetrying()` in `frontend/src/features/publishing/scheduleHelpers.ts`).-- The overdue alert in Publish counts `pending` posts more than 30 minutes late (a retried post counts from its last claim) and `publishing` posts whose claim is older than the lease plus 30 minutes, 50 minutes in all (`overduePostsOf()`). It reads `... more than 30 minutes late and not yet published, so the scheduler on this server is not running.` and names the administrator contact (`VITE_ADMIN_EMAIL`).+- The overdue alert on the Instagram publishing page counts `pending` posts more than 30 minutes late (a retried post counts from its last claim) and `publishing` posts whose claim is older than the lease plus 30 minutes, 50 minutes in all (`overduePostsOf()`). It reads `... more than 30 minutes late and not yet published, so the scheduler on this server is not running.` and names the administrator contact (`VITE_ADMIN_EMAIL`).- Settings, Scheduled publishing says the GitHub fallback often starts hours late and is a backup, not a 15 minute guarantee.- Note: These GitHub secrets are only required for System B - the main deploy workflows (`deploy-backend.yml`, `deploy-frontend.yml`) do not need themdiff --git a/docs/architecture/frontend/CONTEXTS.md b/docs/architecture/frontend/CONTEXTS.mdindex 9d1b657..c678769 100644--- a/docs/architecture/frontend/CONTEXTS.md+++ b/docs/architecture/frontend/CONTEXTS.md@@ -130,7 +130,7 @@ Hooks used by more than one feature. Hooks used by a single feature live in that| `useCloudinaryConfig(reloadKey)` | `use-cloudinary-config.ts` | Loads `api.getCloudinaryConfig()`; returns the config or `null` || `useAccountAnalytics(account, fetchAnalytics, label)` | `use-account-analytics.ts` | Loads one account's analytics and refreshes it; used by Instagram analytics |-`useCloudinaryConfig` sets the config only when the response has `success: true`. A failed request keeps the previous value (initially `null`), and pages show a missing config as an alert or a disabled upload field. The request runs again whenever `reloadKey` changes: the Publish page passes `accounts`.+`useCloudinaryConfig` sets the config only when the response has `success: true`. A failed request keeps the previous value (initially `null`), and pages show a missing config as an alert or a disabled upload field. The request runs again whenever `reloadKey` changes: the Instagram publishing page passes `accounts`.`useAccountAnalytics` returns `{ loading, profile, analytics, refreshing, handleRefresh }`. Pass a stable `api` method (`api.getIGAnalytics`), never an inline arrow: the load is keyed on the account id and that method, so a background account refresh does not refetch analytics. `label` names the platform in the toasts (`Couldn't load Instagram analytics.`, `Instagram account refreshed`). `handleRefresh` calls `api.refreshAccount()` and then loads the analytics again.diff --git a/docs/architecture/frontend/DESIGN_SYSTEM.md b/docs/architecture/frontend/DESIGN_SYSTEM.mdindex 0359329..6b66c63 100644--- a/docs/architecture/frontend/DESIGN_SYSTEM.md+++ b/docs/architecture/frontend/DESIGN_SYSTEM.md@@ -76,7 +76,7 @@ Shared components live in `frontend/src/components/`. Reach for these before wri| Library | Videos, Shorts, Instagram content, Tracked content | Search, filter chips, quiet table or card grid, pager || Detail | YouTube channel, Instagram account, Category | Back link, avatar header, metric grids, underline tabs or sections || Create | Accounts (add flow) | Choice cards, then a form step, then review before commit |-| Working surface | Publish | Main editor on the left, sticky `DetailPanel` with settings and the primary action on the right |+| Working surface | Instagram publishing | Main editor on the left, sticky `DetailPanel` with settings and the primary action on the right || Settings | Settings | Sections with a label column and content column || Editor page | Rule editor (`/automations/rules/new`, `/automations/rules/:id`) | A long form on its own page: back link, sections of `FieldRow`s, a live preview, a sticky bar with Cancel and the primary action, a draft and a leave warning || Sign-in | Login | One centred card in the dialog styling (`rounded-dialog`, `border-line`, `bg-popover`, `shadow-lg`) over a blurred picture of the dashboard (`LoginBackdrop`, the shared components with sample figures under a `bg-surface/70` blur); logo, Back link when not on the first view, one headline, then the view's form |diff --git a/docs/architecture/frontend/ROUTING.md b/docs/architecture/frontend/ROUTING.mdindex fafe959..9109ac1 100644--- a/docs/architecture/frontend/ROUTING.md+++ b/docs/architecture/frontend/ROUTING.md@@ -23,7 +23,7 @@ The app uses React Router 7 in `frontend/src/App.tsx`: a data router from `creat| `/shorts` | `ShortsExplorer.tsx` | Videos of 60 seconds or less || `/instagram` | `ReelsExplorer.tsx` | Instagram reels, posts and videos (the Instagram content page) || `/reels` | redirect | Redirects to `/instagram`, keeping the query string and hash |-| `/publish` | `UploadContent.tsx` | Publish and schedule to Instagram, plus the scheduled post queue |+| `/publish` | `UploadContent.tsx` | Instagram publishing (sidebar and page title): publish and schedule to Instagram, plus the scheduled post queue || `/upload` | redirect | Redirects to `/publish`, keeping the query string and hash || `/automations` | `features/automations/Automations.tsx` | Comment-to-DM rules, account controls and reply activity; in the sidebar under Publishing || `/automations/rules/new` | `features/automations/RuleEditorPage.tsx` | Create a rule on its own page, with a warning before leaving unsaved changes |diff --git a/docs/design-reference.md b/docs/design-reference.mdindex ffe4719..2688c7b 100644--- a/docs/design-reference.md+++ b/docs/design-reference.md@@ -96,7 +96,7 @@ Every token in `frontend/src/index.css` traces to a row in this file.| Element | Measured value | Twiligent ||---|---|---|-| Settings panel | 460px wide, right side, separated by a hairline | `DetailPanel` in the Publish page, `lg:w-[28rem]` |+| Settings panel | 460px wide, right side, separated by a hairline | `DetailPanel` in the Instagram publishing page, `lg:w-[28rem]` || Panel tabs | underline tabs, 42px | `TabsList` default || Field label | 14px weight 500 | `FieldRow` label || Field control | 40px, 10px radius, 1px border at 10% | `--control-h-lg` |diff --git a/docs/workflows/RECOVERY.md b/docs/workflows/RECOVERY.mdindex 3cce864..6bf80ac 100644--- a/docs/workflows/RECOVERY.md+++ b/docs/workflows/RECOVERY.md@@ -20,7 +20,7 @@ A person who reports an error can quote the request id at the end of the error m|---|---|---|| Comment replies go out wrong or too fast | `npx wrangler secret put AUTOMATION_PAUSED` with the value `true` | Every reply is held; comments are still recorded and wait. Remove the secret, or set `false`, to resume || One Instagram account replies badly | Pause the account on the Automations page | Only that account stops |-| A scheduled post keeps failing | Read its reason in the scheduled posts list on the Publish page | A temporary failure is tried up to three times and a permanent one once; the post is then marked Failed with the reason and is not tried again |+| A scheduled post keeps failing | Read its reason in the scheduled posts list on the Instagram publishing page | A temporary failure is tried up to three times and a permanent one once; the post is then marked Failed with the reason and is not tried again || A secret leaked | Set a new value with `npx wrangler secret put <NAME>` and revoke the old one where it was issued (Meta, Google, Resend, Supabase) | The Worker uses the new value on its next request |## 3. Undo a changediff --git a/docs/workflows/TESTING.md b/docs/workflows/TESTING.mdindex eb86d9e..32bdb76 100644--- a/docs/workflows/TESTING.md+++ b/docs/workflows/TESTING.md@@ -265,7 +265,7 @@ Open the app in a browser. For each changed area, test:**Forms and deletes (if a form or a delete changed):**- [ ] Submit a form with a field missing or wrong: the message shows under the field, focus moves to it, and what was typed stays-- [ ] Type in the rule editor or the Publish form, then click a sidebar link: a Discard changes question appears; reload the page and the draft is back+- [ ] Type in the rule editor or the Instagram publishing form, then click a sidebar link: a Discard changes question appears; reload the page and the draft is back- [ ] Delete a rule or a scheduled post: it disappears at once with an Undo toast; Undo brings it back, and without Undo it is gone after a reload 8 seconds later- [ ] Remove an account: the confirm works by holding the button and by pressing it twicediff --git a/frontend/src/features/analytics/overview/QuickActions.tsx b/frontend/src/features/analytics/overview/QuickActions.tsxindex 65366fd..9362daa 100644--- a/frontend/src/features/analytics/overview/QuickActions.tsx+++ b/frontend/src/features/analytics/overview/QuickActions.tsx@@ -3,7 +3,7 @@ import { Bookmark, Plus, Send } from 'lucide-react';// only actions start here; the library pages are already one click away in the sidebarconst QUICK_ACTIONS = [- { to: '/publish', label: 'Publish', icon: Send },+ { to: '/publish', label: 'Instagram publishing', icon: Send },{ to: '/accounts?add=1', label: 'Add account', icon: Plus },{ to: '/tracked-content', label: 'Track content', icon: Bookmark },];diff --git a/frontend/src/features/publishing/NoInstagramAccount.tsx b/frontend/src/features/publishing/NoInstagramAccount.tsxindex a9fdc10..af36901 100644--- a/frontend/src/features/publishing/NoInstagramAccount.tsx+++ b/frontend/src/features/publishing/NoInstagramAccount.tsx@@ -9,7 +9,7 @@ import { InstagramIcon } from '@/components/brand/platform-icons';export default function NoInstagramAccount() {return (<div className="flex flex-col gap-6">- <PageHeader title="Publish" description="Post and schedule photos, Reels and Stories to Instagram." />+ <PageHeader title="Instagram publishing" description="Post and schedule photos, Reels and Stories to Instagram." /><SurfaceBox><EmptyStateicon={<InstagramIcon />}diff --git a/frontend/src/features/publishing/UploadContent.tsx b/frontend/src/features/publishing/UploadContent.tsxindex 72e22e5..a332bcf 100644--- a/frontend/src/features/publishing/UploadContent.tsx+++ b/frontend/src/features/publishing/UploadContent.tsx@@ -78,7 +78,7 @@ export default function UploadContent() {return (<div className="flex flex-col gap-6">- <PageHeader title="Publish" description="Post and schedule photos, Reels and Stories to Instagram." />+ <PageHeader title="Instagram publishing" description="Post and schedule photos, Reels and Stories to Instagram." /><LiveStatus message={stageAnnouncement(publish.publishStatus, publish.uploading)} />{!cloudConfig && (diff --git a/frontend/src/layout/navigation.ts b/frontend/src/layout/navigation.tsindex 48c0280..1452f92 100644--- a/frontend/src/layout/navigation.ts+++ b/frontend/src/layout/navigation.ts@@ -33,7 +33,7 @@ export const NAV_GROUPS: NavGroup[] = [{label: 'Publishing',items: [- { path: '/publish', label: 'Publish', icon: Send },+ { path: '/publish', label: 'Instagram publishing', icon: Send },{ path: '/youtube-uploads', label: 'YouTube uploads', icon: CloudUpload },{ path: '/automations', label: 'Automations', icon: MessageSquareReply },],diff --git a/site/content/docs/use/getting-started.mdx b/site/content/docs/use/getting-started.mdxindex 04d39f2..446a17d 100644--- a/site/content/docs/use/getting-started.mdx+++ b/site/content/docs/use/getting-started.mdx@@ -45,6 +45,6 @@ Twiligent has a light and a dark theme. Switch with the sun or moon button at th| **Videos, Shorts** | Browse and sort every video from your YouTube channels. || **Instagram content** | Browse reels, posts and videos with views, likes and comments. || **Tracked content** | Follow specific YouTube videos and Shorts by link. |-| **Publish** | Post or schedule to Instagram. |+| **Instagram publishing** | Post or schedule to Instagram. || **Accounts** | Add, refresh and remove connected accounts. || **Settings** | Theme, server status and setup guides. |diff --git a/site/content/docs/use/publishing.mdx b/site/content/docs/use/publishing.mdxindex 3f57182..df1d63e 100644--- a/site/content/docs/use/publishing.mdx+++ b/site/content/docs/use/publishing.mdx@@ -5,7 +5,7 @@ export const meta = { title: 'Publish and schedule', description: 'Post photos,<Steps level={3}><Step title="Choose the type and file">-Open **Publish**, pick **Photo**, **Reel** or **Story**, then choose the file. Photos must be JPEG; Reels must be MP4 or MOV in 9:16; Stories accept either.+Open **Instagram publishing**, pick **Photo**, **Reel** or **Story**, then choose the file. Photos must be JPEG; Reels must be MP4 or MOV in 9:16; Stories accept either.</Step><Step title="Write the caption and settings">