Skip to content

Keep artifact deletion optimistic across navigation - #1901

Open
baggiiiie wants to merge 2 commits into
UsefulSoftwareCo:mainfrom
baggiiiie:fix/artifact-deletion
Open

Keep artifact deletion optimistic across navigation#1901
baggiiiie wants to merge 2 commits into
UsefulSoftwareCo:mainfrom
baggiiiie:fix/artifact-deletion

Conversation

@baggiiiie

Copy link
Copy Markdown
Contributor

Summary

Keep artifact deletion optimistic across navigation (redirection back to artifact page after deleting an artifact), so deleted cards do not appear after redirection

before

deletion-before-fix.mp4

after

artifact-delete-after.mp4

Linked issue

no issue open yet, will open one if preferred

Verification

  • bun run format:check
  • bun run lint
  • bun run typecheck
  • bun run test
  • e2e — Artifacts · renaming and deleting in the console is what the agent sees nextrecording

Checklist

  • Added a changeset (bun run changeset), or this change needs none.
  • Added or updated tests for the new behaviour.
  • No secrets, credentials, or private data in the diff.

@baggiiiie baggiiiie changed the title Fit the empty Toolkits grid to the viewport Keep artifact deletion optimistic across navigation Aug 31, 2026
@baggiiiie

Copy link
Copy Markdown
Contributor Author

the ci failures are outside of this PR's diff, details:

@baggiiiie
baggiiiie force-pushed the fix/artifact-deletion branch from cb5031a to 6e90e1a Compare September 1, 2026 06:58
@devin-ai-integration

Copy link
Copy Markdown

Verdict: mergeable. Open 2 days; rebased on current main, no conflicts.

The fix is right for how the codebase already does this: artifactsOptimisticAtom is the single optimistic surface both mutations reduce over (packages/react/src/api/atoms.tsx), but nothing on the detail page read it, so the transition was dropped on unmount and the redirected gallery fell back to the list query's cached value. useAtomMount in packages/react/src/pages/artifact-detail.tsx is the minimal way to keep it alive without touching the atom definitions. No credential/token/connection-health surface involved.

Ran on the PR head:

  • bun run lint, bun run format:check, bun run typecheck — pass
  • bun run --filter @executor-js/react test — 46 files / 432 tests pass
  • e2e Artifacts · renaming and deleting in the console is what the agent sees next on selfhost — pass (11s)
  • Negative control: same scenario with artifact-detail.tsx reverted to main — fails, so the new assertion does catch the regression. But it fails via the 180s scenario timeout (the gallery suspends on the gated list refresh and Saved artifacts never appears), not the deletedCardCount assertion.

Non-blocking:

  1. The Saved artifacts waitFor() has no timeout, which is why a regression takes 180s to report. Maintainer pushes to the fork are disabled, so here's the one-liner (verified passing against selfhost):
    - await page.getByRole("heading", { name: "Saved artifacts" }).waitFor();
    + await page.getByRole("heading", { name: "Saved artifacts" }).waitFor({ timeout: 20_000 });
  2. The scenario no longer exercises the gallery card's hover → Delete path (e2e/scenarios/artifacts.test.ts, formerly the "Delete the artifact from the list" step); deletion is now only covered from the detail page. Fine if you're OK with that coverage moving, otherwise worth a separate follow-up.

@baggiiiie
baggiiiie force-pushed the fix/artifact-deletion branch from fc693ee to 4456cb5 Compare September 2, 2026 07:26
@baggiiiie
baggiiiie force-pushed the fix/artifact-deletion branch from 4456cb5 to d4103f2 Compare September 2, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant