Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client): undoing an unpin keeps an older pin in its place #48069

MergedStiensWout(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/48069/headmerged by juliusmarminge View on GitHub

Pins saved before manual ordering have no order key. Undoing the unpin of one of these pins used to give it a fresh key at the top, so it moved above the threads that had been ahead of it. The undo plan now records that the pin had no key, and both web and mobile restore it without one, so it goes back to its earlier place in Pinned.

Related: #31795, #39940

Reproduction on main

Commit ff4d267910 (main). The thread returns at the top of Pinned, ahead of the thread that was above it. Expected: The thread returns to its previous place in Pinned.

  1. Open a sidebar where a thread pinned before manual ordering appears below another pinned thread.
  2. Unpin the older thread.
  3. Click Undo in the sidebar.

The cause is at packages/client-runtime/src/state/threadUndo.ts:60. Ran pnpm scenarios:prove scripts/scenarios/undo-unpin-keeps-legacy-pin-position.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean checkout, with expected "Older pin" to be "Arranged pin" in the output.

Evidence

Environment: The web app in Chromium on Linux x64, a fresh checkout.

Proven: the repro fails at the test commit 5cb2fcd6f6 and passes on the head 012f0a854d, both on main 3fac5b2ad2.

BeforeAfter
Commit5cb2fcd6f6012f0a854d
ResultASSERTION_FAILED: expected "Older pin" to be "Arranged pin"passed
pinned order after undoBefore: pinned order after undo Before: pinned order after undo (changed region)
The thread returns at the top of Pinned, ahead of the thread that was above it.
After: pinned order after undo After: pinned order after undo (changed region)
The thread returns to its previous place in Pinned.
failureBefore: failure
RecordingBefore: recordingAfter: recording

Tests

  • 5cb2fcd6f6 adds the failing test, alone, before the fix.
  • pnpm exec vp run check:changed 3fac5b2ad2b07a60ce21a43e4191cf8f86dafcd3 passed on head.

Not in this change

  • Pins that have no order key still always sort after keyed pins. This change keeps that existing ordering.
  • The scenario still tries the default replay model first and falls back when it is not advertised, because some replay catalogs advertise only default and others only the named recordings.

Who did the work

  • Repro written by GPT 6.2 Sol, in Codex
  • Duplicate check judged by Claude Opus 5.5, in Claude Code
  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex
  • Reproduction, checks and proof run by a program on base and head, not by an agent

Made in T3 Code by GPT 6.2 Sol and Claude Opus 5.5

    1. Pusheda3c412c

    2. Evidence

      Seed “Older pin” pinned without an order key and “Arranged pin” pinned with key “m”. Open Arranged pin, click Older pin’s Unpin thread button, immediately click Undo, then reload the thread and capture the persisted sidebar order.

      Environment on both sides: real web app, Chromium, 1280×800, light theme, fresh isolated server data, Replay (dev).

      Scenario: Undo returns an older pin to its place in the sidebar

      Proven: the scenario fails on base 5dea97de40 and passes on head a3c412cc43.

      Base 5dea97de40Head a3c412cc43
      Result❌ failed
      ASSERTION_FAILED: expected ["Older pin","Arranged pin"] to equal ["Arranged pin","Older pin"]
      ✅ passed
      pinned order after undoBase 5dea97de40: pinned order after undoHead a3c412cc43: pinned order after undo
      failureBase 5dea97de40: failure

      Before recording · After recording · Scenario source

      Not shown:

      • Mobile was not run on a device; this proof covers the web client only.
    3. juliusmarminge added labelstakeover:ready

    4. juliusmarminge removed labelstakeover:in-progress

    5. juliusmarminge merged thisbdbc06a

    6. juliusmarminge closed this

    7. juliusmarminge removed labelstakeover:ready

Sign in to join this conversation.