Skip to content

feat(#330): Content UI refactor — guides & articles hub/detail pages, CMS editorial workflow#334

Merged
NickLetts2 merged 6 commits into
mainfrom
copilot/featurecontent-ui-refactor
May 30, 2026
Merged

feat(#330): Content UI refactor — guides & articles hub/detail pages, CMS editorial workflow#334
NickLetts2 merged 6 commits into
mainfrom
copilot/featurecontent-ui-refactor

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

Extends the unified ContentItem platform (from #329) to deliver public content hubs for /guides and /articles, a full editorial workflow API, and shared frontend utilities across the marketing site.

CMS service

  • New statuses: Approved, Scheduled added to VALID_STATUSES
  • Search: ?search= on all public and admin list endpoints; _escape_like() helper escapes %, _, [, ] with backslash and passes escape="\\" to SQLAlchemy ilike() so the DB honours the escape character
  • Related content (GET /content/{type}/related/{slug}): same-category items preferred, backfilled from others; not_in exclusion set is bounded by limit (max 10)
  • 8 new admin workflow endpoints: submit-review, approve, request-changes, schedule, unpublish, clone, delete — all use _resolve_actor() to fall back to JWT sub/email
  • New request schemas: WorkflowActionRequest, RequestChangesRequest, ScheduleContentItemRequest, CloneContentItemRequest
  • 16 new tests; create_content_item() extracted to conftest.py to eliminate per-class _create_item duplication

Marketing site — new pages

Route Purpose
/guides SSR hub: search, category filter, pagination, SEO meta, Article list schema
/guides/[slug] Detail: breadcrumbs, markdown render, related content, soft CTA, Article + FAQ schema
/articles Same as guides hub
/articles/[slug] Same as guides detail

Sitemap updated to include static hub routes and dynamic published items for both types.

Shared utilities

  • src/lib/cms-client.tscmsBase, internalApiKey, cmsHeaders() used by all four content pages
  • src/lib/content/content-utils.tscalcReadingTime(), extractCategories(), buildPaginationUrl(), MS_PER_DAY (replaces inline 86_400_000 in both detail pages)

Docs

docs/content-ui.md — routing structure, hub/template design, SEO features, CMS API reference, editorial workflow.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Copilot AI and others added 5 commits May 30, 2026 06:27
- Create /articles/[slug].astro — SSR article detail page with breadcrumbs,
  author/date/reading-time meta, markdown rendering, inline conversion CTA,
  related articles section, Article + BreadcrumbList JSON-LD schemas
- Update sitemap.xml.ts: add /guides and /articles to static routes; fetch
  and include all published guides and articles with lastmod dates
- Create docs/content-ui.md: full developer reference covering routing,
  content hubs, detail page features, SEO, CMS API, editorial workflow,
  internal linking, accessibility, and testing commands

All 93 CMS service tests pass."

Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>
- Move `or_` import to module level in content.py
- Escape LIKE wildcards (%, _) in search params to prevent unexpected results
- Extract shared `calcReadingTime` and `extractCategories` utilities into
  lib/content/content-utils.ts; use in all four hub/detail pages
- Restore explicit BlogPost interface in sitemap.xml.ts; remove inline type
- Update docs/content-ui.md: WCAG 2.1 → WCAG 2.2 AA

Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>
- Extract _escape_like() helper; escape [ and ] in LIKE wildcards
- Extract _resolve_actor() helper; use across all workflow endpoints
- Add create_content_item() to conftest.py; remove duplicate _create_item
  methods from TestContentPublicRoutes, TestSlugUniquenessPerType,
  TestPublicSearchAndRelated
- Add lib/cms-client.ts with cmsBase/internalApiKey/cmsHeaders(); use in
  all four content pages (guides/articles hub + detail pages)
- Add buildPaginationUrl() to content-utils.ts; use in guides/articles
  hub pages pagination links
- Add explicit slug guard (if !slug return redirect) in detail pages
- Document word-count approximation limitation in content-utils.ts

All 93 CMS tests pass.

Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>
… limit

- Pass escape="\\" to all ilike() calls so the database correctly
  interprets the backslash-escaped LIKE pattern from _escape_like()
- Add inline comment noting that not_in set is bounded to limit+1 items
- Add sitemap comment about the 100-item-per-content-type cap

Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>
- Export MS_PER_DAY = 86_400_000 from content-utils.ts; import and use
  it in guides/[slug].astro and articles/[slug].astro in place of the
  inline magic number
- Change sitemap 100-item comment to a TODO for future pagination
- Clarify not_in comment to reference validated limit constraint

Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor content UI for blogs, guides, articles and CV pages feat(#330): Content UI refactor — guides & articles hub/detail pages, CMS editorial workflow May 30, 2026
Copilot AI requested a review from NickLetts2 May 30, 2026 06:43
@NickLetts2 NickLetts2 marked this pull request as ready for review May 30, 2026 07:35
@NickLetts2 NickLetts2 merged commit 04063ad into main May 30, 2026
17 checks passed
NickLetts2 added a commit that referenced this pull request Jun 1, 2026
…actor

feat(#330): Content UI refactor — guides & articles hub/detail pages, CMS editorial workflow
@NickLetts2 NickLetts2 deleted the copilot/featurecontent-ui-refactor branch June 2, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Step 2 - Content UI refactor for Blogs, Guides, Articles and CV For content

3 participants