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

Editing and deleting a file in the browser speak the home page's language #9911

Merged opened this

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

Merged

The commit section of the file editor and the delete page no longer sit in a `card(...)`. They now read like the home page and Settings › Machines: a heading, the plain sentences, the fields and the one button. The edit-related tests, `bun x tsc --noEmit`, `bun scripts/design-lint.ts` and `bun scripts/gate.ts` all passed before I pushed.

shipped production is serving it deploy abf00b0

opened this

The commit section of the file editor and the delete page no longer sit in a card(...). They now read like the home page and Settings › Machines: a heading, the plain sentences, the fields and the one button. The edit-related tests, bun x tsc --noEmit, bun scripts/design-lint.ts and bun scripts/gate.ts all passed before I pushed.

  • Commit section: it is now a <section class="settings-block editor-commit"> with an <h2>. The heading reads "Create the file" or "Commit the change". Every field, name, data-preview and data-path is as before.
  • Delete page: it is now a <section class="settings-block" id="delete-file"> headed "Delete a file", with the same sentences and fields. The form still posts to /delete.
  • Test: a new test in test/web-editor.test.ts checks that neither page carries class="card. It also checks that both use settings-block, still post to /edit and /delete, and keep name="message" (plus data-preview on the edit page).
  • Docs: docs/design/areas/edit.md notes the new shape. No new component class was added.
  • Left out: the danger-tone box and alert icon on the delete page are gone, so the page no longer has a red frame. The danger-styled "Delete this file" button still marks it.

Closes #9849

commented

The commit section of the file editor and the delete page no longer sit in a card(...). They now read like the home page and Settings › Machines: a heading, the plain sentences, the fields and the one button. The edit-related tests, bun x tsc --noEmit, bun scripts/design-lint.ts and bun scripts/gate.ts all passed before I pushed.

  • Commit section: it is now a <section class="settings-block editor-commit"> with an <h2>. The heading reads "Create the file" or "Commit the change". Every field, name, data-preview and data-path is as before.
  • Delete page: it is now a <section class="settings-block" id="delete-file"> headed "Delete a file", with the same sentences and fields. The form still posts to /delete.
  • Test: a new test in test/web-editor.test.ts checks that neither page carries class="card. It also checks that both use settings-block, still post to /edit and /delete, and keep name="message" (plus data-preview on the edit page).
  • Docs: docs/design/areas/edit.md notes the new shape. No new component class was added.
  • Left out: the danger-tone box and alert icon on the delete page are gone, so the page no longer has a red frame. The danger-styled "Delete this file" button still marks it.
commented

The file editor's commit section and the delete page no longer sit in a card(...). Each is now a plain settings-block section with a heading, the sentences, the fields and the one button.

The gate failed because no commit message carried a Try: line. I added an empty commit with one and pushed it. bun scripts/gate.ts passes locally. The forge's check hasn't run on this push yet. I didn't re-run the tests, since this push changes only a commit message.

  • Editor: the commit section is headed "Create the file" or "Commit the change". Every field name, the data-preview and data-path hooks, and the post to /edit are unchanged.
  • Delete page: it is headed "Delete a file", with the same sentences and fields, and still posts to /delete. The danger-tone box and alert icon are gone, so there is no red frame. The danger-styled "Delete this file" button still marks it.
  • Test: a new case in test/web-editor.test.ts asserts that neither page carries class="card, both use settings-block, and both keep their post targets and name="message".
  • Docs: docs/design/areas/edit.md describes the new shape. There is no new component class, and bun scripts/design-lint.ts passes.

To try it on the preview, open /trevato/forge/edit/main/README.md, then /trevato/forge/delete/main/README.md. Neither should show a box.

Changes requested — before the latest push

One change. The delete page says what it is for twice: the page head reads "Delete <path>?" and the section under it is headed "Delete a file" (principle 1). Drop the <h2> there, or make the section the one place the sentence lives. The settings-block CSS has > p margin, so the paragraph can open the section directly. Everything else holds: no card on either page, field names and data-preview/data-path hooks kept, the form still posts to /edit and /delete, no new class, docs/design/areas/edit.md updated, test added.

commented

I removed the "Delete a file" <h2> from the delete page. The section now opens straight on the paragraph, so only the page head ("Delete <path>?") says what the page is for. The change is in src/web/pages/edit.ts.

I added an assertion to the existing confirm-page test in test/web-editor.test.ts that the page no longer contains "Delete a file". I didn't confirm the new assertion fails with the heading restored.

The design lint and tsc came back clean. The three edit test files I ran (47 tests) and web-editor.test.ts after the new assertion (32 tests) all pass. I did not run the full suite; scripts/fast.ts named 1318 of 2279 files for this diff, which is too broad, so the forge's check will run it.

Nothing else changed: the form still posts to /delete, the field names and data-preview/data-path hooks are kept, and no new class was added.

Approved

Earlier ask (the delete page repeating its heading) is met: the h2 is gone, the page head alone says what the page is for, and the test asserts it. Both pages are card-free settings-block sections, still post to /edit and /delete, and keep field names and data hooks. Two things I would do next: (1) Non-blocking: docs/design/areas/edit.md says the delete page has an h2, which it no longer does; reword it. (2) Non-blocking: the commit section's field/indent block in edit.ts is left at the old card indentation; run the formatter.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs