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

The Apps card links each app to its page on the forge, and its production URL when it has one #5788

Merged opened this

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

Merged

The Apps card now links each app row to its page on the forge, and the `new_app` card's Production row links to its URL. `bun test test/card-shell.test.ts test/mcp.test.ts` passes and the type check is clean. I did not run the whole `bun test` suite, and I did not start the app to look at the card.

shipped production is serving it deploy d7f840c

opened this

The Apps card now links each app row to its page on the forge, and the new_app card's Production row links to its URL. bun test test/card-shell.test.ts test/mcp.test.ts passes and the type check is clean. I did not run the whole bun test suite, and I did not start the app to look at the card.

  • Apps card: a row whose app is owner/name gets link: <origin>/<owner>/<name>, but only when the origin is http(s). That is the same rule the Plan card uses. Rows that aren't a plain owner/name stay unlinked.
  • new_app card: the Production row links to its URL only when it starts with http:// or https://. Anything else stays plain text.
  • Tests: two new tests in test/card-shell.test.ts call cardFor("apps", …) and cardFor("new_app", …) with good and bad origins and URLs. The bad cases are javascript:, //host, an empty origin, and an app name like a/b/c, and none of them produce a link. I put them there rather than in test/mcp.test.ts because that file already holds the other cardFor card tests. I did not run them against the old code to see them fail.
  • Docs: the Cards paragraph in docs/MCP.md now says the Apps card links its rows and the new_app card links Production.

The change is in src/web/studio/cards.ts.

🤖 Generated with Claude Code

Closes #5749

commented

The Apps card now links each app row to its page on the forge, and the new_app card's Production row links to its URL. bun test test/card-shell.test.ts test/mcp.test.ts passes and the type check is clean. I did not run the whole bun test suite, and I did not start the app to look at the card.

  • Apps card: a row whose app is owner/name gets link: <origin>/<owner>/<name>, but only when the origin is http(s). That is the same rule the Plan card uses. Rows that aren't a plain owner/name stay unlinked.
  • new_app card: the Production row links to its URL only when it starts with http:// or https://. Anything else stays plain text.
  • Tests: two new tests in test/card-shell.test.ts call cardFor("apps", …) and cardFor("new_app", …) with good and bad origins and URLs. The bad cases are javascript:, //host, an empty origin, and an app name like a/b/c, and none of them produce a link. I put them there rather than in test/mcp.test.ts because that file already holds the other cardFor card tests. I did not run them against the old code to see them fail.
  • Docs: the Cards paragraph in docs/MCP.md now says the Apps card links its rows and the new_app card links Production.

The change is in src/web/studio/cards.ts.

🤖 Generated with Claude Code

Changes requested — before the latest push

The title promises two links on the Apps card: the app's forge page, and its production URL when it has one. Only the first exists. In the apps branch the row's url is still plain text inside value; only new_app links its URL. A person who taps the Apps card cannot reach the running app, which is the point of the issue. Fix first: add a second row (or a linked row, e.g. label Production / owner/name) with link: a.url when /^https?:\/\//.test(url), plus a test for a javascript: url staying unlinked. Smaller points: reuse the existing http(s) helper instead of a third inline regex (the web const is scoped to the pull branch, so hoist it); the MCP.md sentence is one very long line spliced into the middle of the Plan card sentence, so give it its own paragraph and say what it truly does once the production link lands.

commented

The Apps card now links an app's production URL as well as its forge page. The type check is clean, and test/card-shell.test.ts and test/mcp.test.ts pass (51 tests). I didn't run the whole suite.

  • Apps card: when an app has an http(s) url, a second row follows its forge-page row, labelled <owner/name> production, with link set to that URL. A url that isn't http(s) stays as plain text in the app row's value, as before. The one change to existing behaviour: a URL that gets its own row is no longer repeated in the app row's value.
  • Helper: web is now hoisted to module level in src/web/studio/cards.ts. The apps rows, the new_app card and the pull card all use it, so there is no third inline regex.
  • Tests:

- A new test in test/card-shell.test.ts covers the production row. A good URL links, and a javascript: URL adds no row and no link. A //host URL never becomes a link. - I didn't run the new test against the old code to confirm it fails there.

  • Docs: the docs/MCP.md sentence is now its own paragraph after the Plan card text. It describes both links and says non-http(s) addresses stay plain text.

I used a separate row rather than a linked label because each row has only one link, and the label already links to the forge page.

Changes requested — before the latest push

The behaviour is right: links are gated on http(s), the app name must be owner/name, and no new dependency. Two cleanliness misses to fix first. (1) The apps loop in cards.ts has a hand-placed { on its own line after for (...), unlike the rest of the file. (2) One test assertion can never fail. The docs paragraph also ends with a run-on line. I did not exercise the card in the preview: it is an MCP card, not a page, so there is no HTML to curl.

commented

I made the three fixes from the review and pushed them to the branch. test/card-shell.test.ts and test/mcp.test.ts pass (51 tests) and the type check is clean. I didn't run the whole suite.

  • Brace: in src/web/studio/cards.ts, the apps loop now opens with for (...) { on one line, like the rest of the file.
  • Test: the //evil.example assertion in test/card-shell.test.ts is now exact. The card must have exactly one row. No row may link to //evil.example. The address must still appear in the row's text.
  • Docs: in docs/MCP.md, resources/list and resources/read… now starts on its own line instead of running on from the new paragraph.

I did not check that the card draws correctly in a host.

🤖 Generated with Claude Code

Approved

Approved. The Apps card links each owner/name row to its forge page and adds a linked production row for http(s) URLs. new_app links Production the same way. Links only form for an http(s) origin and a plain owner/name, and javascript: and //host stay plain text, with tests for each. The web helper is hoisted and reused, and docs/MCP.md is updated. The preview answers 200. Next: (1) run the new tests against the old code once to confirm they fail there; (2) pass the Plan card onto the same shared owner/name check so the slug regex is not repeated three times.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs