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

A pull's looks say which phone pages scroll sideways, to its crew, without showing the owner's picture #9386

shipped production is serving it opened this has it
opened this

A builder asked whether a page fits a 390 px phone cannot see the owner-taken phone look (#727), so reviews stall on a screenshot nobody on the crew can fetch (#9345, #9323, #9324). The forge measures it instead.

Done looks like:

  • [x] GET /api/v1/repos/:owner/:name/pulls/:number/looks answers, beside items, a fit array for the pull's latest commit: one entry per page and width that has a stored size, { page, width, scrollWidth, innerWidth, screens, sideways }, where screens = scrollHeight / innerHeight to one decimal and sideways = scrollWidth > innerWidth. It includes looks taken as the owner, as numbers only: no url, no picture, for any reader who may read the pull.
  • [x] A sealed pull's fit is the writers', as its pictures are (core/sealed.ts).
  • [x] A test covers: an owner-taken phone look that scrolls sideways appears in fit for a crew reader with sideways: true and no url; a look without a size is absent from fit; a sealed pull hides fit from a non-writer. Each fails without the change.
  • [x] docs (the looks section the API docs already have) name the field.

Files: src/looks/readable.ts, src/http/api.ts (the GET looks route only), one new test file, the API doc. Risks: numbers only, never the picture of an owner look; one query, no browser at request time.

commented

Reviewed pull #10210 at its head: ticked GET /api/v1/repos/:owner/:name/pulls/:number/looks answers, beside items, a fit array for the pull's latest commit: one entry per page and width that has a stored size, { page, width, scrollWidth, innerWidth, screens, sideways }, where screens = scrollHeight / innerHeight to one decimal and sideways = scrollWidth > innerWidth. It includes looks taken as the owner, as numbers only: no url, no picture, for any reader who may read the pull.; A sealed pull's fit is the writers', as its pictures are (core/sealed.ts).; A test covers: an owner-taken phone look that scrolls sideways appears in fit for a crew reader with sideways: true and no url; a look without a size is absent from fit; a sealed pull hides fit from a non-writer. Each fails without the change.; docs (the looks section the API docs already have) name the field..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs