Skip to content

Fix/model pages port#32009

Merged
MohamedH1998 merged 5 commits into
productionfrom
fix/model-pages-port
Jul 13, 2026
Merged

Fix/model pages port#32009
MohamedH1998 merged 5 commits into
productionfrom
fix/model-pages-port

Conversation

@MohamedH1998

Copy link
Copy Markdown
Contributor

Summary

Brings the Nimbus AI model catalog (/ai/models, /workers-ai/models) and the shared page-actions row to parity with the production Starlight site, and stages the Nimbus markdown surface for Cloudflare's edge Markdown for Agents (removing the interim build-time .md routes, mirroring prod's PR #28921). Also aligns the docs footer with the content column.
Net: 660 insertions / 737 deletions across 13 files — mostly replacing bespoke Nimbus scaffolding with prod-shaped equivalents.
Changes

  1. Model catalog filters → base-ui island
  • Add components/models/ModelFilters.tsx (+450) — a React island using base-ui Combobox (multi-select facets) + Select (sort), modeled on prod's src/components/ModelCatalog.tsx interaction model but restyled to Nimbus design tokens so light/dark track the rest of the site.
  • Remove components/models/models.client.ts (−229) — the old vanilla
    Details controller it replaces.
  • ModelCatalog.astro (−131 net): cards stay server-rendered (SEO + Directory corner-mark grid); the island is now just the controller (search/facet/sort → URL → grid reflow via shared grid.ts). (@base-ui/react was already a dependency.)
  1. Pinned-model indicator (ModelCard.astro)
  • Small top-right soft-brand push-pin chip (bg-primary/10 + ring-primary/20, ph:push-pin-fill), inside the card so it survives island reflow; sr-only "Pinned" + title; header gets pr-9 when pinned.
  1. Page-actions parity (page-actions/*)
  • PageActions.astro is now prop-less/ungated like prod: Copy / View as Markdown always render and link to a relative index.md (resolved against the page URL); keeps lastUpdated + Agent setup. Dropped the markdownUrl prop from both call sites (DocsLayout, ModelDetailPage).
  • page-actions.client.ts: copy fetches relative index.md (Safari-safe ClipboardItem), zaraz track on copy/view/agent, tippy tooltip on Agent setup.
  1. Markdown-for-Agents cutover prep (mirrors prod PR Use Markdown for Agents for all docs markdown generation #28921 / CED-388)
  • Delete the interim build-time markdown routes: pages/[...slug]/index.md.ts, pages/ai/models/[...name].md.ts, pages/workers-ai/models/[...name].md.ts, and the now-orphaned util/model-markdown.ts.
  • Markdown is now produced by the edge (HTML→Markdown at request time) once Nimbus is served on the developers.cloudflare.com zone — no per-page .md.ts, always in sync with live HTML. Kept: agent-setup/prompt.md.ts, llms.txt.ts, [...product]/llms.txt.ts, workers/prompt.txt.ts.
  1. Docs footer alignment (Footer.astro, DocsLayout.astro)
  • Footer gains envelope="landing"|"docs" + wide so it aligns to the docs content column (reserving the TOC gutter) instead of the landing envelope.
  • Sidebar/TOC asides switch h-[calc(...)] → max-h-[calc(...)] so short content no longer forces full-height sticky rails.
    Verification
  • HTML pages 200 (/ai/models/, /workers-ai/models/, a detail page, docs pages); filter island + pin render in light/dark; page-actions row + tooltip work.
  • index.md / Copy / View 404 in local astro dev and on the workers.dev preview by design — they resolve once Nimbus is behind the zone's Markdown-for-Agents (see below).
  • No dangling imports; no dev-log errors.
    Deployment dependency (reviewer note)
    Copy / View / index.md are edge-served. They work automatically when Nimbus becomes the origin behind developers.cloudflare.com/* (the zone already has Markdown for Agents + the /index.md URL rules zone-wide). They will not work on the current *.workers.dev preview, which isn't a zone. This is intentional, not a regression.

Screenshots (optional)

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

@MohamedH1998 MohamedH1998 requested review from a team and kodster28 as code owners July 10, 2026 15:08
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 3 warnings, 💡 7 suggestions found in commit 2bf491a.

Fix in your agent
Fix the following review findings in PR #32009 (https://github.com/cloudflare/cloudflare-docs/pull/32009).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, fix all legitimate findings. For any you decide to skip,
post a comment on this PR with the finding ID and your reasoning.

---

## Code Review

### Warnings (3)

#### CR-b3d1cff18de6 · Badly indented admonition close marker
- **File:** `src/content/docs/durable-objects/reference/durable-objects-migrations.mdx` line 409
- **Issue:** The closing `:::` marker is indented with two spaces while the matching opener `:::caution[Important]` is flush left. MDX/remark admonition parsers treat an indented close fence as content rather than the actual end of the admonition, so the caution block will continue and can consume the following `:::note` block and paragraphs.
- **Fix:** Remove the leading spaces on the `:::` line so it aligns with the `:::caution[Important]` opener and correctly closes the admonition.

#### CR-6e2ae6cd81c0 · Sync effect runs before hydration is complete
- **File:** `src/nimbus/components/models/ModelFilters.tsx` line 356
- **Issue:** The URL-sync effect guards on `initializedRef.current`, but the init effect sets it to `true` before this effect runs in the same commit. On first mount the sync effect therefore executes while `search` and `selected` still hold their initial empty values, calling `relayout` with no filters and `setSearchParams({})`, which briefly clears the URL and reflows the grid to the unfiltered total before the state updates from hydration flush.
- **Fix:** Use a `hydrated` state variable instead of a ref (and include it in the sync effect dependencies), or initialize the search/selected state directly from the URL so the sync effect does not need an init guard.

#### CR-1e566b5b3e76 · Missing top border regression
- **File:** `src/nimbus/components/Footer.astro` line 108
- **Issue:** Line 108 changed `<footer class:list={["border-t border-border", className]}>` to `<footer class:list={[className]}>`, dropping the "border-t border-border" classes from the footer element. BaseLayout renders `<Footer />` and DocsLayout renders `<Footer ... />` without adding a border, so this removes the visual separator above the footer on every page.
- **Fix:** Restore "border-t border-border" in the footer class:list (e.g. `["border-t border-border", className]`) unless the removal was intentional.

### Suggestions (1)

#### CR-e4e16beab017 · Input schema omits demonstrated fields
- **File:** `src/content/catalog-models/anthropic-claude-sonnet-5.json` line 129
- **Issue:** The 'Creative Writing with High Effort' example at lines 129-134 sets `output_config.effort` and `thinking.type`, but `schema.input.properties` (lines 441-525) only defines `messages`, `max_tokens`, `system`, `stream`, and `metadata`, with no declarations for `output_config` or `thinking`.
- **Fix:** Add `output_config` and `thinking` property schemas under `schema.input.properties` so the documented schema matches the supported request fields used in the examples.

---

## Style Guide Review

### Suggestions (6)

#### SG-fb362e3bec2d · Heading uses title case
- **File:** `src/content/docs/r2/data-catalog/manage-catalogs.mdx` line 282
- **Issue:** #### Example read-write Access Policy
- **Fix:** Use sentence case: `#### Example read-write access policy`.

#### SG-3bcef4381d5c · Heading uses title case
- **File:** `src/content/docs/r2/data-catalog/manage-catalogs.mdx` line 309
- **Issue:** #### Example read-only Access Policy
- **Fix:** Use sentence case: `#### Example read-only access policy`.

#### SG-8579b8eaaaa1 · Use TypeScriptExample component for TS code blocks
- **File:** `src/content/docs/workflows/build/workers-api.mdx` line 714
- **Issue:** Line adds a raw ` ```ts ` fenced block in a docs MDX file.
- **Fix:** Use `<TypeScriptExample>` instead so a JS tab is auto-generated.

#### SG-780ee5a5a7a0 · Remove LLM-filler phrase
- **File:** `src/content/changelog/r2/2026-07-09-r2-data-catalog-read-only-tokens.mdx` line 18
- **Issue:** Line begins with `Note that`
- **Fix:** Remove `Note that` and state the fact directly: `Credentials vended by the catalog inherit the R2 storage permissions of the token used to authenticate.`

#### SG-c5987cce2bde · Bullet list has fewer than three items
- **File:** `src/content/changelog/r2/2026-07-09-r2-data-catalog-read-only-tokens.mdx` line 13
- **Issue:** List contains only two bullet items (read-only and write operations)
- **Fix:** Consider rewriting the two items as prose instead of a bullet list.

#### SG-89650ecc10b2 · Use TypeScriptExample component for TypeScript samples
- **File:** `src/content/docs/workflows/build/trigger-workflows.mdx` line 225
- **Issue:** Added a raw ```ts fenced block in a docs MDX file
- **Fix:** Replace the raw ```ts block with the <TypeScriptExample> component so JS is auto-generated.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

Warnings (3)
File Issue
durable-objects/reference/durable-objects-migrations.mdx line 409 Badly indented admonition close marker — The closing ::: marker is indented with two spaces while the matching opener :::caution[Important] is flush left. MDX/remark admonition parsers treat an indented close fence as content rather than the actual end of the admonition, so the caution block will continue and can consume the following :::note block and paragraphs. Fix: Remove the leading spaces on the ::: line so it aligns with the :::caution[Important] opener and correctly closes the admonition.
src/nimbus/components/models/ModelFilters.tsx line 356 Sync effect runs before hydration is complete — The URL-sync effect guards on initializedRef.current, but the init effect sets it to true before this effect runs in the same commit. On first mount the sync effect therefore executes while search and selected still hold their initial empty values, calling relayout with no filters and setSearchParams({}), which briefly clears the URL and reflows the grid to the unfiltered total before the state updates from hydration flush. Fix: Use a hydrated state variable instead of a ref (and include it in the sync effect dependencies), or initialize the search/selected state directly from the URL so the sync effect does not need an init guard.
src/nimbus/components/Footer.astro line 108 Missing top border regression — Line 108 changed <footer class:list={["border-t border-border", className]}> to <footer class:list={[className]}>, dropping the "border-t border-border" classes from the footer element. BaseLayout renders <Footer /> and DocsLayout renders <Footer ... /> without adding a border, so this removes the visual separator above the footer on every page. Fix: Restore "border-t border-border" in the footer class:list (e.g. ["border-t border-border", className]) unless the removal was intentional.
Suggestions (1)
File Issue
catalog-models/anthropic-claude-sonnet-5.json line 129 Input schema omits demonstrated fields — The 'Creative Writing with High Effort' example at lines 129-134 sets output_config.effort and thinking.type, but schema.input.properties (lines 441-525) only defines messages, max_tokens, system, stream, and metadata, with no declarations for output_config or thinking. Fix: Add output_config and thinking property schemas under schema.input.properties so the documented schema matches the supported request fields used in the examples.

Conventions

No convention issues found.

Style Guide Review

Suggestions (6)
File Issue
r2/data-catalog/manage-catalogs.mdx line 282 Heading uses title case — #### Example read-write Access Policy Fix: Use sentence case: #### Example read-write access policy.
r2/data-catalog/manage-catalogs.mdx line 309 Heading uses title case — #### Example read-only Access Policy Fix: Use sentence case: #### Example read-only access policy.
workflows/build/workers-api.mdx line 714 Use TypeScriptExample component for TS code blocks — Line adds a raw ```ts fenced block in a docs MDX file. Fix: Use <TypeScriptExample> instead so a JS tab is auto-generated.
changelog/r2/2026-07-09-r2-data-catalog-read-only-tokens.mdx line 18 Remove LLM-filler phrase — Line begins with Note that Fix: Remove Note that and state the fact directly: Credentials vended by the catalog inherit the R2 storage permissions of the token used to authenticate.
changelog/r2/2026-07-09-r2-data-catalog-read-only-tokens.mdx line 13 Bullet list has fewer than three items — List contains only two bullet items (read-only and write operations) Fix: Consider rewriting the two items as prose instead of a bullet list.
workflows/build/trigger-workflows.mdx line 225 Use TypeScriptExample component for TypeScript samples — Added a raw ts fenced block in a docs MDX file Fix: Replace the raw ts block with the component so JS is auto-generated.
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
*.astro @cloudflare/content-engineering, @kodster28
* @cloudflare/product-owners
*.ts @cloudflare/content-engineering, @kodster28

@cloudflare cloudflare deleted a comment from Lisas6194500 Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@MohamedH1998

Copy link
Copy Markdown
Contributor Author

/bonk my PR is out of date, do you mind merging with production por favor?

@ask-bonk

ask-bonk Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

✅ Merged the latest production into your branch — it came in clean with no conflicts. The auto-push will fire after this response. Your PR is now up to date!

github run

@MohamedH1998 MohamedH1998 enabled auto-merge (squash) July 13, 2026 10:47
@MohamedH1998 MohamedH1998 merged commit e1f2c99 into production Jul 13, 2026
14 checks passed
@MohamedH1998 MohamedH1998 deleted the fix/model-pages-port branch July 13, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants