Repository navigation
Conversation
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 does this PR do?
Closes #265
HistoryStack.goTocompared step ids to decide how far to undo, but steps restored under the steps made while loading (and remote changes recorded before a redo) are numbered out of stack order. Clicking such a step in the History panel did nothing, or undid the wrong steps.goTonow works on positions in the stack (packages/history/src/stack/history-stack.ts): it finds the clicked step's index and undoes the undoable steps above it.goTo(0)still undoes every step. An id the stack no longer has (trimmed or invalidated, for example a click racing a trim) now does nothing, where it used to undo an arbitrary set of steps.HistoryEntry.idgets a doc comment: unique in its stack, not in stack order.Public signatures are unchanged.
How do you test this PR?
New tests in
packages/history/test/stack/history-stack.spec.ts:goToreaches steps restored under the steps made while loading (the History goTo does nothing on steps restored under newer ones #265 repro: push, restore two entries, go to the first restored step);goToreaches a change of another origin recorded before a redo;npx vitest runinpackages/history(reviewer, on 04f66b2)pnpm lint(reviewer, on 04f66b2)The producer reported the new tests failing on
mainand passing with the fix; those outputs were not kept, and the reviewer did not reproduce the red run. Not run on this branch: the root build, typecheck and the browser tests.Integration: a scratch branch with every editor branch of this sweep merged passed
pnpm build, lint, typecheck,pnpm test --force(1014 passed, 1 skipped) and the full e2e suite with the engine (141/141, Chromium only).Merge danger
historypackage, with no API change. Runtime dependents: the editor app and the history-panel plugin. Merging tomaindeploys the editor app.goTowith an unknown id does nothing. Its callers (HistoryService.goTo, the History panel) only pass 0 or an id from the rendered steps.null(so the state at load reads as unsaved), while a restore under new steps now moves it. Today nothing readsdirtyin production (see HistoryStack dirty tracking is never wired #352), so no user sees the difference.Follow-up issues
Quality gate
Small gate: one reviewer covering every lane.
goTodocstring still holds,HistoryEntry.iddocumented