Public: anyone can read this; the crew can change it.

A repository's page says 'Make it yours' once, as one action that forks it, for a visitor who is signed in #14545

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

An app's page now has one "Make it yours" button, which forks the app into the visitor's account. The new test file and the related make-it-yours, MCP-size and guest suites pass (73 tests), as do bun x tsc --noEmit, the gate and design-lint. I did not run the full suite.

Notes

shipped production is serving it deploy 8e4256e

opened this

An app's page now has one "Make it yours" button, which forks the app into the visitor's account. The new test file and the related make-it-yours, MCP-size and guest suites pass (73 tests), as do bun x tsc --noEmit, the gate and design-lint. I did not run the full suite. I did not take a before/after look at the page.

What changed

  • Signed in: the button on a public app's page is now a POST to the existing make-it-yours route (src/web/studio/yours_button.ts, used from previews.ts). That route already checks same-origin and forks the app. It lands on the copy with the receipt line. Previously the button was a link to a preview page.
  • Signed out: the button leads through sign-in and back to the same page.
  • Already forked: a visitor who has a copy sees "Open your copy" instead.
  • Private app: no button.
  • Guests: someone who isn't a member yet keeps the existing "Help build this" door.
  • Receipt wording: the receipt line now comes from receiptWords, the same function the MCP make_it_yours tool uses, so the page and the MCP say the same thing.
  • Docs: docs/features/make-it-yours.md has a short note on the button.
  • Tests: test/make-it-yours-button.test.ts covers signed-out, signed-in then open-your-copy, private app, and a cross-origin refusal.

What I reused and left out

  • I extended the existing route, the MCP tool and the terminal screen; nothing was duplicated, and the /explore cards are untouched.
  • The repository page's plain "Fork" and "Forge it" buttons are unchanged.
  • I added no MCP action: the existing make_it_yours tool already has the same words, so mcp-size stays green.

Try it: open a public app's page as another account and press "Make it yours". Then reload: it reads "Open your copy".

Commit lines carry Looks: /explore (no page in app.looks shows an app's own head), No door: (the terminal screen already exists) and a Try: line.

Closes #14523

15 earlier comments · 2 events
commented

An app's page now has one "Make it yours" button, which forks the app into the visitor's account. The new test file and the related make-it-yours, MCP-size and guest suites pass (73 tests), as do bun x tsc --noEmit, the gate and design-lint. I did not run the full suite. I did not take a before/after look at the page.

What changed

  • Signed in: the button on a public app's page is now a POST to the existing make-it-yours route (src/web/studio/yours_button.ts, used from previews.ts). That route already checks same-origin and forks the app. It lands on the copy with the receipt line. Previously the button was a link to a preview page.
  • Signed out: the button leads through sign-in and back to the same page.
  • Already forked: a visitor who has a copy sees "Open your copy" instead.
  • Private app: no button.
  • Guests: someone who isn't a member yet keeps the existing "Help build this" door.
  • Receipt wording: the receipt line now comes from receiptWords, the same function the MCP make_it_yours tool uses, so the page and the MCP say the same thing.
  • Docs: docs/features/make-it-yours.md has a short note on the button.
  • Tests: test/make-it-yours-button.test.ts covers signed-out, signed-in then open-your-copy, private app, and a cross-origin refusal.

What I reused and left out

  • I extended the existing route, the MCP tool and the terminal screen; nothing was duplicated, and the /explore cards are untouched.
  • The repository page's plain "Fork" and "Forge it" buttons are unchanged.
  • I added no MCP action: the existing make_it_yours tool already has the same words, so mcp-size stays green.

Try it: open a public app's page as another account and press "Make it yours". Then reload: it reads "Open your copy".

Commit lines carry Looks: /explore (no page in app.looks shows an app's own head), No door: (the terminal screen already exists) and a Try: line.

commented

<!-- look-pages 1ac0577c35bb --> Look pages for 1ac0577, from the gate:

  • look pages (named): this pull changes src/web/studio/make_it_yours.ts, src/web/studio/previews.ts, src/web/studio/yours_button.ts; a commit names /explore
commented

The gate's "pipeline first" rule failed because the pull adds a feature (src/web/studio/yours_button.ts) and changes nothing in the pipeline. I added an empty commit with a Direction: line naming #14523, which is the escape the rule offers. bun scripts/gate.ts now exits 0 and the push went through.

The line says the Make it yours button is the owner-requested fork path and goes ahead of pipeline items.

The code is unchanged since the failing push. I ran only the gate, not tsc or the tests, so the forge's check on this push is the first run of those against the new commit.

commented

There is nothing to change in the code for that comment. The look pages (named) line is a gate note about which pages the pull's looks cover, not a failure. src/checks/look_count.ts only counts it in a daily tally, and bun scripts/gate.ts exits 0 with it.

The comment was posted against 1ac0577. The branch has since gained 25a8e71, the empty Direction: commit that cleared the "pipeline first" failure. Nothing is left unpushed, so I did not push again.

I did not read the pull's own commit messages to confirm what the note means by "a commit names /explore". If you want those looks to cover a different page, say which and I'll change the commit that names it.

commented

<!-- look-pages 25a8e71bb167 --> Look pages for 25a8e71, from the gate:

  • look pages (named): this pull changes src/web/studio/make_it_yours.ts, src/web/studio/previews.ts, src/web/studio/yours_button.ts; a commit names /explore
commented

This is the same gate note as last time, now posted against 25a8e71. It is not a failure, so I changed nothing and pushed nothing.

The gate notes that the pull changes src/web/studio/make_it_yours.ts, previews.ts and yours_button.ts. It also notes that a commit names /explore, so the looks for this pull will cover /explore. It records that as "named" instead of inferring pages from the changed files. bun scripts/gate.ts exits 0 with the note.

If /explore is the wrong page to look at, tell me which page is right. I would then name it in a commit message.

Changes requested — before the latest push

The button works in the four states and reuses the existing route, but one test proves nothing and one page rule is unchecked. Fix first: the private-app test. Then: (1) the signed-out button is variant primary; confirm only one accent action appears on the app page, since the Open app / Look buttons sit beside it (principle 5). (2) No test for the guest HELP_BUILD branch or for a non-public app access; add one each. (3) Box 3 asks for a fork action on the repository tool; the pull relies on the existing make_it_yours tool. State that in the docs so the words match. (4) Check the signed-out return lands back on the app page after sign-in.

commented

All four review points are addressed in this push. The new tests, tsc and design-lint pass; I ran only the one test file, not the wider suite.

  • Private-app test: the old test passed vacuously because bob got a not-found page. It is replaced by two tests:
    • A public repository whose app access is set to private is rendered for bob. The page loads, and it has no button and no fork form.
    • A private repository stays a separate not-found check.
  • Principle 5: Make it yours is now secondary in every state, including the signed-out one. Open the app is the page's one primary button. A test checks that the control is not primary, signed out and signed in.
  • Guest and non-public access: I added one test for each. The guest test asserts no fork form and no Open your copy.
  • Docs: docs/features/make-it-yours.md now says the existing make_it_yours tool is the fork action for the repository tool, and that Make it yours is never the page's primary button.
  • Signed-out return: the existing test asserts the link is /signin?next=%2Falice%2Fgarden. A new test fetches that sign-in page and checks it carries the next value. I did not drive a full login and redirect.

Two things to know:

  • A guest also sees the existing "Help build this" section further down. Its Fork and send a pull button is primary, and I left it alone. If you count that against principle 5, say so and I'll look at it.
  • The guest test's "no fork form" assertion does not prove the button's own guest branch rendered, because the contribute section links to the same make-it-yours URL. That gap is left as is.
[
  {"go":"/alice/garden (signed out)","look":"the row beside Open the app","expect":"Make it yours is a plain button; Open the app is the only accent; it leads to /signin?next=%2Falice%2Fgarden"},
  {"go":"/alice/garden (signed in, no copy)","look":"Make it yours","expect":"posts and lands on your copy; the page then shows Open your copy"},
  {"go":"a public repository whose app access is private, as a visitor who can see it","look":"the head row","expect":"no Make it yours"}
]
commented

<!-- look-pages f0e4612b3397 --> Look pages for f0e4612, from the gate:

  • look pages (named): this pull changes src/web/studio/make_it_yours.ts, src/web/studio/previews.ts, src/web/studio/yours_button.ts; a commit names /explore
commented

An app's page now carries a single "Make it yours" button, in four states. Signed out, it links through sign-in and back. Signed in, it is a POST that forks the app. "Open your copy" replaces it once you have a fork. A private app shows nothing. A guest who isn't yet a member still gets the help-build link. The button is secondary, so "Open the app" stays the page's one accent. The button's code is in src/web/studio/yours_button.ts, with tests in test/make-it-yours-button.test.ts.

The one failure this pull caused was counts.test.ts ("an issue listing costs the same for 5 rows as for 50"). My change doesn't touch the issues API, and the test passed in 3 of 4 local runs, so it was flaky. The cold first request ran one-off statements that the 5-row count included and the 50-row count didn't. I added a throwaway warm-up read before the measured 5-row read. It then passed 5 of 5 local runs, and tsc is clean.

The other six failures (outbound sweep, both page budgets, the <time> check, fetch timeouts, the llms.txt budget) are red on main at 08ee03a too, and the forge did not count them against this pull. I did not touch them.

To try it, open a public app's page signed in as someone other than its owner and press "Make it yours".

[
  {"go": "A public app's page, signed out", "look": "Make it yours beside Open the app", "expect": "It links to sign-in and returns to the page; Open the app is the only accent"},
  {"go": "The same page, signed in as a non-owner who is a member", "look": "Press Make it yours", "expect": "A fork is created and the page shows a receipt; the button then reads Open your copy"},
  {"go": "A private app's page", "look": "The action row", "expect": "No Make it yours"}
]
commented

No code change is needed for this feedback. The look-pages note reports what the gate did: this pull touches three src/web/studio/ files, so it took screenshots of the pages they render. It also found /explore named in a commit and looked there too. It isn't a failure or a request, so I changed nothing and pushed nothing.

The pages to check are the same as before.

[
  {"go": "A public app's page, signed out", "look": "Make it yours beside Open the app", "expect": "It links to sign-in and returns to the page; Open the app is the only accent"},
  {"go": "The same page, signed in as a non-owner who is a member", "look": "Press Make it yours", "expect": "A fork is created and the page shows a receipt; the button then reads Open your copy"},
  {"go": "A private app's page", "look": "The action row", "expect": "No Make it yours"}
]

If you wanted something specific on /explore, tell me what. This pull doesn't touch that page.

commented

I merged main into the branch and pushed it. The only conflict was in test/counts.test.ts.

main had fixed the same flaky "5 rows as for 50" test its own way, with a fewestStatements helper. I kept that and dropped the warm-up read I had added, so the test is now exactly as main has it.

bun x tsc --noEmit is clean, and counts.test.ts and make-it-yours-button.test.ts pass (15 tests). I did not run the rest of the suite locally; the forge's check runs it on this push.

The pull itself is unchanged: one "Make it yours" on an app's page, which forks it when you're signed in, as described in the earlier description.

commented

<!-- look-pages da49da11a934 --> Look pages for da49da1, from the gate:

  • look pages (named): this pull changes src/web/studio/make_it_yours.ts, src/web/studio/previews.ts, src/web/studio/yours_button.ts; a commit names /explore
commented

Nothing to change here either. This is the same gate note as before, now for da49da1 after the merge. It says which pages the gate screenshotted (what the three src/web/studio/ files render, plus /explore, which a commit names). It asks for no change, so I pushed nothing.

The pull is as described earlier. One "Make it yours" on an app's page forks it for a signed-in visitor, and the merge with main changed only test/counts.test.ts, where I kept main's fewestStatements.

[
  {"go": "A public app's page, signed out", "look": "Make it yours beside Open the app", "expect": "It links to sign-in and returns to the page; Open the app is the only accent"},
  {"go": "The same page, signed in as a non-owner who is a member", "look": "Press Make it yours", "expect": "A fork is created and the page shows a receipt; the button then reads Open your copy"},
  {"go": "A private app's page", "look": "The action row", "expect": "No Make it yours"}
]

If you want something specific changed on /explore, tell me what. This pull doesn't touch that page.

Changes requested — before the latest push

One change to make: yoursButton runs its own SQL (SELECT id FROM repo WHERE owner_id = ?1 AND fork_parent_id = ?2) and then calls getRepoById. getForkOf(db, ownerId, parentId) in src/core/repos.ts already does exactly that. Box 5 says 'do not duplicate' an existing route. Use getForkOf and drop the raw query and the getRepoById import.

Security and the same-origin POST reuse of makeItYoursSubmit are fine. Receipt wording is shared with the MCP tool and the terminal through receiptWords. The how-to is in docs/features, not README. Nits, not blocking: the test file uses as any on createUser; the guest test cannot tell the button's guest branch from the contribute section, which links to the same URL.

Box 3: the pull states that the existing make_it_yours tool is the fork action, and the receipt words are shared. This is acceptable. Boxes 1-4 are met; box 5 is left only for the duplicated fork lookup.

commented

An app's page now shows "Make it yours" once (#14523). When the visitor is signed in, it is one form that posts to the existing makeItYoursSubmit, which checks the request's origin and forks the app. When signed out, it links to sign-in and back. Once the visitor has a copy it reads "Open your copy". A guest who isn't yet a member still sees "Help build this". A private app shows nothing. It is never the primary button: "Open the app" stays the page's one accent. The receipt wording is shared with the make_it_yours tool through receiptWords, and the how-to is in docs/features/make-it-yours.md.

Review changes made:

  • Fork lookup: src/web/studio/yours_button.ts now calls getForkOf(db, user.id, repo.id) from src/core/repos.ts. Its own SQL query and the getRepoById import are gone.
  • as any: test/make-it-yours-button.test.ts no longer uses it on createUser. The cast was hiding a wrong field: first is not part of CreateUserInput, so it is now adminIfFirst: first.
  • Guest test: it now checks only the action row at the top of the app's page (#app-head). That is where the button must link to /make-it-yours and read "Help build this". The contribute section's link to the same URL can no longer make the test pass on its own.

The type check, the 8 tests in that file, the design lint and scripts/gate.ts --fix all pass. The gate also points out that the test's user helper looks like one in test/tui-migrate.test.ts. I left that alone: they are two small test fixtures.

An earlier push dropped this pull's warm-up read in test/counts.test.ts when merging main, and kept main's fewestStatements instead. The other red tests from the first check also fail on main at 08ee03a, and this pull doesn't touch them.

To try it, open a public app's page signed in as someone other than its owner and press "Make it yours".

[
  {"go": "A public app's page, signed out", "look": "Make it yours beside Open the app", "expect": "It links to sign-in and returns to the page; Open the app is the only accent"},
  {"go": "The same page, signed in as a non-owner who is a member", "look": "Press Make it yours", "expect": "A fork is created and the page shows a receipt; the button then reads Open your copy"},
  {"go": "The same page, signed in as a guest", "look": "The action row at the top", "expect": "Help build this, linking to the make-it-yours page, not a fork post"},
  {"go": "A private app's page", "look": "The action row", "expect": "No Make it yours"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 576b8ea01f75 --> Look pages for 576b8ea, from the gate:

  • look pages (named): this pull changes src/web/studio/make_it_yours.ts, src/web/studio/previews.ts, src/web/studio/yours_button.ts; a commit names /explore
commented

An app's page now has one "Make it yours" button. It forks the app for a signed-in visitor (#14523).

  • Signed in: a POST to the existing make-it-yours route, which checks same-origin and forks the app. It lands on the copy with the receipt line.
  • Signed out: a link through sign-in that comes back to the same page.
  • Already forked: the button reads "Open your copy".
  • Private app, or app access set to private: no button.
  • Guest who isn't a member yet: keeps the "Help build this" door.

The button is never the page's primary: "Open the app" stays the one accent. The fork lookup is getForkOf. The receipt words come from receiptWords, shared with the MCP make_it_yours tool. The code is in src/web/studio/yours_button.ts, used from previews.ts. The tests are in test/make-it-yours-button.test.ts.

Latest push, for the repeated look-pages note: the earlier Looks: /explore named a page this pull doesn't change, so the looks were picturing the wrong page. No page the looks can take shows the button. They take the app page (/preview-admin/hello) only as its owner, and the owner sees no button. Adding a signed-out look there isn't allowed either: app.looks is at its 32-path cap, and its paths below the top level must be taken as the owner. The forge's looks tests fail if either rule is broken, so I reverted that try. Instead, an empty commit carries a No look: line that says why and points the reviewer at /preview-admin/hello signed out on the preview. Fetched signed out, that page answers 200 with "Make it yours" beside "Open the app" and a signin?next=%2Fpreview-admin%2Fhello link. No code changed in this push.

Checks: bun scripts/gate.ts exits 0. test/forge-looks.test.ts, test/looks-owner.test.ts and test/looks.test.ts pass, apart from one test that needs a real chromium capture, which this sandbox can't run. I didn't rerun tsc or the button tests, since this push only adds an empty commit. Their last run, on the previous push, passed.

Left out: the /explore cards and the plain "Fork" and "Forge it" buttons are unchanged, and there's no new MCP action.

[
  {"go": "/preview-admin/hello, signed out", "look": "Make it yours beside Open the app", "expect": "It links to sign-in and returns to the page; Open the app is the only accent"},
  {"go": "A public app's page, signed in as a non-owner who is a member", "look": "Press Make it yours", "expect": "A fork is created and the page shows a receipt; the button then reads Open your copy"},
  {"go": "A private app's page", "look": "The action row", "expect": "No Make it yours"}
]

Closes #14523

🤖 Generated with Claude Code

Approved

All three earlier asks are met. The fork lookup now uses getForkOf, with no raw SQL and no getRepoById import. The as any cast on createUser is gone. The guest test is scoped to #app-head, so the contribute section's link can no longer satisfy it. The button is a POST form that reuses makeItYoursSubmit, so it is same-origin checked. Signed out it is an <a> through sign-in and back. It is never primary, so principle 5 holds. The receipt words are shared through receiptWords. The how-to is in docs/features and README is untouched. The terminal screen already exists.

Next, in order:

  1. Non-blocking: the looks cannot picture the signed-out button, so add a signed-out look of an app page when the app.looks cap allows.
  2. Non-blocking: the guest branch is still asserted only through the head row. Add a test that signs in a guest and checks the button's own href and text.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs