Repository navigation
feat: buffer integration - #5
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53829ef452
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } catch (cause) { | ||
| setResult(channelId, { | ||
| status: "error", | ||
| message: | ||
| cause instanceof Error | ||
| ? cause.message | ||
| : "Nie udało się opublikować.", | ||
| }); |
There was a problem hiding this comment.
Return to login when the Buffer session expires
If the Cloudflare Access session expires after the initial app-load check, an upload or post request reaches this catch, but only the channel result is updated; the global session remains connected, so the composer continues showing retry controls and each retry fails without offering a login flow. Recheck or invalidate the Buffer session when a publishing request reports an authentication failure so the login UI becomes available again.
Useful? React with 👍 / 👎.
| <PublishSuccess | ||
| channels={selected} | ||
| mode={draft.mode} | ||
| dueAt={draft.dueAt} |
There was a problem hiding this comment.
Preserve per-channel timing in the success summary
When one channel succeeds and another fails, the timing controls become editable while retries target only the failed channel. If the operator changes from scheduled publishing to “Teraz” before retrying, the first channel remains scheduled, but this final screen uses the current global mode and lists both channels as published now. Either freeze timing after the first success or summarize each channel's actual submitted mode and time.
Useful? React with 👍 / 👎.
| } else if (text.length > info.maxLength) { | ||
| issues.push({ | ||
| code: "tooLong", | ||
| level: "error", | ||
| message: `Treść jest za długa: ${text.length} z ${info.maxLength} znaków.`, |
There was a problem hiding this comment.
Count X text with platform weighting before blocking
For X channels, raw JavaScript string length does not match the platform's 280-character calculation: URLs are counted at their fixed shortened length, while some scripts and composed emoji are weighted differently. A common caption with roughly 250 Latin characters plus a long tracking URL can therefore be rejected here even though it fits on X, while other inputs can pass locally and fail at Buffer. Use a service-specific weighted counter for X instead of text.length.
Useful? React with 👍 / 👎.
Changes
What has been done in this PR?
console-publisher-worker(https://console.gi.org.pl/api/buffer/*), through a newsrc/services/buffer/client (Axios + Zod schemas mirroring the worker's contract).ExportLab/BufferPublisher/PostComposer/):requestId), so no duplicate posts are created./api/buffer/login→ new/buffer-authcallback page). Session state lives in a Zustand store (useBufferSession), because the sidebar and the composer both need it and login is a multi-step popup flow. The session is checked once on app load inConsoleShell. An unauthenticated request is redirected by Access to its login page, which the browser reports as a network error; this is treated as "logged out", not as an error./cdn-cgi/access/logout). On mobile it sits next to the logo.ConsoleModulenow supports optionalsubModules: the sidebar expands them under the active module and the breadcrumb shows them. Marketing doesn't use this after merging publishing into one view; the support is covered by tests using a test module.canShareFiles) is removed. Cards are now just the image, with the format label and a download button in the corners.EditorPanelgets an optionalasideslot; the dashboard card description is updated;vite.config.tsallows.gi.org.plhosts for the dev server.@fortawesome/free-brands-svg-icons(channel icons) – needs Technical Leader approval per our standards.type: "post"for Instagram and its publish schema is strict, so Stories need a worker change first.How to test
Describe how to test the changes manually
/marketingwhile logged out: generating and downloading graphics works, and both the Publikacja section and the sidebar show "Zaloguj się".localhostto the worker are blocked by CORS, so on localhost you'll always see the logged-out state. To test the logged-in flow, run on a*.gi.org.plhost. The e2e tests stub the worker (e2e/bufferWorker.ts).Checklist
Check if the code follows the standards
console.log/ leftover comments – the only thing no module uses yet is thesubModulesnavigation support (tested)