Repository navigation
feat(content): ask where a page is live when it's marked published, and measure it there (CE-013, part 2: web) - #1511
Conversation
…o CMS ansvisor#1331, phase 2 part 1: Webflow connection) A brand connects its Webflow site with a site token, kept by Composio as an API-key connected account under the brand's own Composio user, picks the collection pages go to and which of its fields takes the body, meta title, meta description and JSON-LD. 00283 adds brand_cms_connections (members read; the server writes for admins and managers). Routes under /api/cms/brands/:brandId/webflow connect, list collections and fields with a suggested map, save the map and disconnect. The token is never stored, logged or sent back. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…refusals narrowly (pre-push review) - A new token is a second Composio account until the first is removed, so connect with allowMultiple; once the new one is saved, the brand's other Webflow accounts go (forgetWebflowAccounts), and a disconnect removes them all, keeping the row when Composio can't. - Writes are tied to the account the request read: a map checked with a token replaced meanwhile isn't saved (409 changed), a late refusal marks only its own token, and a disconnect leaves a token connected meanwhile. - Only a 401 or a missing Composio account is auth_failed; a 403 is no_access and changes nothing; a successful read connects a refused connection again. - A collection's fields are given only for one on a site the token reaches. - A missing brand answers not_found; a required field can't be the JSON-LD's. - Unused exports dropped; composio.test.js covers the Webflow helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ction as draft items (Send to CMS ansvisor#1331, phase 2 part 2: Webflow send) POST /api/content-drafts/send takes target 'webflow': each page becomes a draft item in the brand's collection (00283) by its field map, or updates the item its last send made there (a new one when it was deleted in Webflow). Webflow's rich text has no tables, so a table goes as a list; images wait for workspace files (CHAT-06); the meta description falls back to the page's opening words; JSON-LD goes as its JSON to its own field. The same 200 a day, 25 per send and pause apply. 00284 adds the delivery's target and the item's collection, and reserve_content_deliveries takes the target ('webhook' by default, so the earlier API still works). A token Webflow refuses marks the connection auth_failed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… as they are (pre-push review) - A table cell keeps its paragraphs, items and lines a space apart, and its links; a table a figure wraps is kept, a table in a cell read once; words or items outside a block become paragraphs; comments go; a picture counts as one image. - A slug with nothing Latin left falls back to the draft's id, the same on every send, not the delivery's. - 00284: a second Webflow send of a page while one is queued is refused under the cap's lock (in_progress), so two sends can't make two items. - The item's id is kept even when the delivery's row was written meanwhile. - A batch stops once Webflow refuses the token, closing the rest. - The webhook callback answers only for webhook deliveries. - An emptied JSON-LD field clears the item's old one; every "<" in it is escaped; the opening words stay within 160 characters. - A taken slug says what to do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… in Settings › Integrations (Send to CMS ansvisor#1331, phase 2 part 3: Webflow card) A Webflow card under the product catalog: admins and managers paste the brand's site token (sent from the browser to the API's proxy once, never through a server action), pick the site and collection pages go to, and which field takes the page content, meta title, meta description and JSON-LD (the collection's suggested map first), replace the token and disconnect; members see where pages go. A refused token asks for a new one; a connection changed meanwhile is read again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…CMS (Send to CMS ansvisor#1331, phase 2 part 4: send target) Once Settings has the brand's Webflow collection ready, the editor's and the Library's Send dialogs offer where pages go: Webflow (a draft item in the collection, the first choice) or the workflow's webhook, remembered per brand in this browser. A Webflow send says whether the item was made or updated and what Webflow's rich text couldn't keep (tables as lists, images not yet); its refusals are named; the Library marks a page sent there as a draft item in Webflow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ow isn't ready (pre-push review) - A brand's Webflow that can't be read holds the send, with Try again, instead of reading as no Webflow and sending to the webhook. - Webflow connected but not ready (its token refused, no collection) shows in the picker, off, with what to do; the webhook is then picked in view. - The description is neutral until the target is read. - The bulk dialog clears a refusal when the target changes, and says a page (not "this page") is already on its way to Webflow. - A collection without a name reads as "your collection". - Tests: a send held while reading, a failed read and Try again, the remembered choice read back, not-ready Webflow, the last send's line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… there (Send to CMS ansvisor#1331, phase 2 part 6: Webflow published) Nothing calls back when a Webflow item goes live, so the API reads the items its sends made: each page's latest send to Webflow not seen live yet (up to 25 a brand, the last 60 days), and marks a live one published at its address on the site (its custom domain or webflow.io host, the collection's slug and the item's). The Library asks once as it opens for a brand with pages in Webflow (any member, a brand at most every two minutes), and a daily sweep reads every connected brand. Marking a page published is shared with the webhook's callback (content-published.js). A token refused while reading marks the connection. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed it after the send (pre-push review)
- A live page sent again stays sent until Webflow publishes it again: the
item counts only when its lastPublished is at or after the send.
- An item deleted in Webflow closes its send (Removed in Webflow), so the
page's next send makes a new item and the check stops reading it.
- One item's failure doesn't stop the check; three in a row do.
- The Library reads a brand's 10 newest sends; the daily sweep reads up to
100 a brand, its brands shuffled so the deadline leaves out others daily.
- A site's host is the custom domain published to last, else webflow.io.
- An item wrapped as { item } is read; logs carry the error's code.
- The Library's reload isn't lost when its filter changes meanwhile.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… (CE-013, part 1: server)
POST /api/content-drafts/:draftId/publish { url } lets any member of the
brand's workspace mark a page Published at the http(s) address it's live
at: the draft gets published_url / published_at (the server's columns)
and a "publish" version in History, and a linked action gets the live page
to be measured on and, once every page it names is live, its Publish task
done. The answer says whether the address is on the brand's domains. The
CMS paths and this share markDraftPublished and liveAddress.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Publish only when all its work is live (pre-push review) - The live address goes to payload.publishedPages (by draft), read beside payload.pages by basketScope, so the pages an action works through (and Ready's check of them) stay as they were; only an address on the brand's domains is measured, and a page published again moves. - Publish is done once the action's work is live: a published create draft for a Create task, a published optimize draft for each page an Optimize or Refresh task names; archived drafts don't count. - Only open tasks (todo, in progress) are completed, skip_reason cleared; a skipped one stays. - The payload is written only as read, read again when another write landed first. - The page stays published when the action's part fails (logged), and a page its CMS published tells its action too (markDraftPublished). - Tests run on tables whose filters apply. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd measure it there (CE-013, part 2: web) Published, from the Library's status menu, the editor's Published button or Next step's Mark published (beside Export on a ready page), asks for the address the page is live at, starting from where it went live, else the page it optimizes, else the brand's site with its slug; the API marks it published there (part 1). The Live page tab measures that address, so a created page is measured once it's live; an address off the brand's domains is kept, with a warning that its numbers won't show. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rchived pages out (pre-push review) - A page with no slug starts from its title's slug on the brand's site, never the site's home page, which one click would have marked live. - Mark published waits for the page to save (as Send does), so History's published version is the page as written; Next step holds it as it holds Mark ready. - An archived row's Published is off: it's restored first. - A page published from the Library meanwhile reads its live address. - The Live page tab reads anew for another address; a long address wraps in the header tip. - The dialog: no browser validation (the API's words), its hint a live region, focus in the field once it's read; the address may be http(s). - Tests: the editor's publish mocks reset, the Live page tab on a stored live address, the primary-domain read, archived rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-settings # Conflicts: # server/.env.example # supabase/schema.sql
…sed parts by their labels, tell members a refused token stops sends (review)
- A saved part whose field was deleted or changed type in Webflow is left
out when the fields arrive, so what's saved is what the pickers show.
- The API's problems name a part by its label ("Meta title: …"), in a
list read out as an alert; the token hint describes its field.
- With the token refused, a member reads that pages can't go to Webflow
until an admin or manager pastes a new one.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…_webhook for a Webflow not ready, and move between targets with the arrow keys (review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ebflow, in case it wasn't (review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, and don't hold Publish for skipped work (review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… so, and keep Try again off while sending (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n a published page goes back to Draft or In review (review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ction's pages as the web does (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd stop measuring a page taken back on a closed action too (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
#1510's second follow-up is done here, and #1510's new head is merged in (no conflicts). A published page moved back to Draft or In review (
The Library row menu is the only path from Published back to Draft or In review. The editor's Published button opens the Mark published dialog, and agent writes and Ready act only on draft / in-review pages. A pre-push review shaped the Publish rule (any page's publish, not only this draft's), the closed-action measurement and the order above. |
gkhngyk
left a comment
There was a problem hiding this comment.
Needs changes: one fix before merge, since the web goes out on merge and the API is deployed later.
#1505, #1506, #1509 and #1510 are merged. This one waits: either for the fallback below, or until the API with #1510 is deployed, whichever comes first.
What I checked:
- Stack. The PR's own change sits on #1510's current head (be57be3). The three merges of #1510 into it (ba71038, f5eb4cd, e70e763) add nothing beyond their parents. With the stack, it merges cleanly on main.
- The starting address. The dialog starts from where the page is live, else the page it optimizes, else the brand's primary domain plus the page's slug (its last send's, else the title's, cut at a word). It never offers the home page.
- Saving the address.
- It goes to #1510's route through the proxy, with the session. The API checks it and writes it;
published_urlstays server-only (00262's guard). - Nothing fetches the address. The Live page tab reads it only through
content_page_impactandcontent_page_results. - In the editor, pending edits are saved first, so History's publish version is the page as written. The publish changes only the status and the address, so the next autosave doesn't read it as a conflict (same body hash).
- It goes to #1510's route through the proxy, with the session. The API checks it and writes it;
- Who. Any member, as with the Library's status menu and #1510's route. Archived rows have Published turned off, which matches the route's 404.
- Live page tab. It measures
publishedUrl, elsesourceUrl, and reads again when the address changes (keyed on it). - Taken back (#1510's second follow-up): done.
- Moving a page from Published to Draft or In review reopens a Publish task whose latest trail entry is a page's completion (it names a
draftId). One a person completed last stays done. - It also drops the draft's
publishedPagesentry, with the same optimistic write as the API'ssetLivePage. A closed action keeps its tasks but stops measuring the page. - Failures are logged and never fail the status change. Ready's reopen of the page's own task is unchanged;
latestChangesis now shared. - Members could already update
actionsandaction_tasksand addaction_events, so no role gains anything.
- Moving a page from Published to Draft or In review reopens a Publish task whose latest trail entry is a page's completion (it names a
Before merge:
- Library, Published: until the API with #1510 is deployed, choosing Published in the Library does nothing.
- What changes. Today the status menu sets Published directly. With this PR, Published only opens the dialog (
library/page.tsx:251-254), and the dialog's only way to save is the API's publish route. - What the person sees. An API without #1510 has no such route, so Express answers with its own HTML 404 ("Cannot POST …"), which has no JSON body.
publish-client.ts:60-73reads any 404 asnot_found. The dialog then says "This page isn't in the Library anymore." (en.json:3213), stays open, and the page keeps its status. Try again gets the same answer. - The editor. The editor's Published button and Next step's Mark published fail the same way. Neither works today, so nothing is lost there, but the words are wrong.
- Fix:
- Read a 404 as
not_foundonly when the body carries the route'scode: 'not_found'. Any other 404 means the route isn't there. - In that case, for a page that isn't published yet, fall back to today's
setContentDraftStatus(id, 'published'). Say the address wasn't kept, e.g. "Published. The address couldn't be saved yet, so the Live page tab can't measure it." - For a change of address on a page that's already published, show
failed. - Add a test for a 404 without a code.
- Read a 404 as
- If this PR is merged only once the API with #1510 is live, the fallback can go. The narrower 404 reading is still worth having.
- What changes. Today the status menu sets Published directly. With this PR, Published only opens the dialog (
Low, follow-up:
2. Wording:
- Live page tab (
_impact-tab.tsx:86-88,en.json:4095). A created page that was marked Published in the Library before this PR has no address. Its Live page tab now says "not live yet … Mark it published with its live address". On a published page, say instead to give its address with the header's Published button. - Mark published (
_draft-editor.tsx:2735and:2892). It reusessend.unsaved("…so it wasn't sent.") when the page can't be saved first, andnextStep.marking("Marking it ready…") while it saves. Give it its own two strings.
- Archived pages in the editor (
_draft-editor.tsx:3251and Next step's Mark published). An archived page still opens in the editor, and both of these open the dialog. The route answers 404 and the dialog says the page isn't in the Library, though it's in Archived. Hold both whiledraft.archivedAtis set, with "Restore it in the Library first", as the Library does. - Docs (
docs/guides/content-editor.mdx:172). The page still says the Library's Status sets Published directly. Say that Published asks for the live address, and that the editor's Published button changes it. This can go in #1507 or a CE-013 docs PR.
…e route, hold archived pages, and own words for Mark published (review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ish-web # Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsx
…ed page, and word the unsaved note for an address change (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks. All four are done in d75cb29, with a pre-push review's follow-up in the commit after it. Main (with #1505–#1510's squashes) is merged in (f5d0010). The one conflict was Before merge:
Low:
Web: format, lint (0 errors), typecheck, |
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good.
What I checked:
- Earlier items.
- Done (d75cb29).
- Reading a 404. A 404 now reads as
not_foundonly when its body has the route'scode: 'not_found'. Any other 404 isno_route(publish-client.ts:68).- The route's own 404s all carry
not_found: a missing or archived draft, and a brand that's gone. - The API has no catch-all 404 handler, so an API without the route answers with Express's HTML "Cannot POST" page. That reads as
no_route.
- The route's own 404s all carry
- A page that isn't published yet falls back to
setContentDraftStatus(id, 'published'), which is what the Library's status menu does on main (publish-dialog.tsx:73-90). A warning says the address wasn't kept. If that write fails too, the dialog showsfailedand stays open. - A published page's address change shows
failedand stays open. - Tests: an HTML 404 gives
no_route. The dialog tests cover the fallback, no fallback on a published page, andnot_foundstill reading as a page gone.
- Reading a 404. A 404 now reads as
- Done.
- A published page without an address now has its own Live page tab line (
_impact-tab.tsx:93), pointing to the header's Published button. - Mark published has its own strings: one for unsaved changes, one while it saves.
- A published page without an address now has its own Live page tab line (
- Done.
- On an archived page, the header's Published button is off with "Restore it in the Library first", and
openPublishreturns early (_draft-editor.tsx:2724). - Next step's Mark published is held with the same words.
- Next step now says why its second button is held, tied to it with
aria-describedby(_next-step.tsx:276,:297).
- On an archived page, the header's Published button is off with "Restore it in the Library first", and
- Done.
content-editor.mdxhas a Mark published bullet. The Library's Status and the Published tab say what changed.
- Done (d75cb29).
- Merge
f5d00104changes nothing beyond merging its parents. Its one conflict,library/page.test.tsx, keeps this PR's mocks; main had no lines there. The PR merges cleanly on main, and CI passes. - Before the API is deployed:
- Library, Published.
- The dialog opens with the suggested address.
- Mark published sets the page to Published as it does today, with a warning that the address couldn't be saved yet. The row moves to Published.
- As with today's status change, a linked action's Publish task isn't completed.
- Editor, Next step's Mark published (Quality on, a ready page): the same fallback.
- Editor, the header's Published button on a published page.
- Before, it was off, with a tip.
- Now it opens the dialog, and Mark published says "Couldn't mark the page published. Try again." until the API is deployed.
- The Live page tab's new line points to this button too.
- Taking a page back from Published runs in the web app (
unpublishDraftWork), so it works now. - Nothing that works today stops working.
- Library, Published.
- After the deploy, the route saves the address and the fallback no longer runs.
Summary
CE-013, part 2: web. Marking a page Published asks where it's live, and tracking starts there.
Stacked on #1510 (part 1, the server route), which is on #1509 and its chain.
Where Published asks for the live address (
components/content/publish-dialog.tsx):The address it starts from (
lib/content/publish-client.ts,readPublishAddress):https://{the brand's primary domain}/{slug}, using its last send's slug or its title's (slugOf, cut at a word). It never offers the site's home page, which one click would have marked as the page's address.The person edits the address and saves.
publishPageposts it to part 1's route through the API's proxy.After saving
Live page tab
publishedUrl(where the page is live, onContentDraftnow), elsesourceUrl.Text:
contentEditor.publish.*, header and Next step strings, all inen.json.Related issue
Content Editor spec (Drive), CE-013. Stacked on #1510.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
https://{brand domain}/{title slug}.I checked steps 1–3 end to end locally on the dev database with the demo brand, at 1024px:
The dev row was put back afterwards.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): 0 errors; the 6 warnings are in files this PR doesn't touchyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)A pre-push review found these. Their fixes are the last commit:
Web:
yarn test(3,899 passed) andyarn buildpass.🤖 Generated with Claude Code