Add one mutation helper for optimistic updates, rollback and undo

Open
#229 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

Start by finding the existing onMutate and setQueryData optimistic updates and the invalidate-and-refetch calls the issue counts, then trace how linking, moving, resizing, layout reset and drafts are wired. Confirm scope with the maintainer and #166 before claiming, since the issue asks for a shared helper. Done means the helper covers the listed actions, recorded decisions stay non-optimistic, and browser regressions cover success, rollback and Undo.

Written by the indexing model from the issue text.

Description

area:web difficulty:d3 layer:entry priority:p2 status:triage type:refactor

Task difficulty and Agent fit

  • D3 · 8/15. Scope 2, uncertainty 2, impact 2, verification 1, dependencies 1. Apply a shared mutation helper to reversible state updates and scope the undo work with #166.
  • Recommended configuration. Codex / GPT-6.2 Sol / xhigh, 50 and $0.90 per benchmark task. Floor 50 in the Artificial Analysis Coding Agent Index v2.1. Trellin snapshot checked 2026-11-22.
  • Required skills and verification. React Query/TypeScript and optimistic recovery. Verify failed, reversed-order and repeated actions, rollback and Undo with no change to recorded decisions.
  • Scored baseline. fc47b7c on main. Confirm implementation scope with the maintainer before claiming.
Roadmap task

none

Goal

Most actions wait for the server before the interface changes. Measured on main at 2ba9053 (1.0.76+). There are 8 optimistic updates (onMutate or setQueryData) against 28 invalidate-and-refetch calls. Actions feel delayed, and undo (#166) has no shared foundation.

Acceptance criteria
  • Add one mutation helper: apply optimistically where the change is local and reversible, show a toast with Undo, roll back and report on error, and invalidate on settle.
  • Use it for linking and unlinking, moving and resizing cards, layout reset, and conversation drafts. Recorded decisions (approve, return, confirm) stay non-optimistic and show a confirmation with View, never Undo.
  • Browser regressions cover an optimistic success, a rollback on a failed request and Undo.
Prevent recurrence
  • Document which actions may be optimistic, and why recorded decisions may not (B4, B7), next to the helper. Reviews reject ad hoc mutation code for listed action types.
Decisions and contracts

No API change. Recorded evidence and decisions stay append-only. Related to #166.

Dominant language
Python
Stars
2
Forks
0
Avg merge
56m
Merged PRs (30d)
190

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SAFuDarren/Trellin

All issues in SAFuDarren/Trellin

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.