Public: anyone can read this; the crew can change it.
Editing an issue's title and body opens a plain form under Edit, not a boxed card #10064
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/10047-editing-an-issue-s-title-and-body-opens → main 3 commits fork 2 threads · 2 unresolved
3 files
changed +17
−1
docs/design/areas/edit.md +3
| @@ -10,3 +10,6 @@ instead of redirecting. | ||
| 10 | 10 | The commit section of the editor and the delete page add no component class. As on the home page they are a heading, plain |
| 11 | 11 | sentences, the fields and the one button, no box: each is a `<section class="settings-block">` with an `<h2>` (the commit |
| 12 | 12 | section keeps `.editor-commit` for its spacing). Field names and the `data-preview`/`data-path` hooks are unchanged. |
| 13 | ||
| 14 | The issue page's folded Edit form is the same: plain title and body fields and Save, no box (`.card` and `.comment-form` | |
| 15 | are gone from it), spaced like the home composer. It adds no component class. |
src/web/pages/thread.ts +1 −1
| @@ -309,7 +309,7 @@ export interface ConversationOptions { | ||
| 309 | 309 | function editForm(issue: Issue, action: string): Html { |
| 310 | 310 | return html`<details class="tl-edit" id="edit"> |
| 311 | 311 | <summary class="muted small">${icon("pencil")} Edit</summary> |
| 312 | <form class="card comment-form mt" method="post" action="${action}"> | |
| 312 | <form class="mt" method="post" action="${action}"> | |
Principle 3, generous rhythm: the textarea's bottom margin came from |
||
| 313 | 313 | <label class="sr-only" for="edit-title">Title</label> |
| 314 | 314 | <input |
| 315 | 315 | class="input" |
test/edit-words.test.ts +13
| @@ -448,6 +448,19 @@ describe("new words for an issue or a pull", () => { | ||
| 448 | 448 | ).toBeDefined(); |
| 449 | 449 | }); |
| 450 | 450 | |
| 451 | test("the folded Edit form is plain fields, not a boxed card", async () => { | |
| 452 | const html = await page(`/alice/garden/pulls/${pull.number}`, await signIn("alice")); | |
| 453 | const at = html.indexOf('<details class="tl-edit" id="edit">'); | |
| 454 | expect(at).toBeGreaterThan(-1); | |
| 455 | const fold = html.slice(at, html.indexOf("</details>", at)); | |
| 456 | const open = fold.match(/<form[^>]*>/)![0]; | |
| 457 | expect(open).not.toMatch(/\bcard\b/); | |
| 458 | expect(open).not.toContain("comment-form"); | |
| 459 | expect(fold).toContain('name="title"'); | |
| 460 | expect(fold).toContain('name="body"'); | |
| 461 | expect(fold).toContain("Save"); | |
| 462 | }); | |
| 463 | ||
| 451 | 464 | test("the pages offer Edit to the author and a writer, and the form saves", async () => { |
| 452 | 465 | const mine = await signIn("alice"); |
| 453 | 466 | const change = `/alice/garden/pulls/${pull.number}`; |
Docs match the code. Please back this with a test of the rendered edit form so the plain form cannot regress to a card.