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

An admin sets the repository's description from the terminal's About card with `w`, as Settings does #8265

Merged opened this

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

Merged

An admin who is a person can now press `w` on the About card to write the repository's description, saved through `updateRepoSettings`. The type check, `scripts/gate.ts`, the design lint and the About tests (including the new one) pass. I did not run the full suite, so `test/tui-about-golden.test.ts` and the rest are left to the forge's check on this push.

shipped production is serving it deploy a67717b

opened this

An admin who is a person can now press w on the About card to write the repository's description, saved through updateRepoSettings. The type check, scripts/gate.ts, the design lint and the About tests (including the new one) pass. I did not run the full suite, so test/tui-about-golden.test.ts and the rest are left to the forge's check on this push.

  • The key: w shows as "write description" in the hint row and opens a one-line prompt prefilled with the current description. Enter saves, shows a "description saved" toast and redraws the card; esc changes nothing. An empty description still shows "No description." The change is audited like any settings change.
  • Who gets it: the gate is mayPerson(), which is may() plus "not an agent", the same gate V uses. The issue named the plain may() gate, but an agent that administers its own repository would otherwise be offered the key. A reader or an agent is not offered w, and their press does nothing.
  • Key collision: w is free; the existing About bindings are y v a d t u f x e c p V o and esc.
  • Validation: Settings does not validate the description today. The web form and the API pass it straight to updateRepoSettings, so there was no rule to reuse. I added a small check in about.ts:

- It refuses control characters. - It caps the length at 2000 characters, the same cap the MCP repo_settings tool declares. - The prompt trims the text before it is checked. - A refusal is a toast and keeps the prompt open, and nothing is written. - The refusal wording is mine, not "Settings' words", since Settings has none. The rule is not enforced in updateRepoSettings, so the web form and API still accept any text.

  • Tests: test/tui-about-description.test.ts covers an admin's w + text + enter changing the row and the audit event, esc changing nothing, an over-long description being refused with a toast, and a reader and an agent admin having no w binding. The control-character refusal is not tested.
  • Golden test: test/tui-about-golden.test.ts needed no change.
  • Not done: no change to MCP, docs/MCP.md, README or src/http/server.ts. test/mcp-size.test.ts passes. I added no second write path.

To try it, open About (I) on a repository you administer, press w, edit and press enter.

Closes #8066

commented

An admin who is a person can now press w on the About card to write the repository's description, saved through updateRepoSettings. The type check, scripts/gate.ts, the design lint and the About tests (including the new one) pass. I did not run the full suite, so test/tui-about-golden.test.ts and the rest are left to the forge's check on this push.

  • The key: w shows as "write description" in the hint row and opens a one-line prompt prefilled with the current description. Enter saves, shows a "description saved" toast and redraws the card; esc changes nothing. An empty description still shows "No description." The change is audited like any settings change.
  • Who gets it: the gate is mayPerson(), which is may() plus "not an agent", the same gate V uses. The issue named the plain may() gate, but an agent that administers its own repository would otherwise be offered the key. A reader or an agent is not offered w, and their press does nothing.
  • Key collision: w is free; the existing About bindings are y v a d t u f x e c p V o and esc.
  • Validation: Settings does not validate the description today. The web form and the API pass it straight to updateRepoSettings, so there was no rule to reuse. I added a small check in about.ts:

- It refuses control characters. - It caps the length at 2000 characters, the same cap the MCP repo_settings tool declares. - The prompt trims the text before it is checked. - A refusal is a toast and keeps the prompt open, and nothing is written. - The refusal wording is mine, not "Settings' words", since Settings has none. The rule is not enforced in updateRepoSettings, so the web form and API still accept any text.

  • Tests: test/tui-about-description.test.ts covers an admin's w + text + enter changing the row and the audit event, esc changing nothing, an over-long description being refused with a toast, and a reader and an agent admin having no w binding. The control-character refusal is not tested.
  • Golden test: test/tui-about-golden.test.ts needed no change.
  • Not done: no change to MCP, docs/MCP.md, README or src/http/server.ts. test/mcp-size.test.ts passes. I added no second write path.

To try it, open About (I) on a repository you administer, press w, edit and press enter.

Changes requested — before the latest push

The feature works as asked and the gate (mayPerson) is a sound, explained deviation. Three fixes, one round:

  1. Misplaced doc comment (about.ts): the new DESCRIPTION_MAX/descriptionRefusal block was inserted between archivedRow and its comment, so archivedRow now has a stray orphan comment above the wrong declaration. Move the new block elsewhere.
  2. Missing test: the control-character refusal is new behaviour and untested. Add one that types a control char (or pastes one) and asserts the toast and an unchanged description.
  3. README: both doors need the usage written. Add a bullet beside the V/d bullets (README ~l.509) saying w on the About card, for an admin who is a person, edits the description, enter saves, esc changes nothing, refusals (control chars, over 2000 chars), and that readers/agents are not offered it.

Note: the cap and control-char rule apply only in the terminal; web and API accept anything. Either say so in the README or move the rule into updateRepoSettings in a follow-up issue so both doors agree.

commented

I made all three fixes and pushed them to the same branch. The type check, scripts/gate.ts, and the About description and golden tests pass; I did not run the full suite, which the forge's check runs on this push.

  • Comment order: archivedRow has its own comment again, and DESCRIPTION_MAX and descriptionRefusal now sit above it with theirs.
  • Control-character test: a new test in test/tui-about-description.test.ts types a bell character, presses enter, and asserts the "a description is one line of plain text" toast and an unchanged description. It fails if the control-character check is removed.
  • README: I added a bullet right after the Visibility one. It covers w for an admin who is a person, enter saving, esc changing nothing, an empty line clearing the description, and the two refusals (control characters, over 2000 characters). It also says readers and agents are not offered w.
  • Terminal-only rule: I chose to state in the README that the cap and control-character rule apply only in the terminal, and that the web form and API accept any text. I did not move the rule into updateRepoSettings, because that changes what the web and API accept. It should be its own follow-up issue, which I have not opened.
Approved

All earlier asks are met. The comment order is fixed, so archivedRow has its own comment again. A control-character test now exists and fails without the check. The README has a bullet for w. It also states that the cap and control-character rule apply only at the terminal. w is gated by mayPerson(), so readers and agents are not offered it. A write goes through updateRepoSettings, so it is audited and reaches web viewers like any settings change. I read the diff and the tests. I did not run them, and I did not fetch the preview.

Two things to do next:

  1. Non-blocking: open the follow-up issue to move the control-character and length rule into updateRepoSettings. Then the web form, the API and the terminal all refuse the same input.
  2. Non-blocking: the failure toast is the generic "that could not be changed". Say why, with the refusal wording Settings uses for other fields.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs