Skip to content

Landing page: accurate claims, working developer snippets, optional live demo - #16

Closed
TahubCS wants to merge 4 commits into
mainfrom
claude/dazzling-hypatia-9kvwhh
Closed

TahubCS wants to merge 4 commits into
mainfrom
claude/dazzling-hypatia-9kvwhh

Conversation

@TahubCS

@TahubCS TahubCS commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

The landing page described a product Supo isn't yet:

  • invented metrics (80% / 94% resolution / 99.9% uptime SLA)
  • placeholder testimonials
  • paid tiers with no billing
  • API examples for an api.supo.ai/v1/chat endpoint and Node/Python/PHP SDKs that don't exist
  • 15 dead # links

This PR replaces all of it with real content and adds an optional live demo. It has three commits, each passing lint, typecheck and tests on its own.

1. Accurate landing content

  • Removed: TestimonialsSection, plus ClosingCTA and ProductShowcaseSection, which nothing rendered.
  • Hero: describes what Supo does. The KPI mock is replaced by an example conversation (a cited answer, then a handoff using the widget's real handoff reply). The badge now says "Now in open alpha".
  • Features: retrieval with citations (not "trained on your knowledge base"), the real handoff triggers (handoff/policy.ts), and widget chat plus email instead of "social media".
  • Pricing: one free alpha plan. Every listed feature exists in the codebase.
  • Developers section (renamed from APIPlayground): snippets for the published @supoapp/widget@alpha (checked against the npm package's types), the script embed, and POST /api/v1/knowledge/search.
  • Navbar and footer: links go to real sections and to docs/API.md, CHANGELOG.md and SECURITY.md in this repository.

2. Optional live demo widget

  • When NEXT_PUBLIC_SUPO_DEMO_PRODUCT_ID is set, the home page loads that product's widget through /widget.js, the same embed customers use.
  • mountDemoWidget() (src/lib/demo-widget.ts) handles the lifecycle:
    • It loads one bundle under React StrictMode.
    • On unmount it destroys the widget and clears its globals, so the launcher doesn't follow visitors into the app after client-side navigation.
    • It tears down an instance whose script finishes loading after unmount.

3. Docs

  • A README Mermaid diagram of indexing and answering, checked with the Mermaid renderer.
  • Demo setup steps and the changelog entry.

Testing

  • Unit tests: src/lib/__tests__/demo-widget.test.ts runs under happy-dom, a new dev dependency pinned to a release from September.
    • Each guard (StrictMode deferral, destroy on unmount, late-load teardown, the disposed flag) was removed in turn, and the matching test failed each time.
  • Browser (Chromium, next dev):
    • With the variable set: exactly one widget and one widget.js request, and the widget config returns 200.
    • The widget is removed after navigating to /sign-in and remounts on back. No widget console errors.
    • With the variable unset: no widget and no request.
  • Layout: full-page renders in light and dark mode, with no horizontal overflow at 390px wide.
  • CI-equivalent run: lint, typecheck, SDK typecheck, tests (199 with the database), production build, and migrations on a fresh database (the second run is a no-op).
  • bun audit reports no new findings.

Enabling the demo after merge

  1. Create a product (for example "Supo") and add its knowledge sources.
  2. Allow the production origin under Widget → Allowed websites, or leave the list empty.
  3. Set NEXT_PUBLIC_SUPO_DEMO_PRODUCT_ID and redeploy. It is read at build time because / is static.

…tent

The landing page described a product Supo isn't yet: invented metrics,
placeholder testimonials, paid tiers with no billing, and API examples for
an endpoint and SDKs that don't exist.

- Remove TestimonialsSection, plus ClosingCTA and ProductShowcaseSection,
  which nothing rendered.
- Hero: replace the 80% / 94% / 99.9% uptime SLA figures and the KPI mock
  with what Supo does, and an example conversation that shows a cited
  answer and a handoff using the widget's real handoff reply.
- Features: describe retrieval with citations, the real handoff triggers
  and the actual channels (widget chat and email).
- Pricing: one free alpha plan listing features that ship today.
- Rename APIPlayground to DeveloperSection, with snippets that work
  against the published @supoapp/widget package, the script embed and
  /api/v1/knowledge/search.
- Navbar and footer: replace dead "#" links with real sections and the
  repository's API reference, changelog and security policy
  (src/lib/site.ts).
With NEXT_PUBLIC_SUPO_DEMO_PRODUCT_ID set, the home page loads that
product's widget through /widget.js, the same script embed customers use.

mountDemoWidget() owns the lifecycle so it can be tested without React:
- The script insert is deferred one tick, so React StrictMode's
  mount/unmount/remount loads the bundle once.
- On unmount it destroys the widget and clears window.Supo and
  window.SupoSettings, so the launcher doesn't follow a visitor into the
  app after a client-side navigation.
- A script that finishes loading after unmount tears down the instance it
  created.

Tests run under happy-dom (new dev dependency). Each guard was checked by
removing it and confirming its test fails. Also verified in Chromium
against `next dev`: one widget, one bundle request, removed on navigation
to /sign-in, remounted on back, and nothing loaded with the variable unset.
- README: a Mermaid diagram of indexing and answering, matching
  retrieve.ts, the chat route's handoff decision and missing-knowledge
  gaps. Checked with the Mermaid renderer.
- README: document NEXT_PUBLIC_SUPO_DEMO_PRODUCT_ID and the steps to enable
  the landing-page demo.
- CHANGELOG: landing page changes.
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
supo Ready Ready Preview Oct 17, 2026 10:35pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3077d694-4138-4aa0-9114-5072c19552bf
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T22:30:33.264137Z 8a26f0f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a26f0f6be

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/demo-widget.ts Resolved
Browsers send no Origin header on same-origin GETs, and isOriginAllowed
rejects origin-less requests once a product has an allow-list. On Supo's
own pages, such as the landing-page demo, the widget's config, message
polling and realtime-token requests got a 403. The widget then silently
fell back to defaults, and agent replies didn't arrive without Ably.

Treat Sec-Fetch-Site: same-origin as a request from this deployment.
Browsers set it and pages cannot. Cross-site requests are still checked
against the allow-list.

Reproduced in Chromium against `next dev` (config 403 with an allow-list),
then verified: config 200 from the landing page, cross-site Origin 403,
request without Origin or metadata 403, allow-listed Origin 200.

This branch was successfully deployed

1 active deployment
Preview — 3fc442f8 Deployed Oct 17, 2026 by vercel[bot]
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.

1 participant