Public: anyone can read this; the crew can change it.
An imported session's page has a red Delete that asks for its title typed #18421
Closed 3h 6m ago
An imported session's page now has a red Delete this session control for its importer, and the terminal has a D key for the same thing. The new tests, the neighbouring trace tests and the page and terminal budget tests pass, tsc --noEmit is clean, and bun scripts/design-lint.ts is clean.
-
Reviews
No review yet.
-
Checks
stopped closed without shipping deploy ac5545b
-
History
- Rewrap, and name the terminal door of the delete form ac5545b
- An imported session's page has a red Delete that asks for its title typed (#18389) ee6d098
- An imported session is deleted through the API by its owner who sends its exact title (#18390) 2c0a8b8
- Access 3, MCP: the scope floor is read from the disagreement count, then deleted (#18418) e374d6c
- A pull that adds a migration runs test/data-browser.test.ts in its fast tier (#18419) 105485a
- Access 3b, web pages: the remaining admin gates (a local user?.isAdmin, isAdmin !== true || agent) ask adminPage beside them (#18413) b9d6e88
- A new inline isAdmin check in a moved door fails the gate (#18410) e472288
- Access 3, infrastructure and clouds: the admin-only routes ask may() in shadow (#18409) 7855bb1
- Full suite red: test/data-browser.test.ts (#18411) 7f3333e
- Sentinel: backup was degraded 14 minutes today: The last restore drill 2026-12-06 failed at restore. The backup check last ran 2026-12-06T09:25:52.363Z (1 min ago); 39… (#18407) 24f4503
- A tab-forge read-only link can be revoked by the person who made it (#18402) bfd96cb
- Access 3, web pages: every page that gates on isAdmin or sign-in also asks may(), counted beside the old check (#18400) 8f27ed4
- A tab-forge app leaves as one spec file and comes back in, with or without its records (#18399) 081ac9e
- A person shares one imported session by a link that hides what the forge redacts (#18391) 080d52c
- Full suite red: test/data-browser.test.ts (#18394) b4310c7
- Red after landing: #18373 broke test/data-browser.test.ts (#18393) ab53312
- An imported session opens by reading its stored gzip line by line, not as one decoded string (#18387) a3b5b3e
- A big session is stored without holding the whole file twice: the import writes it to gzip in chunks and checks UTF-8 as it goes (#18385) 8ceefc1
- A person imports a Claude Code or Codex session from /traces in the browser (#18382) d8b1b2b
- A person saves a /traces search by name and reopens it from the list and the palette (#18381) db6a2d2
5 earlier comments · 1 event
An imported session's page now has a red Delete this session control for its importer, and the terminal has a D key for the same thing. The new tests, the neighbouring trace tests and the page and terminal budget tests pass, tsc --noEmit is clean, and bun scripts/design-lint.ts is clean. I did not run the full suite: bun scripts/fast.ts named 2,951 tests (exit 0, over the 5-minute budget), so I ran the ones that cover this change.
What changed
- Page control:
src/web/pages/trace_delete_form.tsdraws a closed<details>on/traces/<id>: no script, nothing shifts when it opens.- It says what is lost and that a live share link must be stopped first.
- It asks for the title typed exactly. The field's
patternis that title, so a browser keeps the button from submitting until it matches.
- Handler:
src/web/pages/trace_delete.tshandlesPOST /traces/:id/delete. It is same-origin andrw-scoped (readForm), and registered inroutes/operations.tsandlazy_lists.ts.- A right title redirects to
/traceswith a receipt line ("Deleted “…”: … bytes freed"). - A wrong title, or a live share link, redraws the page with 422, the reason beside the field, and the disclosure open.
- A crew run, a Talk turn, another person's session and an unknown id all get the same not-found.
- A right title redirects to
- Shared code:
src/actions/trace_delete.tsholdsdeleteImportedSession, which reads the row withseenTraceRowand removes it with the API'sdeleteImported, so there is no second copy. The page and the terminal both use it. - Terminal:
Din the trace list opens a prompt for the title, and deletes only on the exact one. - Docs:
docs/features/traces.mdanddocs/design/areas/traces.mdname the control.test/tui-asks-first.test.tsalso listsdeleteImportedSessionas a destructive action.
Tests are in test/trace-imported-delete.test.ts:
- The control is present for the owner and absent for a crew run.
- A wrong title keeps the session and redraws the page with why.
- A live share link refuses the delete.
- A cross-site post is 403.
- The right title removes it and the list drops it.
- The terminal prompt refuses a wrong title and deletes on the right one.
What I did not do
- No JavaScript to disable the button. The
patternattribute does that job without script, and the server checks the title again. - No new CSS:
.trace-deleteis only a hook. It reuses the shared danger button and field. - Nothing is reused from
scripts/similar.tsbeyond what is above. The check notes that the test'spresshelper is identical to one intest/traces-saved.test.ts; I left it. - The commits carry a
No door:line, because the terminal door and the how-to are edits to existing files rather than new ones. They also carryLooks:,Try:andReplaces:lines.
[
{"go": "/traces", "look": "Import a session file, then open it from the list", "expect": "Its page shows a red 'Delete this session' button below the totals, closed"},
{"go": "/traces/<imported id>", "look": "Open 'Delete this session'", "expect": "It says the file is removed for good and a live share link must be stopped first, and asks for the title typed; the page does not jump"},
{"go": "/traces/<imported id>", "look": "Type a wrong title and submit (a browser holds the button back; with script off the server answers)", "expect": "The page is drawn again with the form open and 'That is not the session's exact title: nothing was deleted.'; the session is still listed", "ask": "Does the wrong-title message read clearly beside the field?"},
{"go": "/traces/<imported id>", "look": "Type the exact title and submit", "expect": "You land on /traces with a receipt line naming the title and the bytes freed, and the session is gone from the list"},
{"go": "/traces/<a crew run id>", "look": "Look for any Delete control", "expect": "None"}
]Main already did this in #18371 (web page, post route, and terminal door).
DECLINED: already done on main in 3d2fa7b89. That commit adds the red Delete on an imported session's page, which asks for the exact title and posts to traceDelete in src/web/pages/trace_imported.ts. It also adds the terminal's X key, and it sits on top of the API from 2c0a8b821 (#18390). My branch builds the same feature a second way: trace_delete.ts, trace_delete_form.ts and a D key. The merge conflicts in docs/features/traces.md, src/http/routes/operations.ts, src/tui/screens/traces.ts and src/web/pages/trace_imported.ts. The conflict comes from that overlap, not from a small drift. Keeping both would leave two delete routes and two terminal keys, so I aborted the merge and pushed nothing. A person should close the issue and the pull.
Declined: already done on main in 3d2fa7b89. The red Delete on an imported session's page, which asks for the exact title, the POST /traces/<id>/delete route and the terminal X key were all added there (#18371), on top of the API from 2c0a8b821 (#18390). My branch builds the same feature a second way, and it conflicts with main in four files. I didn't resolve those conflicts, because keeping both would leave two delete routes and two terminal keys. I changed nothing for this feedback and pushed nothing. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m95f556k616kvezqstyrwsx6 Left open: someone has spoken on this pull.
Left #18389 open: 5 unticked items remain (On /traces/<id> of an imported trace, for its owner only, a red Delete control opens a form asking for the session's title typed exactly; the button stays inert until it matches, and a plain click removes nothing. It is a same-origin POST form that works without script (server checks the title again, using the API's reader and remover from the first issue, not a second copy).; On success the person lands on /traces with a receipt line (what was removed, how many bytes); a wrong name draws the page again with why. Crew runs and Talk turns show no control.; The control says what is lost and that a shared link, if one is live, must be stopped first.; …).
An imported session's page now has a red Delete this session control for its importer, and the terminal has a
Dkey for the same thing. The new tests, the neighbouring trace tests and the page and terminal budget tests pass,tsc --noEmitis clean, andbun scripts/design-lint.tsis clean. I did not run the full suite:bun scripts/fast.tsnamed 2,951 tests (exit 0, over the 5-minute budget), so I ran the ones that cover this change.What changed
src/web/pages/trace_delete_form.tsdraws a closed<details>on/traces/<id>: no script, nothing shifts when it opens.patternis that title, so a browser keeps the button from submitting until it matches.src/web/pages/trace_delete.tshandlesPOST /traces/:id/delete. It is same-origin andrw-scoped (readForm), and registered inroutes/operations.tsandlazy_lists.ts./traceswith a receipt line ("Deleted “…”: … bytes freed").src/actions/trace_delete.tsholdsdeleteImportedSession, which reads the row withseenTraceRowand removes it with the API'sdeleteImported, so there is no second copy. The page and the terminal both use it.Din the trace list opens a prompt for the title, and deletes only on the exact one.docs/features/traces.mdanddocs/design/areas/traces.mdname the control.test/tui-asks-first.test.tsalso listsdeleteImportedSessionas a destructive action.Tests are in
test/trace-imported-delete.test.ts:What I did not do
patternattribute does that job without script, and the server checks the title again..trace-deleteis only a hook. It reuses the shared danger button and field.scripts/similar.tsbeyond what is above. The check notes that the test'spresshelper is identical to one intest/traces-saved.test.ts; I left it.No door:line, because the terminal door and the how-to are edits to existing files rather than new ones. They also carryLooks:,Try:andReplaces:lines.Closes #18389