Refresh public landing page and add rendered agent-instructions view#140
Draft
HamptonMakes wants to merge 3 commits into
Draft
Refresh public landing page and add rendered agent-instructions view#140HamptonMakes wants to merge 3 commits into
HamptonMakes wants to merge 3 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 atGET /agent-instructions, which serves rawtext/markdownand 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)sign_in_path) — they're one auto-login away. Everyone gets "Connect your agent".config.landing_page_partialand the agents section still swaps independently viaconfig.landing_agents_partial, so host overrides (e.g. coplan-square'ssq 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)curlexample, a link to the raw markdown, and the full instructions document rendered via the existingMarkdownHelper#render_markdown(interactive: false).X-Agent-Instructionsheader points here, so negotiation is deliberately conservative. HTML is served only when theAcceptheader leads withtext/html(exactly what browsers and Turbo Drive send). curl's defaultAccept: */*, an absentAccept, andAccept: text/markdownall gettext/markdownbyte-identical to before (spec-asserted, and verified live with real curl)..mdalways forces raw;.htmlalways forces the page. A string check on the raw header is intentional — Rails maps*/*to HTML, sorespond_to/request.formatwould misroute every agent.WelcomeController).Plumbing
coplan--clipboardStimulus controller (vanilla, auto-pinned via the existingpin_all_from), with "Copied!" feedback, a non-secure-context fallback, and label restore on disconnect so Turbo's cache never snapshots a stale state.coplan/shared/_copy_urlpartial used by both the landing agents section and the instructions page.coplan/application.css; verified in both light and dark themes.Testing
*/*/text/markdown/ no header; HTML for browser Accept;.mdand.htmloverrides; signed-in nav chrome).bundle exec rspec: 954 examples, 0 failures.curl(with and without Accept headers) gets identical raw markdown; browser screenshots of/and/agent-instructionsin light and dark; copy button click shows "Copied!" and writes the URL to the clipboard.🤖 Generated with Claude Code