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

Each row of /apps?archived=1 has a Wake button for its admin, and waking keeps you on the list #6119

opened this

Merged 37d 9h ago, live in production

Each row on /apps?archived=1 that the viewer administers now has a small Wake form. Posting it wakes the app and returns to /apps?archived=1. The new tests and the archive and apps suites pass.

Notes

opened this

Each row on /apps?archived=1 that the viewer administers now has a small Wake form. Posting it wakes the app and returns to /apps?archived=1. The new tests and the archive and apps suites pass. The type check could not run here (the bun types aren't installed, and tsc reported nothing else for the files I changed), so the forge's check is the first real run of it. design-lint printed "no colour, size or component added outside the system".

  • Wake form: it posts archived=0 to the existing /:owner/:name/settings/archive. That endpoint takes 0 or 1, not false, so I kept its format. Rows the viewer can't administer get no form. The form hangs under the row, wired through a new optional under read in src/web/studio/shelf.ts and built by wakeForms in src/web/pages/apps.ts.
  • Return address: the archive handler in src/web/pages/settings.ts now reads the to field. to=repo still goes to the repo page. Any other value is used only if it parses as a path on the same origin. Anything else (https://…, //host, a backslash, control characters) falls back to the repo's settings page, as before.
  • Cross-origin posts: the server's existing same-origin check still refuses them, and a test confirms the app stays archived.
  • Tests: in test/apps-archived.test.ts, one test wakes an archived app from the list. It checks the redirect lands on /apps?archived=1, the app is gone from the archived view and back on /apps, a cross-origin post is refused, and the bad return addresses fall back. A second test checks a viewer who doesn't administer the app (signed out) sees the row with no Wake form.

I did not add a bulk wake, a confirmation step, or any JavaScript. The Wake form is plain HTML, so it works without scripts.

To try it, archive an app, open /apps?archived=1, and press Wake.

Closes #6086

4 earlier comments
commented

Each row on /apps?archived=1 that the viewer administers now has a small Wake form. Posting it wakes the app and returns to /apps?archived=1. The new tests and the archive and apps suites pass. The type check could not run here (the bun types aren't installed, and tsc reported nothing else for the files I changed), so the forge's check is the first real run of it. design-lint printed "no colour, size or component added outside the system".

  • Wake form: it posts archived=0 to the existing /:owner/:name/settings/archive. That endpoint takes 0 or 1, not false, so I kept its format. Rows the viewer can't administer get no form. The form hangs under the row, wired through a new optional under read in src/web/studio/shelf.ts and built by wakeForms in src/web/pages/apps.ts.
  • Return address: the archive handler in src/web/pages/settings.ts now reads the to field. to=repo still goes to the repo page. Any other value is used only if it parses as a path on the same origin. Anything else (https://…, //host, a backslash, control characters) falls back to the repo's settings page, as before.
  • Cross-origin posts: the server's existing same-origin check still refuses them, and a test confirms the app stays archived.
  • Tests: in test/apps-archived.test.ts, one test wakes an archived app from the list. It checks the redirect lands on /apps?archived=1, the app is gone from the archived view and back on /apps, a cross-origin post is refused, and the bad return addresses fall back. A second test checks a viewer who doesn't administer the app (signed out) sees the row with no Wake form.

I did not add a bulk wake, a confirmation step, or any JavaScript. The Wake form is plain HTML, so it works without scripts.

To try it, archive an app, open /apps?archived=1, and press Wake.

commented

Each row of /apps?archived=1 that the viewer administers now has a Wake button, and pressing it returns you to /apps?archived=1.

Type error fixed. The type check had never run on this branch, and it reported one error in src/web/studio/shelf.ts. The row passed children: undefined when a row had no Wake form, which exactOptionalPropertyTypes rejects. The key is now left out in that case. bun x tsc --noEmit is clean, and test/apps-archived.test.ts and test/apps.test.ts pass (28 tests).

Nothing else to address. The pull had no review comments.

What the button does:

  • Form: each administered row gets a plain-HTML form hanging under it. It posts archived=0 to the existing /:owner/:name/settings/archive. Rows the viewer can't administer get no form.
  • Return address: the archive handler reads a to field. to=repo still goes to the repo page. Any other value is used only if it is a path on the same origin. Anything else (https://…, //host, a backslash, control characters) falls back to the repo's settings page, as before.
  • Cross-origin posts: the server's existing same-origin check still refuses them, and a test confirms the app stays archived.

Left out: bulk wake, a confirmation step, and any JavaScript.

To try it: archive an app, open /apps?archived=1, and press Wake.

Closes #6086

commented

Each row of /apps?archived=1 that the viewer administers has a Wake button, and waking returns to the list. This push addresses the review feedback. The type check and design-lint are clean, and test/apps-archived.test.ts passes (8 tests). I did not run the rest of the suite here, so the forge's check will be the first full run.

  • Doc comment: wakeForms now sits above appsList's JSDoc, so that comment describes appsList again.
  • TOUR.md: docs/TOUR.md did not exist on this branch because it was behind main, so I merged main first. The Archive section now says the archived list has a Wake button per administered row and returns to the list. It also says the terminal wakes from the About card with the same key (src/tui/screens/about.ts).
  • Button size: Wake is the default size, no longer sm. I did not measure whether it reaches 44px on a 360px phone.
  • Padding: I dropped the form-actions class from the form, which removes its 16px top margin. I did not look at the row in a browser, so I can't say the button is evenly padded.
  • Test: the redirect check reads new URL(location, url) once into a const.

I did not add a bulk wake, a confirmation step, or any JavaScript.

To try it, archive an app, open /apps?archived=1, and press Wake.

Closes #6086

commented

Each Wake button on /apps?archived=1 now names its app. A screen reader hears "Wake alice/shelved" instead of a bare "Wake" on every row. The type check, design-lint and test/apps-archived.test.ts (8 tests) pass.

  • Accessible name: the button text is Wake plus a visually hidden owner/name, using the existing sr-only class. That is in wakeForms in src/web/pages/apps.ts.
  • Test: the wake test in test/apps-archived.test.ts now also checks that the form for a row carries its repo's name, so it fails if the name goes.
  • Not measured: I did not measure the button on a 360px viewport, because the sandbox has no browser. It uses the default button size rather than sm. Whether it reaches 44px is still unchecked.

Left out as before: a bulk wake, a confirmation step and any JavaScript.

To try it, archive an app, open /apps?archived=1, and press Wake.

Closes #6086

commented

Planner: one more change before this lands (this was #6867, now dropped). Draw the Wake form as a control beside the row, a .row-actions form as boards-view.ts and accounts.ts do, not as children of row(). Then remove the under-as-children path from shelfRows. Keep the button's sr-only name. Check at 360px that the button reaches 44px and the row is evenly padded.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs