Skip to content

fix(landing): drop OpenClaw from the hero rotator and match the self-host command to the README (TASK-152) - #1866

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/task-152-hero-openclaw-and-selfhost
Sep 25, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
fix/task-152-hero-openclaw-and-selfhost

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Two strings on the live landing hero, both wrong in a direction that no existing test could see (TASK-152, filed by lily-shen from the deployed build 9a32fca5).

What was wrong

  1. The rotator still advertised OpenClaw. V2LandingPage.tsx:204 pulled landing.hero.terms.openClaw, with keys in en.json:634 and zh-CN.json:633 — after the wash had removed OpenClaw from the README and docs.
  2. The install one-liner was not runnable as written. SELF_HOST_COMMAND read git clone github.com/Team-Commonly/commonly && docker compose up: no scheme on the clone URL, no directory change, and no setup step. Anyone who pasted it got a bare clone and no started stack.

What changed

  • Removed the OpenClaw reference and both locale keys.
  • SELF_HOST_COMMAND now matches the README Quick Start block exactly: git clone https://github.com/Team-Commonly/commonly.git && cd commonly && ./install.sh.
  • A comment above the constant says why it must stay in step with the README, so the next editor sees the coupling.
  • One new test file, frontend/src/v2/landing/__tests__/landingHeroContent.test.tsx.

The guard derives its expectations, it does not restate them

A restated list of terms would have gone stale in exactly the way these strings did, so each assertion is computed from the artifact it must agree with:

  • Rotator set parity. The landing.hero.terms.* keys the component asks the translator for must equal the keys present under landing.hero.terms in both locale files. Dead copy (a shipped key nothing references — what OpenClaw became) and a dangling reference (a key the visitor would see rendered raw) both fail.
  • Rendered hero. Every shipped term is present in the DOM and OpenClaw is not. This is possible because the rotator renders the whole stack (.v2-landing__rotator-stack), not only the active term, so the assertion does not depend on where in the cycle a term sits.
  • README parity. SELF_HOST_COMMAND is compared against the README's Quick Start bash block, parsed at test time and collapsed into one command. The published instruction and the shortcut cannot drift apart again — in either direction.

Mutation campaign

Four mutations, each applied in isolation against the commit, restore verified by diffing the working tree against that commit (0 files differing after each run):

mutation result
re-add the reference and both locale keys (the real regression shape) parity red + rendered red
re-add the locale key only (dead copy) parity red + rendered red (the shipped term no longer renders)
restore the old broken one-liner README-parity leg red
delete cd commonly from the README README-parity leg red

The guard also fails against the unfixed code, which is how I found the second defect in my own harness rather than in the product: the first draft of the mutation script restored from git checkout -- <file> before the fix was committed, which discarded the working-tree change instead of the mutation. The fix is committed first now, and every restore is verified against the commit.

Verification

  • npx tsc --noEmit clean; npx eslint on both files 0 errors (the two react/jsx-filename-extension warnings fire on untouched .tsx files too).
  • Full frontend suite: 110 suites / 929 tests passing.
  • New file: 3 tests, green.
  • No backend change, so no backend suite run.
  • No build coupling to check: the SEO page generator (scripts/generate-seo-pages.mjs) templates the hero's lede / eyebrow / ariaLabel into the prerendered pages and does not emit either the rotator terms or the install command, so nothing in the built output had to move with these strings.

Scope note

There is no copy button on the install block — the command renders in overflow-x: auto with white-space: nowrap (.v2-landing__install), so the longer one-liner scrolls sideways exactly as the shorter one did. lily-shen's note made copy-whole-command a condition, so it is worth saying plainly: there is nothing to fix there because there is no such control; adding one would be a new design element and ux-lead's call, not this row's.

Four terms instead of five in the rotator is a cadence change; lily-shen's note said ux-lead only if the rhythm needs a look. No layout change: the sizer follows the active term.

…host command to the README (TASK-152)

The hero still advertised OpenClaw after the wash removed it everywhere else,
and the install one-liner was not runnable as written: no scheme on the clone
URL, no directory change, and no setup step, so anyone who pasted it got a
bare clone and no started stack.

The guard derives both values instead of restating them. The rotator terms are
checked for exact set parity against landing.hero.terms in en.json and
zh-CN.json (dead copy and dangling references both fail), and SELF_HOST_COMMAND
is compared against the README Quick Start block parsed at test time, so the
published instructions and the shortcut cannot drift apart again. The rendered
hero is also asserted to contain every shipped term and no OpenClaw, which is
possible because the rotator renders the whole stack, not just the active term.

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GATE: PASS at b57f4ac2 — measured. No gap found.

BASE 3/3, RESTORED 3/3, tree clean after every mutation. Anchor count 1 each.

mutation result
source drops cd commonly from SELF_HOST_COMMAND 1 red
README changes, source does not 1 red
openClaw key restored in en.json only 2 red
source references a key no locale ships 1 red
one term removed from zh-CN.json only 1 red
README heading renamed so the block cannot be found 1 red, with the explicit message

A derived assertion is usually where I expect to find a gap, because both sides can move together and the test passes on anything. These don't, and three of the mutations are the ones that prove it rather than assume it:

  • The README side is live. Editing README.md alone, leaving the component untouched, reds the test. That is the difference between parsing the README and decorating the test with the fact that you did.
  • The second locale is genuinely checked. Removing a term from zh-CN.json only reds it. A guard that says "in both languages" and only ever exercises en is the standard version of this bug; this one is not that.
  • It fails loud, not vacuous. Renaming the heading makes the helper throw README.md no longer has a bash block under a "## Quick Start" heading. The alternative — a regex that quietly returns '' and compares equal to nothing — is how this class of guard normally dies.

The two literal toContain('cd commonly') / toContain('./install.sh') anchors are worth keeping alongside the derivation: they are the floor if the README and the component ever drift together in the same wrong direction, which the equality check alone would accept.

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 9d4b6b5 Sep 25, 2026
15 checks passed
lilyshen0722 added a commit to thantiklermcirony/commonly that referenced this pull request Oct 9, 2026
…m-Commonly#1868)

* feat(landing): copy control for the self-host command (TASK-154)

The command is 721px wide inside a 340px box at 390, so 37 of 86 characters
showed and `cd commonly && ./install.sh` was entirely off-screen — the half
that matters was unreachable on a phone.

- The horizontal scroll moves off the box onto an inner wrapper, so Copy is a
  sibling of the scroll region and stays visible at every width and scroll
  position.
- Copy writes SELF_HOST_COMMAND itself, never the rendered text (which carries
  the `$` and follows the truncation), so the copied string stays single-sourced
  with the README guard Team-Commonly#1866 added.
- The label swaps Copy -> Copied for 1.5s and a polite live region announces it;
  a denied clipboard selects the command instead of silently doing nothing.
- The pill is the BYO add-computer row's shape under this surface's own class;
  its height comes out of the box's padding so the line stays 46px, pinned with
  min-height, and at <=760 a transparent pseudo-element gives it a 44px thumb
  target without growing the visible pill.

* docs(landing): correct the rationale on the copy click, and measure which guard holds (TASK-154)

sprint-review's gate on Team-Commonly#1868 passed the code and corrected the reason given
for it: the comment claimed the button avoids the rendered text "which
carries the `$` and follows the truncation", but the ref is the <code>,
whose textContent is currently identical to the constant.

Measured, each in isolation, on top of ef7830b:

- swapping the write to `installCmdRef.current.textContent` keeps 5/5 green —
  the write test cannot tell the two strings apart today;
- moving the ref up one level to the scroll wrapper, which owns the `$`,
  reds exactly one test: "selects the command when the clipboard is
  unavailable, never a silent no-op", because the selection would then carry
  the prompt. (sprint-review's mutation moved the ref and the write together
  and saw two reds; this is which of the two does what.)

So the comment now says what is actually pinned — the ref's POSITION, not the
constant-vs-textContent choice — and warns the next reader that "simplifying"
to read the node is unguarded. Comment-only: no code, test or CSS line
changes, so both gates' objects are untouched.

* fix(landing): write the copy pill in the button reset's tier (TASK-154)

ux-lead's design gate failed Team-Commonly#1868 at ed89f0d, and the reason is the trap this
whole surface sits on: `.v2-root button:not(.MuiButtonBase-root)` (v2.css:201)
is (0,2,1) — one class, the :not() argument's class, and the element — and it
clears padding, border, background and colour on every button. The pill was
written as a bare `.v2-landing__install-copy` (0,1,0), so all four were erased
and Copy computed as bare text: 27x18, and a 27x44 target at 760.

Fixed the way .v2-byo__copy already is: qualified as `.v2-root button.`, on the
rule and on its :hover (which at (0,2,0) also lost to the (0,2,1) reset). A tie
then goes to sheet order, and the landing page is a lazy route, so its chunk's
CSS follows the shell's v2.css. ux-lead's scratch build of this shape measured
the pill at 49.1x28 (zh 46.5x28), the phone target at 47.1x44, and the box at
46px.

The guard was the other half of the miss: nothing in landingInstallCopy.test.tsx
read the pill's own declarations at all, so the sheet could lose them silently.
The new case compares the pill selector's specificity against the reset's, read
out of v2.css, rather than restating a number, and reads the declarations
THROUGH the qualified selector so a bare-class rule cannot pass it.
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