Pages

Changelog page

The changelog template, built only from library items: every release newest first under a hairline, its date in capitals on the left, the change as a Funnel Display sentence, its details and a picture when there is one.

Install

React apps get the React files; every other stack gets the web component.

npx spyglass-ds add changelog-page
<script type="module" src="/spyglass-ds/elements/changelog-page.js"></script>
Changelog page

Changelog.

New in Spyglass, newest first.

  1. Give your agents access to Instagram and TikTok.

    Agents can search creatives on Instagram and TikTok with the same questions you ask.

  2. Add any brand or creator in under a minute.

    Paste a handle or a page. Spyglass starts tracking it right away.

  3. Briefs on what changed.

    Spyglass follows the brands, creators, and niches that matter to you then turns the changes into a brief you actually want to read.

    • New ads and formats, by brand.
    • Hooks that came back.
    • Creators added or dropped.
  4. YouTube joins the index.

    Meta, TikTok, Instagram, and YouTube creatives in one index.

Usage

A website's changelog. The entries are examples drawn from what the assets say the product does, and their dates are placeholders: replace them in lib/pages/changelog.ts.

Never

  • New colors, shadows or type sizes added to a section: use the items' props
  • More than one White button in a section
  • A release date that is not real

sections lists the sections to show, in order (head, entries); a key left out is not shown. Each entry's image is a creative (an image slot, or the placeholder's brand and tone). menus passes the header menus (the live card's picture, the use cases' shots).

Adds with it: creative-card, footer-row, site-header

Props

The web component takes the same as attributes or properties (<spyglass-changelog-page>); title is heading there.

<ChangelogPage>

PropTypeDefault
contentChangelogContent
menusHeaderMenus

The header menus' content, pictures included (the live card's `picture`, the use cases' `shots`); Acme by default.

sectionsreadonly ChangelogSection[]

The sections to show, in order; all of them in the page order by default (leave one out to omit it).

classNamestring

Examples

The same example in React and as web components; both render identically.

react/examples/changelog-page/Page.tsx
import { ChangelogPage } from '@/react/components/pages/ChangelogPage'
// The changelog page template with its own copy.

export default function Page() {
  return <ChangelogPage />
}
elements/examples/changelog-page/Page.html
<!-- The changelog page template with its own copy. -->
<spyglass-changelog-page></spyglass-changelog-page>

Source

react/components/pages/ChangelogPage.tsx
import { CreativeCard } from '@/react/components/site/CreativeCard'
import { FooterRow } from '@/react/components/site/FooterRow'
import { SiteHeader } from '@/react/components/site/SiteHeader'
import { changelogContent, type ChangelogContent, changelogSections, type ChangelogSection } from '@/lib/pages/changelog'
import { cn } from '@/react/lib/cn'
import { pageSections } from '@/lib/image'
import { Fragment, type ReactNode } from 'react'
import type { HeaderMenus } from '@/lib/site-header'

// The changelog from library items: the title, then every release newest first under a hairline, its date in
// capitals on the left (it stays in view while the entry scrolls on wide screens), the change as a Funnel Display
// sentence, a line, the details and a picture when there is one. `content` replaces the entries
// (lib/pages/changelog.ts).
export interface ChangelogPageProps {
  content?: ChangelogContent
  /** The header menus' content, pictures included (the live card's `picture`, the use cases' `shots`); Acme by default. */
  menus?: HeaderMenus
  /** The sections to show, in order; all of them in the page order by default (leave one out to omit it). */
  sections?: readonly ChangelogSection[]
  className?: string
}

const WRAP = 'mx-auto w-full max-w-[calc(var(--ds-layout-content)+2*var(--ds-layout-gutter))] px-(--ds-layout-gutter)'

export function ChangelogPage({ content: c = changelogContent, menus, sections, className }: ChangelogPageProps) {
  const parts: Record<ChangelogSection, ReactNode> = {
    head: (
      <div className={cn(WRAP, 'grid gap-4 pt-16 pb-12 max-sm:pt-10 max-sm:pb-8')}>
        <h1 className="type-section">{c.title}</h1>
        <p className="max-w-140 type-body-lg text-fg-soft">{c.body}</p>
      </div>
    ),
    entries: (
      <ol className={cn(WRAP, 'grid pb-24 max-sm:pb-16')}>
        {c.entries.map((e) => (
          <li key={e.title} className="grid grid-cols-4 gap-12 border-t border-edge py-12 max-md:grid-cols-1 max-md:gap-4 max-sm:py-8">
            <p className="self-start type-label text-fg-muted md:sticky md:top-8"><time>{e.date}</time></p>
            <div className="col-span-3 grid max-w-180 gap-4 max-md:col-span-1">
              <h2 className="type-heading-2 text-balance">{e.title}</h2>
              <p className="type-body text-fg-soft">{e.body}</p>
              {e.items.length > 0 && <ul className="grid list-disc gap-2 pl-5 type-body text-fg-soft marker:text-fg-faint">{e.items.map((i) => <li key={i}>{i}</li>)}</ul>}
              {e.image && <CreativeCard {...e.image} alt={e.image.alt ?? e.title} ratio="16/9" className="mt-2" />}
            </div>
          </li>
        ))}
      </ol>
    ),
  }
  return (
    <div data-ds="changelog-page" className={cn('bg-surface text-fg', className)}>
      <SiteHeader menus={menus} links={c.header.nav} secondary={c.header.secondary} cta={c.header.cta} />
      <main>
        {pageSections(changelogSections, sections).map((k) => <Fragment key={k}>{parts[k]}</Fragment>)}
      </main>
      <footer className="border-t border-edge">
        <div className={cn(WRAP, 'py-10')}>
          <FooterRow domain={c.footer.domain} homeHref="/" links={c.footer.links} />
        </div>
      </footer>
    </div>
  )
}

export default ChangelogPage
lib/pages/changelog.ts
// The changelog template's copy: example entries built from what the assets say the product does. The dates are placeholders: replace them with real releases. Both flavors read this file.
import type { CreativeImage } from '@/lib/image'
/** An Acme placeholder creative: the advertiser, a neutral tone (1 to 4) and a headline. */
const creative = (brand: string, tone: 1 | 2 | 3 | 4, caption?: string): CreativeImage => (caption ? { brand, tone, caption } : { brand, tone })

const nav = [
	{ label: 'Product', href: '/product' },
	{ label: 'Pricing', href: '/pricing' },
	{ label: 'Changelog', href: '/changelog' },
	{ label: 'Blog', href: '/blog' },
]
const footer = {
	domain: 'spyglass.so',
	links: [
		{ label: 'Product', href: '/product' },
		{ label: 'Pricing', href: '/pricing' },
		{ label: 'About', href: '/about' },
		{ label: 'Changelog', href: '/changelog' },
		{ label: 'Blog', href: '/blog' },
		{ label: 'Terms', href: '/legal' },
	],
}
const header = { nav, secondary: { label: 'Sign in', href: '/sign-in' }, cta: { label: 'Get 50% off', href: '/pricing' } }

export const changelogContent = {
	header: { ...header, nav: nav.map((l) => (l.href === '/changelog' ? { ...l, current: true } : l)) },
	title: 'Changelog.',
	body: 'New in Spyglass, newest first.',
	entries: [
		{ date: 'Nov 10, 2026', title: 'Give your agents access to Instagram and TikTok.', body: 'Agents can search creatives on Instagram and TikTok with the same questions you ask.', items: [] as string[], image: creative('Acme Studio', 3) },
		{ date: 'Oct 27, 2026', title: 'Add any brand or creator in under a minute.', body: 'Paste a handle or a page. Spyglass starts tracking it right away.', items: [] as string[], image: null as CreativeImage | null },
		{ date: 'Oct 13, 2026', title: 'Briefs on what changed.', body: 'Spyglass follows the brands, creators, and niches that matter to you then turns the changes into a brief you actually want to read.', items: ['New ads and formats, by brand.', 'Hooks that came back.', 'Creators added or dropped.'], image: null as CreativeImage | null },
		{ date: 'Sep 29, 2026', title: 'YouTube joins the index.', body: 'Meta, TikTok, Instagram, and YouTube creatives in one index.', items: [] as string[], image: creative('Acme Fit', 2) },
	],
	footer,
}

export type ChangelogContent = typeof changelogContent

/** The changelog's sections in order; pass `sections` to reorder them or leave some out. */
export const changelogSections = ['head', 'entries'] as const
export type ChangelogSection = (typeof changelogSections)[number]
react/lib/cn.ts
// Joins class names, skipping falsy ones: cn('a', on && 'b', ['c', undefined]). It does not merge conflicting
// utilities (no tailwind-merge), as Vue's class binding does not: the library's classes are written not to compete,
// and a className from the caller is appended after them, as Vue appends a fallthrough class.
export type ClassValue = string | false | null | undefined | 0 | ClassValue[]

export function cn(...values: ClassValue[]): string {
	const out: string[] = []
	for (const v of values) {
		if (!v) continue
		if (Array.isArray(v)) {
			const s = cn(...v)
			if (s) out.push(s)
		}
		else out.push(v)
	}
	return out.join(' ')
}
elements/components/pages/changelog-page.ts
import { html, nothing } from 'lit'
import { DsElement, define, HostLayoutController } from '@/elements/lib/element'
import { changelogContent, type ChangelogContent, changelogSections, type ChangelogSection } from '@/lib/pages/changelog'
import '@/elements/components/site/creative-card'
import '@/elements/components/site/footer-row'
import '@/elements/components/site/site-header'
import styles from 'virtual:tw'
import { pageSections } from '@/lib/image'
import { ifDefined } from 'lit/directives/if-defined.js'
import { headerMenus, type HeaderMenus } from '@/lib/site-header'

// ChangelogPage.tsx as <spyglass-changelog-page>: every release newest first, its date on the left, the change, its
// details and a picture when there is one. `content` replaces the entries.
const WRAP = 'mx-auto w-full max-w-[calc(var(--ds-layout-content)+2*var(--ds-layout-gutter))] px-(--ds-layout-gutter)'

/**
 * @summary The changelog template.
 */
export class ChangelogPage extends DsElement {
	static styles = [DsElement.styles, styles]
	protected readonly layout = new HostLayoutController(this, () => this.renderRoot.querySelector<HTMLElement>('[data-ds="changelog-page"]'))
	static properties = { content: { type: Object }, menus: { type: Object }, sections: { type: Array } }
	/** The entries (lib/pages/changelog.ts by default). */
	content: ChangelogContent = changelogContent
	/** The header menus' content, pictures included (the live card's `picture`, the use cases' `shots`); Acme by default. */
	menus?: HeaderMenus
	/** The sections to show, in order (a list of names); all of them in the page order by default. */
	sections?: ChangelogSection[]

	render() {
		const c = this.content ?? changelogContent
		const parts: Record<ChangelogSection, unknown> = {
			head: html`<div class=${`${WRAP} grid gap-4 pt-16 pb-12 max-sm:pt-10 max-sm:pb-8`}><h1 class="type-section">${c.title}</h1><p class="max-w-140 type-body-lg text-fg-soft">${c.body}</p></div>`,
			entries: html`<ol class=${`${WRAP} grid pb-24 max-sm:pb-16`}>${c.entries.map((e) => html`<li class="grid grid-cols-4 gap-12 border-t border-edge py-12 max-md:grid-cols-1 max-md:gap-4 max-sm:py-8"><p class="self-start type-label text-fg-muted md:sticky md:top-8"><time>${e.date}</time></p><div class="col-span-3 grid max-w-180 gap-4 max-md:col-span-1"><h2 class="type-heading-2 text-balance">${e.title}</h2><p class="type-body text-fg-soft">${e.body}</p>${e.items.length ? html`<ul class="grid list-disc gap-2 pl-5 type-body text-fg-soft marker:text-fg-faint">${e.items.map((i) => html`<li>${i}</li>`)}</ul>` : nothing}${e.image ? html`<spyglass-creative-card src=${ifDefined(e.image.src)} fit=${ifDefined(e.image.fit)} position=${ifDefined(e.image.position)} brand=${ifDefined(e.image.brand)} caption=${ifDefined(e.image.caption)} tone=${ifDefined(e.image.tone)} alt=${e.image.alt ?? e.title} ratio="16/9" class="mt-2"></spyglass-creative-card>` : nothing}</div></li>`)}</ol>`,
		}
		return html`<div data-ds="changelog-page" class="bg-surface text-fg">
<spyglass-site-header .menus=${this.menus ?? headerMenus} .links=${c.header.nav} .secondary=${c.header.secondary} .cta=${c.header.cta}></spyglass-site-header>
<main>${pageSections(changelogSections, this.sections).map((k) => parts[k])}</main>
<footer class="border-t border-edge"><div class=${`${WRAP} py-10`}><spyglass-footer-row domain=${c.footer.domain} home-href="/" .links=${c.footer.links}></spyglass-footer-row></div></footer>
</div>`
	}
}

define('changelog-page', ChangelogPage)

Reference: Built from the library (site header, creative card, footer row); the entries' sentences are the posts' own lines.