feat(web): put the one-line install in front of everyone - #113
Merged
Conversation
The CLI is the product, and the way you get it was nowhere on the site. You had to already know the URL of a script served out of public/. Two placements, one command: - The homepage hero gets the loud version, directly under the lede and above the fold -- a bordered dark panel, the command at full size, Copy alongside. - Every page carries a compact version in the rail, between the brand and the nav. Present on arrival, never competing with navigation. Both come from renderInstallCommand() in one module. The homepage builds its HTML as a string and the rest of the site is JSX, which is precisely the shape that lets one copy of a command drift while the other stays right -- so there is one definition and SiteShell renders it rather than restating it. The command keeps its flags: `curl -fsSL`. Without -f, curl prints an HTTP error body and still exits 0, so a 404 gets piped into sh; without -L the install breaks the first time the URL redirects. This is the form install.sh already documents in its own header. Copy is one delegated listener on document for any [data-copy] button, mounted site-wide in the layout. Delegation because the two placements arrive by different rendering paths and a document listener does not care which; it also means the next copy button needs the attribute and no wiring. It falls back to a throwaway textarea + execCommand outside a secure context, where navigator.clipboard is simply undefined, so the button never no-ops silently. The contract tests pin the command, both placements, and that the clipboard payload equals the visible text -- a Copy button that hands over something other than what is on screen is worse than no button. They also read public/install.sh and assert it is #!/bin/sh and documents this exact command, so `| sh` cannot quietly become a lie. apps/logicsrc-web: 13 new tests pass, 46 total. The ontology-api contract file fails to resolve @logicsrc/validators, which it also does on a pristine origin/master -- unbuilt workspace package, unrelated to this change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
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.
The CLI is the product and the way you get it was nowhere on the site — you had to already know the URL of a script sitting in
public/.Two placements, one definition
Copyalongside, with aread the script firstlink.Both render from
renderInstallCommand()in one module. The homepage builds HTML as a string while the rest of the site is JSX — exactly the shape that lets one copy of a command drift while the other stays correct — soSiteShellrenders the shared definition rather than restating it.The flags are load-bearing
curl -fsSL, not barecurl. Without-fcurl prints an HTTP error body and still exits 0, so a 404 gets piped intosh; without-Lthe install breaks the first time the URL redirects. This is the forminstall.shalready documents in its own header.Copy button
One delegated listener on
documentfor any[data-copy]button, mounted site-wide in the layout — the two placements arrive by different rendering paths and a document listener doesn't care which. Falls back to a throwaway textarea +execCommandoutside a secure context, wherenavigator.clipboardis undefined, so the button never silently no-ops.Verification
apps/logicsrc-web.public/install.shand assert it is#!/bin/shand documents this exact command, so| shcan't quietly become a lie.tsc --noEmitclean across the app.SiteShellthroughreact-dom/serverto confirm real output and ordering (rail sits between brand and nav).Pre-existing failure, not from this change:
contract/ontology-api.contract.test.tsfails to resolve@logicsrc/validators(unbuilt workspace package). Verified it fails identically on a stashed, pristineorigin/master.next buildtrips on the same chain.🤖 Generated with Claude Code