Skip to content

Refresh public landing page and add rendered agent-instructions view#140

Draft
HamptonMakes wants to merge 3 commits into
mainfrom
hampton/homepage-refresh
Draft

Refresh public landing page and add rendered agent-instructions view#140
HamptonMakes wants to merge 3 commits into
mainfrom
hampton/homepage-refresh

Conversation

@HamptonMakes

Copy link
Copy Markdown
Collaborator

Why

The engine's default landing page is what any company deploying CoPlan shows employees at /, and what the open-source project shows the world — but it was a thin three-step page that under-sold the product. Worse, its "agent instructions" link pointed at GET /agent-instructions, which serves raw text/markdown and opens as an ugly wall of text in a browser, even though that endpoint is the front door we tell every human to hand to their agent.

What

Landing page (coplan/welcome/_default_landing)

  • Rewrote the default landing partial to actually pitch the product, using language from README/CONCEPT (no invented testimonials, logos, or metrics): the humans comment, agents edit model, Google-Docs-style inline anchored commenting, immutable versions with full provenance, realtime collaboration, the plan lifecycle, and the semantic agent API.
  • Added a CSS-only illustrative mock of the review loop (anchored highlight → reviewer comment → agent edit → new version) built from the same design tokens as the real plan UI, so it themes correctly in light and dark.
  • CTAs adapt to auth state: signed-in users get "Browse plans"; anonymous visitors get "Sign in to get started" (when the host configures sign_in_path) — they're one auto-login away. Everyone gets "Connect your agent".
  • Still rendered via config.landing_page_partial and the agents section still swaps independently via config.landing_agents_partial, so host overrides (e.g. coplan-square's sq agents skills add coplan) keep working. The default agents section now also shows the full instructions URL with a copy button.

Agent instructions (/agent-instructions)

  • Browsers now get a styled HTML page: "Connect your AI agent" header, a prominent copy-to-clipboard chip with the raw instructions URL, a curl example, a link to the raw markdown, and the full instructions document rendered via the existing MarkdownHelper#render_markdown(interactive: false).
  • The raw endpoint behavior is unchanged and load-bearing: every API response's X-Agent-Instructions header points here, so negotiation is deliberately conservative. HTML is served only when the Accept header leads with text/html (exactly what browsers and Turbo Drive send). curl's default Accept: */*, an absent Accept, and Accept: text/markdown all get text/markdown byte-identical to before (spec-asserted, and verified live with real curl). .md always forces raw; .html always forces the page. A string check on the raw header is intentional — Rails maps */* to HTML, so respond_to/request.format would misroute every agent.
  • Signed-in visitors keep their normal nav chrome on the HTML page (optional user resolve, same approach as WelcomeController).

Plumbing

  • New coplan--clipboard Stimulus controller (vanilla, auto-pinned via the existing pin_all_from), with "Copied!" feedback, a non-secure-context fallback, and label restore on disconnect so Turbo's cache never snapshots a stale state.
  • Shared coplan/shared/_copy_url partial used by both the landing agents section and the instructions page.
  • All new CSS uses the existing design tokens/BEM style in coplan/application.css; verified in both light and dark themes.

Testing

  • New/updated request specs: anonymous landing render + CTAs, agents-section copy-URL element, content negotiation (markdown byte-identical across */* / text/markdown / no header; HTML for browser Accept; .md and .html overrides; signed-in nav chrome).
  • bundle exec rspec: 954 examples, 0 failures.
  • Verified live against a dev server: real curl (with and without Accept headers) gets identical raw markdown; browser screenshots of / and /agent-instructions in light and dark; copy button click shows "Copied!" and writes the URL to the clipboard.

🤖 Generated with Claude Code

HamptonMakes and others added 2 commits July 16, 2026 10:23
The landing page now pitches the full product — the humans-comment-
agents-edit model, inline anchored commenting, immutable versions with
provenance, realtime collaboration, and the agent API — with a CSS-only
mock of the review loop, a feature grid, and CTAs for both anonymous
visitors (sign in, when the host configures a sign_in_path) and
signed-in users. It remains a partial rendered via
config.landing_page_partial, and the agents section still swaps via
config.landing_agents_partial.

/agent-instructions now serves a styled HTML page to browsers (Accept
header leading with text/html) with a copy-to-clipboard instructions
URL, a curl example, a link to the raw markdown, and the same document
rendered via MarkdownHelper. Non-browser clients — curl's default
Accept: */*, Accept: text/markdown, or no Accept header — still get
raw text/markdown, byte-identical to before, since every API response's
X-Agent-Instructions header points here. /agent-instructions.md always
forces raw markdown.

Adds a small coplan--clipboard Stimulus controller (auto-pinned via
pin_all_from) used by both the new page and the default agents section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Resolve the optional signed-in user on the HTML agent-instructions
  page (same approach as WelcomeController) so signed-in visitors keep
  their nav chrome instead of seeing the signed-out header.
- Honor an explicit .html format regardless of Accept header, mirroring
  how .md always forces raw markdown.
- Build the instructions URL with the agent_instructions_url helper
  instead of hand-concatenating base_url + path.
- Extract the copy-URL chip into a shared partial (coplan/shared/
  _copy_url) used by both the agents landing section and the
  agent-instructions page, with one .copy-url CSS block.
- Deduplicate the "Connect your agent" CTA across auth branches.
- Restore the copy button label on Stimulus disconnect so Turbo's page
  cache never snapshots a stale "Copied!" state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…conflicts

Conflicts resolved:
- engine/app/views/coplan/welcome/_default_landing.html.erb: kept the PR's
  sign-in CTA using CoPlan.configuration.sign_in_path (the canonical API on
  main, used by the engine's ApplicationController).
- engine/app/javascript/controllers/coplan/clipboard_controller.js: kept the
  PR's version, a superset of main's — supports both a preset text value
  (attachments embed snippets) and a source target, with a non-secure-context
  fallback and Turbo-cache-safe label restore.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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