Commit graph

7 commits

Author SHA1 Message Date
Lawrence Chen
46589f531c
Fix SEO indexing: hreflang, canonicals, sitemap, trailing slash (#2193)
* Fix SEO indexing: add hreflang, canonicals, sitemap per-locale entries

Google Search Console showed 380 not-indexed vs 86 indexed pages.
Root causes: missing hreflang tags on rendered pages (only in sitemap),
no canonical on homepage, inconsistent canonicals wiping parent hreflang,
sitemap only listing English URLs, trailing slash duplicates, and
_next/static chunks being crawled as pages.

Changes:
- Add buildAlternates() utility for consistent canonical + hreflang
- Add hreflang tags to all pages via alternates.languages in metadata
- Add self-referencing canonical URLs to every page (homepage had none)
- Expand sitemap to emit separate entries for each locale
- Add missing /docs/custom-commands to sitemap
- Remove skipTrailingSlashRedirect to normalize trailing slashes
- Block /_next/ in robots.txt to stop chunk crawling

* Add per-page alternates to docs sub-pages and blog index

Docs sub-pages and blog index only returned title/description in
generateMetadata, so they inherited the parent layout's alternates
(pointing to /docs or /blog). Now each page sets its own
buildAlternates() with the correct path so canonical and hreflang
point to the actual page URL.

* Derive openGraph.url from buildAlternates to avoid drift

* Redirect non-English legal pages to English, remove from sitemap

Legal pages (privacy policy, TOS, EULA) are untranslated English content.
Serving them under every locale creates 54 duplicate URLs. Now:
- Middleware 301-redirects /ja/privacy-policy etc. to /privacy-policy
- Sitemap only includes English URLs for legal pages (no locale variants)
- Legal page metadata uses static English-only canonical

* Fix legal page redirect to only match /<locale>/<page> paths

endsWith matched too broadly (e.g. /docs/eula). Now only redirects
when the path after the first segment is an exact legal page match.

* Skip next-intl for legal pages to prevent locale redirect loop

Without this, a Japanese user hitting /privacy-policy could be
redirected by next-intl to /ja/privacy-policy, which our middleware
redirects back to /privacy-policy, creating a loop.

* Rewrite legal pages to /en/ instead of NextResponse.next()

Pages live under app/[locale]/, so skipping next-intl entirely
would break route resolution. Rewrite to /en/privacy-policy etc.
so Next.js can resolve the [locale] segment correctly.

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-26 15:10:39 -07:00
Lawrence Chen
93d2245a97
fix(web): exclude PostHog proxy from i18n middleware (#1626)
* fix(web): exclude PostHog proxy path from i18n middleware

The next-intl middleware added in cf75da8f intercepts /cmuxterm/* requests
(the PostHog reverse proxy), causing analytics to break since March 12.
Add cmuxterm to the negative lookahead so proxy requests bypass i18n.

* refactor(web): rename middleware.ts to proxy.ts for Next.js 16

Next.js 16 renamed middleware.ts to proxy.ts. Migrate to the new
convention since we're on Next.js 16.1.6.

* feat(web): migrate PostHog to managed reverse proxy at r.cmux.dev

Replace the Next.js rewrites-based proxy (/cmuxterm -> us.i.posthog.com)
with PostHog's managed reverse proxy at r.cmux.dev. This removes the
rewrites from next.config.ts entirely and eliminates the proxy.ts
matcher conflict that caused the analytics regression.

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-17 17:02:42 -07:00
Lawrence Chen
cf75da8f8a
Internationalize website with next-intl for 19 languages (#1216)
* Add i18n framework with next-intl for 19 languages

Set up complete internationalization infrastructure:
- Install next-intl v4 with App Router support
- Create i18n config (routing, request, navigation)
- Add middleware for automatic locale detection from Accept-Language
- Restructure all routes under app/[locale]/
- Extract UI strings to messages/en.json
- Update all components to use useTranslations()
- Add language switcher dropdown in footer
- Support RTL for Arabic and Khmer
- Update sitemap with locale alternates
- Add generateStaticParams for all 19 locales

Languages: en, ja, zh-CN, zh-TW, ko, de, es, fr, it, da, pl, ru, bs, ar, no, pt-BR, th, tr, km

Locale detection: auto-detect from browser Accept-Language header,
with cookie persistence and locale prefix only for non-default (en).

* Add translations for de, fr, it, ja, zh-CN, zh-TW

* Add translations for ar, bs, da, es, km, no, pl, pt-BR, ru, th, tr

* Convert docs and legal pages to use useTranslations()

* Add i18n to keyboard shortcuts component

* Add i18n to wall-of-love, add missing blog posts to sitemap

* Add keyboard shortcuts and wallOfLove translations to all locales

* Update bun lockfile for next-intl dependency

* Fix t.rich() configPath: pass ReactNode not function for {var} interpolation

* Fix configPath: use rich text tag instead of plain interpolation for ReactNode

* Fix t.rich() interpolation: use rich text tags for all ReactNode placeholders

Changed {legacy}, {openShortcut}, {jumpShortcut} from plain variable
interpolation to <tag>content</tag> format so t.rich() gets proper
functions instead of values.

* Escape ICU curly braces in socketCallout rich text across all locales

* Fix i18n issues: Khmer RTL, zh-CN quality, locale-aware testimonials, hardcoded strings

- Fix Khmer (km) incorrectly marked as RTL (it's LTR, only Arabic is RTL)
- Fix zh-CN/zh-TW taglinePrefix to mention terminals and open source
- Add locale-aware testimonial translations: show original text, translate
  for non-matching locales, skip translation when locale matches original
- Translate hardcoded English table content in notifications page
- Add testimonial translations to all 19 locale files
- Remove unused setRequestLocale import and params from home page

* Address PR review comments: metadata localization, blog fixes, legal pages, accessibility

- Convert hardcoded metadata to generateMetadata with getTranslations on all docs, blog, community, and wall-of-love pages
- Fix blog canonical/OG URLs to be locale-aware
- Fix introducing-cmux .split(": ") by using separate label/desc translation keys
- Revert legal page titles to English (legal content stays English-only)
- Add focus-visible ring to language switcher for keyboard accessibility
- Preserve query string and hash when switching locale
- Convert site-footer to server component (remove unnecessary "use client")
- Remove .toLowerCase() on translated text in community page
- Add /docs/browser-automation and /wall-of-love to sitemap
- Fix keyboard-shortcuts jump link visibility with trimmed query
- Deduplicate blogSlugs by importing from blog-posts.ts
- Add typingCodingAgents/typingMultitasking translation keys to all locales
- Fix Spanish accent/tilde issues in es.json testimonials
- Fix nested <a> tag in homepage keyboard shortcuts feature
- Remove unused setRequestLocale import from homepage

* Convert remaining layout/index metadata to generateMetadata

- Root layout: locale-aware title, description, OG, and Twitter card metadata
- Docs layout: translated title template
- Blog layout: translated title template
- Blog index: locale-aware metadata

* Add translated metadata keys to all locales, fix docs redirect

- Add meta.title/description/ogDescription to all 18 non-English locales
- Add docs.layoutTitle, blog.layoutTitle/metaTitle/metaDescription to all locales
- Add blog post metadata (zenOfCmux, cmdShiftU, showHnLaunch, introducingCmux) to all locales
- Add community.metaTitle/metaDescription to all locales
- Fix docs index redirect to preserve locale prefix

* Add translated docs page metaTitle keys to all locales
2026-03-12 05:36:58 -07:00
Lawrence Chen
29054dc709
Add sidebar help menu to footer (#958)
* Add sidebar help menu

* Fix help menu test wiring

* Fix help menu accessibility

* Use native popup for help menu

* Use icon button for sidebar help

* Add feedback composer and feedback API

* Allow preview builds without feedback env

* Tighten feedback upload limits

* Adjust sidebar footer padding

* Tighten sidebar footer spacing

* Add link affordances to help menu

* Polish sidebar feedback composer

* Move feedback icon to trailing edge

* Normalize help menu trailing icon sizes

* Enlarge help menu trailing icons

* Reduce help menu link icon size

* Shrink help menu link arrow

* Reduce help menu link arrow again

* Fix feedback message editor focus

* Add send feedback keyboard shortcut

* Polish feedback launch and delivery
2026-03-05 21:00:42 -08:00
Lawrence Chen
851c706db7
Redesign changelog page with feature highlights (#630)
* Redesign changelog page with feature highlights and visual hierarchy

Major releases now show narrative summaries, feature highlight cards
(with image support for screenshots), colored section badges, and
contributor avatars. Minor releases stay compact. Adds changelog-media.ts
as a supplementary data layer alongside CHANGELOG.md.

* Use Next.js Image for optimized loading and GitHub avatar remotes

* Add screenshots for Open With and Tab Colors features

* Add workspace metadata screenshot

* Switch to single-column inline layout, add command palette screenshot

* Conductor-style titles, narrower body, narrative descriptions, reorder features

* Add pin workspace and tab context menu screenshots, remove subtitle

* Add View Changelog link to front page, add DevTools to 0.60.0

* Add CJK input screenshot to 0.60.0

* Read real PNG dimensions at build time, add proper sizes attribute

* Fix image overflow: wrap in overflow-hidden container, add max-w-full

* Fix CSS cascade: move docs-content styles into @layer base

Unlayered CSS beats @layer utilities in the cascade, so .docs-content
rules (margins, padding, list-style) were overriding Tailwind utilities
on ul, li, h2 elements in the changelog page. Moving them into
@layer base lets utilities win without needing !important hacks.

* Switch docs-content spacing from margin to padding

Margins were collapsing and conflicting with Tailwind layout utilities
in the changelog. Padding doesn't collapse and can't interfere with
external spacing set by parent containers.

* Fix changelog layout: use flex column + inline styles for all spacing

Block layout was collapsing when articles had media content (h2, feature
divs, section divs all rendered at the same position). Switching to
display:flex + flex-direction:column on articles and using inline styles
for all spacing guarantees proper vertical stacking regardless of
docs-content CSS interference.

* Remove border from changelog images

* Replace devtools screenshot with cmux inspecting cmux.dev
2026-02-27 03:41:52 -08:00
Lawrence Chen
cb86322e98
Remove docs-site, add PostHog analytics to web (#66)
- Delete docs-site/ (superseded by web/app/docs)
- Add posthog-js with Vercel reverse proxy at /cdata to bypass adblockers
- Track pageviews (SPA-aware), download clicks (hero/navbar/mobile_drawer),
  and GitHub link clicks (hero/navbar/mobile_drawer/footer)
2026-02-18 04:00:04 -08:00
Lawrence Chen
d25f14a79f Add landing page (web/) with Next.js + Tailwind
- Minimal centered layout with Geist sans font
- Typing animation cycling through agent names
- Light/dark mode toggle via next-themes
- Download for Mac button linking to latest DMG
- Feature list, GitHub + Docs footer links
- Meta tags and Open Graph for SEO
- CI: add web typecheck job (tsc --noEmit)
2026-02-09 20:51:27 -08:00