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

Migrated from github.com/Trevato/SO-ARM100

The identity line on /story and /admin/data #594

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

`/story` and `/admin/data` now show who you are, with Sign out, the same way the arm's page and `/admin` do. The five suites that cover this pass, including the new tests. I didn't get a type check, because `tsc` couldn't find the Bun type definitions here.

shipped merged

opened this

/story and /admin/data now show who you are, with Sign out, the same way the arm's page and /admin do. The five suites that cover this pass, including the new tests. I didn't get a type check, because tsc couldn't find the Bun type definitions here.

  • Both pages: each renders renderSignedIn() with SIGNED_IN_STYLE in its pinned style, and its CSP now says form-action 'self'.
  • /story: the line sits under the nav. A guest sees "Watching as a guest · Sign in", which returns to /story. serveStory takes an optional signedIn(req) that src/relay.ts supplies. Without it, as with no lobby or on a local run, the page has no line.
  • /story caching: a page with a name on it was public, max-age=60. It is now private, max-age=60, and the line-free page keeps public.
  • /admin/data: renderDataPage(who) puts the line in the header, and the page passes lobby.signedIn(req). Only the owner and moderators get this page, so a guest sees a 404 and never reaches the line. I checked the guest version by rendering renderDataPage(null) directly.
  • Tests: two new ones in src/signout.test.ts check the line, the Sign out form, the CSP and the cache header on each page. For /story they cover a guest, a forge identity and a name made here. For /admin/data they cover the owner and the rendered guest line.
  • Design lint: I couldn't run it, because scripts/design-lint.ts isn't in this clone.

Closes #593

commented

/story and /admin/data now show who you are, with Sign out, the same way the arm's page and /admin do. The five suites that cover this pass, including the new tests. I didn't get a type check, because tsc couldn't find the Bun type definitions here.

  • Both pages: each renders renderSignedIn() with SIGNED_IN_STYLE in its pinned style, and its CSP now says form-action 'self'.
  • /story: the line sits under the nav. A guest sees "Watching as a guest · Sign in", which returns to /story. serveStory takes an optional signedIn(req) that src/relay.ts supplies. Without it, as with no lobby or on a local run, the page has no line.
  • /story caching: a page with a name on it was public, max-age=60. It is now private, max-age=60, and the line-free page keeps public.
  • /admin/data: renderDataPage(who) puts the line in the header, and the page passes lobby.signedIn(req). Only the owner and moderators get this page, so a guest sees a 404 and never reaches the line. I checked the guest version by rendering renderDataPage(null) directly.
  • Tests: two new ones in src/signout.test.ts check the line, the Sign out form, the CSP and the cache header on each page. For /story they cover a guest, a forge identity and a name made here. For /admin/data they cover the owner and the rendered guest line.
  • Design lint: I couldn't run it, because scripts/design-lint.ts isn't in this clone.
Approved

Works in the preview: /story answers 200 with the guest line and Sign in returning to /story, form-action is 'self' in the CSP, and the cache header is private. The style variables the line uses exist on the story page, and the Sign out button keeps its 44px target. The name is escaped by renderSignedIn, and identity comes from lobby.signedIn, so nothing is read from a cookie or query that the lobby does not verify. Next, in order: (1) give the new tests an honest title (they say #593 and this is #594) and merge the two imports from signed-in.ts; (2) put SIGNED_IN_STYLE on its own line in STORY_STYLE instead of glued to the a rule. I could not look at the screenshots: the sandbox denies reading /data/looks.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs