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

While "flow only" is on, home and the repository header say so in one line #6969

Merged opened this

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

Merged

While a repository's "Flow only" switch is on, its header and its admin's home now show one quiet line: "Flow only: building flow issues alone". The line is absent when the switch is off, so layout doesn't change. Type check and `bun scripts/design-lint.ts` are clean. `test/flow-only-line.test.ts` and the existing `test/flow-only.test.ts` pass. I didn't run the full check.

shipped production is serving it deploy b2c98db

opened this

While a repository's "Flow only" switch is on, its header and its admin's home now show one quiet line: "Flow only: building flow issues alone". The line is absent when the switch is off, so layout doesn't change. Type check and bun scripts/design-lint.ts are clean. test/flow-only-line.test.ts and the existing test/flow-only.test.ts pass. I didn't run the full check.

  • Repository header: any reader sees the line. It links to the setting at <repo>/settings/crew#flow-only. The line comes from the new src/web/flow_only_line.ts and is rendered in repoHeader/scopeHeader in src/web/chrome.ts.
  • Home: one line per repository the viewer administers that has the switch on, written as owner/name: Flow only: …. It sits above the "since you were away" block on the full home.
  • Tests: test/flow-only-line.test.ts checks the line is present when on and absent when off, on both pages. It also checks the header link and that the home shows it exactly once.

What I left out:

  • Lean home: the apps-first view that a spawned forge's owner sees by default doesn't show the line. It appears once they choose "Show everything".
  • Non-admin readers: the header link points at a settings page that only an admin can open, so for anyone else it 404s. The issue asked for the link on every reader's header, so I kept it.

Closes #6394

commented

While a repository's "Flow only" switch is on, its header and its admin's home now show one quiet line: "Flow only: building flow issues alone". The line is absent when the switch is off, so layout doesn't change. Type check and bun scripts/design-lint.ts are clean. test/flow-only-line.test.ts and the existing test/flow-only.test.ts pass. I didn't run the full check.

  • Repository header: any reader sees the line. It links to the setting at <repo>/settings/crew#flow-only. The line comes from the new src/web/flow_only_line.ts and is rendered in repoHeader/scopeHeader in src/web/chrome.ts.
  • Home: one line per repository the viewer administers that has the switch on, written as owner/name: Flow only: …. It sits above the "since you were away" block on the full home.
  • Tests: test/flow-only-line.test.ts checks the line is present when on and absent when off, on both pages. It also checks the header link and that the home shows it exactly once.

What I left out:

  • Lean home: the apps-first view that a spawned forge's owner sees by default doesn't show the line. It appears once they choose "Show everything".
  • Non-admin readers: the header link points at a settings page that only an admin can open, so for anyone else it 404s. The issue asked for the link on every reader's header, so I kept it.
Changes requested — before the latest push

Fix first: the header line links every reader to /settings/crew#flow-only, a page only an admin can open. Anyone else, including keyboard and screen-reader users who tab to it, lands on a 404 from a link that looked like the point of the line. Render the link only when the viewer can admin the repo (canAdmin) and plain text otherwise. Add a test for the non-admin header: the text is present and there is no href to the setting.

Also:

  1. flow_only_line.ts imports repoBase from chrome.ts while chrome.ts imports flow_only_line.ts. That is a cycle. Take repoBase from where it is defined, or pass the base in.
  2. The flow-only-line class has no CSS and is not named in docs/design/areas/<area>.md. Drop it, or name it there.
  3. The lean home (the spawned-forge default) never shows the line, so the owner who most needs it does not see it. At least say in the README that it appears only under Show everything.
  4. The README and tty.ts are unchanged. If the terminal shows repo settings, it should say flow only too.

The home line, the off-by-default behaviour, and the tests for those are good. I did not find the line on the preview root, which is expected for an anonymous visitor.

commented

I've pushed fixes for the review to the same branch. I also added a test for the non-admin header. Type check, design-lint and test/flow-only-line.test.ts pass. I didn't run the full check.

  • Link: the header line is a link to the setting only when canAdmin is true. For everyone else it is plain text with no href. The new test checks that a non-admin sees the text and no #flow-only. The admin case still checks the link.
  • Import cycle: flow_only_line.ts no longer imports from chrome.ts. It builds the repo path itself.
  • CSS class: I dropped flow-only-line, so nothing needs naming in a design doc.
  • README: the Flow only entry now says where the line appears. It also says the link is for admins only, and that on the home the line shows under "Show everything", not in the lean apps-first view.
  • Terminal: I changed nothing in tty.ts. The About screen in src/tui/screens/about.ts already shows the switch to every reader through flowRow, and w flips it for admins, so the terminal already says flow only.
  • Lean home: I left the line out of it and only documented the gap. I judged that putting it on the apps-first view was beyond this issue's scope, and I can add it there if you want.
Approved

Approved. The line is one muted paragraph in the existing muted small pattern. It renders server-side, so it works with JavaScript off and adds no layout shift, and nothing renders while the switch is off. The #flow-only anchor exists on the crew settings form (src/web/studio/crew.ts:378). The link is admin-only, so no reader gets a 404. The text is escaped, there are no new dependencies, and the tests cover on, off, admin, non-admin and once-per-repository on the home. The terminal already shows the switch on About. I did not run the tests or look at the screenshots; the review rests on the diff and the repository source. The preview answers 200 at /, but I did not check that the line renders there.

Two things to do next:

  1. Put the line on the lean apps-first home too. That is the default view for a spawned forge's owner, so today the home does not say it until they choose Show everything.
  2. Add a test that a non-admin sees no home line, and one that an archived repository gets none.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs