Repository navigation
App: a Bot's saved copies, and restoring one - #2018
Merged
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 22, 2026 05:21
davidmckayv
force-pushed
the
app/workspace-restore
branch
from
November 22, 2026 05:33
39579b2 to
57fbb6e
Compare
davidmckayv
force-pushed
the
api/workspace-snapshots
branch
from
November 22, 2026 06:26
f952be7 to
7326203
Compare
davidmckayv
force-pushed
the
app/workspace-restore
branch
from
November 22, 2026 06:26
57fbb6e to
c67d63a
Compare
davidmckayv
force-pushed
the
api/workspace-snapshots
branch
from
November 22, 2026 07:11
7326203 to
a1fc568
Compare
davidmckayv
force-pushed
the
app/workspace-restore
branch
from
November 22, 2026 07:11
c67d63a to
f6cf773
Compare
davidmckayv
force-pushed
the
api/workspace-snapshots
branch
from
November 22, 2026 10:11
a1fc568 to
49f4fc9
Compare
A section on a Bot's Computer page, Saved copies, shows the daily copies of the computer this Bot runs on for the person reading, newest first, and the one saved just before each restore. It is drawn only where this OpenBot keeps copies and the person may see them: available false, or a refused read, draws nothing. Restore asks first, in plain words: every file and browser sign-in on the computer goes back to how it was then, for every Bot on it; OpenBot saves the computer as it is now first, so it can be undone; the computer restarts and routines wait. Nothing is restored unless a person picks a copy and confirms. A refusal (a restore already running) is said beside the buttons. While a restore runs the copies are read again every 5 seconds and a notice says so at the top; when it ends, the computer's status and the list of computers are read again. A failed restore shows the server's sentence; a done one points at the copy saved just before, while it is listed. Restore shows only where the read says the person may restore. An admin sees a Restore... button on each other person's computer this Bot runs on, which opens that computer's copies and restores it by name, with the same confirmation. Reads and writes go through the generated getWorkspaceSnapshots and restoreComputer, from queryOptions and mutationOptions factories in lib/computers. The Its computer rows now hold their words to a readable width, so with a third button the buttons wrap under the words on a narrow window instead of squeezing the name.
davidmckayv
force-pushed
the
app/workspace-restore
branch
from
November 22, 2026 10:17
f6cf773 to
a2c8687
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The screens for a computer's daily saved copies, on a Bot's Computer page, built on the operations in #2017 (
getWorkspaceSnapshots,restoreComputer). Stacked on that branch.available: true. A 403, a 404 oravailable: falsedraws nothing.canRestore. It opens a confirmation that says, in plain words, that every file and browser sign-in goes back to how it was then, for every Bot on that computer; that OpenBot saves the computer as it is now first, so it can be undone; and that the computer restarts and routines wait. Buttons: Cancel and "Restore it" ("Restoring…" while sending). A refusal such as 409COMPUTER_RESTORE_RUNNINGshows the server's sentence beside the buttons, and the dialog stays open.errorin the page's destructive notice. A finished one shows a quiet line, pointing at the "Before restore" copy while it is still listed. When a restore ends, the computer's status and the computers list are read again.?computer=<row.computer>) and restores withcomputerin the body, using the same confirmation stacked over it. The admin's own row has no "Restore…", because their own copies are in the section below.Data goes through the generated client only:
workspaceSnapshotsQueryOptionsandrestoreComputerMutationOptionsinlib/computers.Why
Restoring a computer is something a person chooses. Nothing restores automatically, and the screen never picks a copy for them: they see each copy's date, read what a restore does, and confirm it.
Screenshots
The real page in its Bot frame, drawn by headless Chromium with the app's stylesheet against a stand-in server (
app/tests/workspace-snapshots-layout.test.tsx, run withOPENBOT_APP_BROWSER=1, andOPENBOT_APP_SHOTS=<dir>to save them). Each was checked in light and dark, at 1024 px and 390 px:The test also asserts that the page never scrolls sideways and that every dialog stays inside the window.
Checks
bun test app/tests/workspace-snapshots.test.tsx: 7 tests, run against a stand-in server at the API's addresses. They cover the labels and newest-first order; the read-only view with no Restore; the section hidden foravailable: false, a 403 and a 404; the empty state; a confirm sendingrestoreComputerwith{snapshotId}and an Idempotency-Key, then the running notice; a restore already running on load; a 409 shown in the dialog; and an admin restoring another person's computer with{snapshotId, computer}, with "Restore…" only on that person's row.OPENBOT_APP_BROWSER=1 bun test app/tests/workspace-snapshots-layout.test.tsx: 16 pass.no-bot-computers,personal-settings,settings-computer-page,computer-fleet-pages,bot-delete-stops-computer-reads), the copy-rule tests andapi/client-boundary.test.tspass.bun run --cwd app typecheck,biome lint --error-on-warnings .andbun run api:lintare clean.