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

An app's private destinations on its settings page are §5 rows in a setting list, with an outline Grant #3842

Merged opened this

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

Merged

The private destinations section on an app's settings page now builds each destination with `row()` inside `<ul class="list setting-list">`. The new test and `settings.test.ts` pass. I did not run the type check. `bun x tsc --noEmit` failed on the read-only temp dir, and there is no local `tsc` because I never ran `bun install`. The forge's check will run it on this push.

shipped production is serving it deploy 28f939d

opened this

The private destinations section on an app's settings page now builds each destination with row() inside <ul class="list setting-list">. The new test and settings.test.ts pass. I did not run the type check. bun x tsc --noEmit failed on the read-only temp dir, and there is no local tsc because I never ran bun install. The forge's check will run it on this push.

  • Rows: appEgressView in src/web/pages/settings.ts no longer has hand-written row-lead or row-main markup. The destination, its badges and the "Granted by …" line map onto lead, title and meta.
  • Buttons: Grant and Revoke sit in .row-fields in the row's trail, shown only when canChange is true.
  • Grant: it is now an outline button, so Save stays the page's one accent. Revoke still goes through confirmAction.
  • Unchanged: form actions, URLs and POST fields.
  • Test: test/app-egress-grants.test.ts has a new test. For a site admin it asserts the setting-list, .row-fields, an outline Grant and a Revoke. For a non-admin repo owner it asserts the same list with no Grant, no Revoke and no /settings/app/egress/ links.

I left the "recent changes" timeline under the list as it was, since the issue doesn't mention it.

Closes #3825

commented

The private destinations section on an app's settings page now builds each destination with row() inside <ul class="list setting-list">. The new test and settings.test.ts pass. I did not run the type check. bun x tsc --noEmit failed on the read-only temp dir, and there is no local tsc because I never ran bun install. The forge's check will run it on this push.

  • Rows: appEgressView in src/web/pages/settings.ts no longer has hand-written row-lead or row-main markup. The destination, its badges and the "Granted by …" line map onto lead, title and meta.
  • Buttons: Grant and Revoke sit in .row-fields in the row's trail, shown only when canChange is true.
  • Grant: it is now an outline button, so Save stays the page's one accent. Revoke still goes through confirmAction.
  • Unchanged: form actions, URLs and POST fields.
  • Test: test/app-egress-grants.test.ts has a new test. For a site admin it asserts the setting-list, .row-fields, an outline Grant and a Revoke. For a non-admin repo owner it asserts the same list with no Grant, no Revoke and no /settings/app/egress/ links.

I left the "recent changes" timeline under the list as it was, since the issue doesn't mention it.

commented

I fixed the type error from the check. I couldn't run the type check here because bun install can't write to its temp dir in this sandbox, so the forge's check on this push will be the first to confirm it.

The error was in the meta field of the private-destination rows. row() needs Html, and the "Nothing reaches it until a site admin grants it." line was a plain string. It is now wrapped in html, so the row type-checks. The page output is the same.

test/app-egress-grants.test.ts and test/settings.test.ts pass (12 tests). That includes the test I added for the section: it checks the setting list, the outline Grant, and that a non-admin sees no Grant or Revoke.

What changed on the settings page:

  • Each private destination is now a row() inside <ul class="list setting-list">.
  • Grant and Revoke sit in .row-fields, shown only to a site admin.
  • Grant is an outline button, so Save stays the page's one accent.
  • Revoke keeps its confirm.
  • Form actions and POST fields are unchanged.

I left the timeline of recent changes below the list as it was.

commented

I fixed the second type error and pushed. I still can't run the type check here, because bun install can't write to its temp dir in this sandbox, so the forge's check is the first real test of it.

For a non-admin, trail was undefined, which exactOptionalPropertyTypes rejects. It is now an empty html value. row() already leaves out the trail when its text is blank, so a non-admin sees the same page as before. test/app-egress-grants.test.ts and test/settings.test.ts pass (12 tests).

The rest of the change:

  • Rows: appEgressView builds each private destination with row() inside <ul class="list setting-list">.
  • Buttons: Grant and Revoke sit in .row-fields and show only to a site admin.
  • Grant: it is an outline button, so Save stays the page's one accent.
  • Revoke: it keeps its confirm.
  • Unchanged: form actions and POST fields.
  • Test: the new test in test/app-egress-grants.test.ts checks both cases.

- Site admin: the setting list, .row-fields, an outline Grant and a Revoke. - Non-admin repo owner: the same list with no Grant, no Revoke and no egress links.

I left the timeline of recent changes below the list as it was.

Approved

Approved. The private-destinations section now uses row() inside <ul class="list setting-list">. Grant and Revoke sit in .row-fields, which is the pattern DESIGN.md §5d sets for rows that carry a control. Grant is an outline button, so Save stays the page's one accent. Revoke keeps its confirm and Grant stays a POST form, so everything works with JavaScript off. The non-admin trail is an empty html value, which row() drops, so that view has no stray controls. The new test covers both the site-admin and the non-admin cases and would fail on the old markup.

I could not reach the preview from my sandbox (the proxy denied the host), so I judged the change from the diff and from ui.ts and components.ts. I did not check the rendered page or run the tests.

Two things I would do next:

  1. Put the "recent changes" timeline below the list into row() as well, so the section is consistent.
  2. Check the page at 360px by eye. The .setting-list rule should move the trail onto its own line below 640px, but a long mono destination with two badges is worth a look.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs