Skip to content

Retain control point selection over undo/redo operations - #92

Merged
winnerspiros merged 3 commits into
masterfrom
timing-screen-selection-retention-17106411480944945514
Mar 15, 2026
Merged

Retain control point selection over undo/redo operations#92
winnerspiros merged 3 commits into
masterfrom
timing-screen-selection-retention-17106411480944945514

Conversation

@google-labs-jules

Copy link
Copy Markdown

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:

  • In ControlPointList.cs, onUndoRedo now calls Beatmap.ControlPointInfo.GroupAt(selectedGroup.Value.Time) to find the logical equivalent of the selected group in the newly applied beatmap state.
  • In 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

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.
@google-labs-jules

Copy link
Copy Markdown
Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Mar 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0771a6ff-73fe-46e2-a44e-5bf4c3ea5359

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch timing-screen-selection-retention-17106411480944945514
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

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.
@winnerspiros
winnerspiros merged commit fa3831d into master Mar 15, 2026
32 checks passed
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