Skip to content

Do not move the playhead when selecting a track by its header - #12071

Merged
grliszas14 merged 1 commit into
audacity:masterfrom
jonata:fix-track-header-moves-playhead
Sep 9, 2026
Merged

grliszas14 merged 1 commit into
audacity:masterfrom
jonata:fix-track-header-moves-playhead

Conversation

@jonata

@jonata jonata commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Resolves: #11972

PanelTracksListModel::selectAudioData() dispatched a seek immediately after
setting the selection:

selectionController()->setSelectedTrackAudioData(item->trackId());

muse::actions::ActionQuery seek("action://playback/seek");
seek.addParam("seekTime", muse::Val(selectionController()->dataSelectedStartTime()));
seek.addParam("triggerPlay", muse::Val(false));
dispatcher()->dispatch(seek);

setSelectedTrackAudioData sets the selection to the track's GetStartTime()
… GetEndTime(), so the seek moved the playhead to the first clip's start, or
to 0 on an empty track. Removing the dispatch leaves the selection behaviour
unchanged.

Verified: builds, ctest 5/5, codestyle clean.

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Testflow test cases have been run

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: cfbc24ac-66ee-4dda-a2ba-03ef07e13158

📥 Commits

Reviewing files that changed from the base of the PR and between 07e6c36 and 09a9a7a46c8b7b3dcaa7ea81b8c06af4f7fa76d1.

📒 Files selected for processing (1)
  • src/projectscene/view/trackspanel/paneltrackslistmodel.cpp
💤 Files with no reviewable changes (1)
  • src/projectscene/view/trackspanel/paneltrackslistmodel.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

PanelTracksListModel::selectAudioData no longer seeks to the selected audio data start time. For mono and stereo tracks, the method now only updates the selected track audio data.

Priority: ➖ Normal — Schedule this narrow track-selection UX fix because it prevents the playhead from jumping when users select a track header.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to e1983

Selecting a track header now preserves the current playhead position while retaining track audio selection behavior. No current merge-readiness risk is identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main behavior change: selecting a track header must not move the playhead.
Description check ✅ Passed The description identifies the linked issue, explains the cause and fix, records verification results, and completes the required checklist. The optional Testflow checkbox is not selected, but this do…
Linked Issues check ✅ Passed The change directly satisfies issue [#11972] by removing the seek dispatch while preserving track audio selection. Selecting a track header no longer moves the playhead.
Out of Scope Changes check ✅ Passed The only code change removes the seek dispatch from PanelTracksListModel::selectAudioData(), which directly supports the linked issue. No unrelated changes are reported.

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@grliszas14
grliszas14 self-requested a review September 8, 2026 14:24
Clicking a track header dispatched a seek to the start of the track's audio,
so the playhead jumped away from wherever the user had put it - to the first
clip, or to 0 on an empty track. Selecting a track's audio data is a selection
change, not a transport command.
@grliszas14
grliszas14 force-pushed the fix-track-header-moves-playhead branch from 09a9a7a to e198362 Compare September 9, 2026 15:24
@grliszas14
grliszas14 merged commit bd6023a into audacity:master Sep 9, 2026
5 of 10 checks passed
@grliszas14

Copy link
Copy Markdown
Contributor

@jonata thanks for the contribution! just merged it

kryksyh added a commit that referenced this pull request Sep 22, 2026
Do not move the playhead when selecting a track by its header (#12071)
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.

Selecting a track by it's header should not move the playhead cursor

2 participants