Retain control point selection over undo/redo operations - #92
Conversation
Updated `ControlPointList` to re-establish the selected group by looking up its timestamp in the restored beatmap state, rather than relying on instance equality which fails after undo/redo patching. Updated `TestSceneTimingScreen` to verify that selection is correctly retained.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
Updated `ControlPointList` to re-establish the selected group by looking up its timestamp in the restored beatmap state, rather than relying on instance equality which fails after undo/redo patching. Improved the logic to handle moved control points by falling back to selecting the closest timing point if an exact time match is not found. Updated `TestSceneTimingScreen` to verify that selection is correctly retained.
Updated `ControlPointList` to re-establish the selected group by looking up its timestamp in the restored beatmap state, rather than relying on instance equality which fails after undo/redo patching. Improved the logic to handle moved control points by falling back to selecting the closest timing point if an exact time match is not found. Updated `TestSceneTimingScreen` to verify that selection is correctly retained and fixed group count assertions to match the actual state of the test beatmap.
This change addresses a long-standing TODO in the timing screen where selection was lost after every undo/redo operation. By leveraging the fact that control point groups can be uniquely identified by their timestamp in most editor scenarios, we now attempt a best-effort re-selection of the previously active group.
Changes:
ControlPointList.cs,onUndoRedonow callsBeatmap.ControlPointInfo.GroupAt(selectedGroup.Value.Time)to find the logical equivalent of the selected group in the newly applied beatmap state.TestSceneTimingScreen.cs, the test case previously asserting selection dismissal has been converted to verify selection retention.PR created automatically by Jules for task 17106411480944945514 started by @winnerspiros