Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
description: "Tasks for Linked editing on group tracks (specs/076, #184)"
Tasks: Linked editing on group tracks
Input: Design documents from specs/076-group-link/
Prerequisites: plan.md, spec.md, research.md, data-model.md, contracts/, quickstart.md
Tests: The constitution (IV) requires the smoke test to cover the new C ABI; the pure
rule class and linked arming are covered there too (tests/Nota.SmokeTest/GroupLinkTests.cs,
run from Program.cs like ArrangementMovesTests). UI behaviour is checked with the
quickstart scenarios.
Organization: by user story. US2 (selection) is implemented before US1 (edits) because the linked edits ride on the linked selection (plan § 3); both are P1.
Format: [ID] [P?] [Story] Description
- [P]: Can run in parallel (different files, no dependencies)
- [Story]: US1 edits · US2 selection · US3 arming · US4 toggle / visibility / persistence
Phase 1: Setup
- T001 Confirm the branch
feat/folder-track-groupsis based ondevelopand the engine build dirbuild/is Release (memory: engine build dirs); no code change
Phase 2: Foundational (blocks every story)
Purpose: the Link flag end to end and the shared rule class.
- T002 Add
bool editLink = false;besidepianoFoldinsrc/native/nota.engine/src/engine/Track.h(comment: specs/076, authoring only, never read on the audio thread) and make surecloneTrackcopies it (check the clone helper insrc/native/nota.engine/src/engine/Engine_Tracks.cpp) - T003 Declare
bool setTrackEditLink(int32_t trackId, bool on); int32_t trackEditLink(int32_t trackId) const;insrc/native/nota.engine/src/engine/Engine.hand implement them insrc/native/nota.engine/src/engine/Engine_Tracks.cppaftertrackPianoFold: refuse non-group tracks (return false), return true without republishing when unchanged, else clone +republishWithTrack(an undo step); getter returns 1 / 0 / -1 for unknown - T004 Add
nota_track_set_edit_link/nota_track_get_edit_linkwith the doc comment from contracts/c-abi.md afternota_track_get_piano_foldinsrc/native/nota.engine/include/nota/nota_engine.h, and their wrappers insrc/native/nota.engine/src/abi/nota_engine_track.cpp(null engine →NOTA_ERR_INVALID_ARG/ -1) - T005 [P] Add the P/Invoke pair
TrackSetEditLink/TrackGetEditLinkinsrc/managed/Nota.Infrastructure/Interop/NativeMethods.Tracks.cs - T006 Add
bool SetTrackEditLink(int trackId, bool on); bool GetTrackEditLink(int trackId);with the doc comment from the contract tosrc/managed/Nota.Application/Engine/IAudioEngine.csand implement them insrc/managed/Nota.Infrastructure/Interop/NotaEngine.Tracks.cs(set returnsresult == NOTA_OK, get returns== 1) - T007 Persist: add
public bool? EditLink { get; set; } // group Link (specs/076); written only when ontoTrackDtoinsrc/managed/Nota.Infrastructure/Persistence/ProjectModel.cs; insrc/managed/Nota.Infrastructure/Persistence/ProjectService.cswriteEditLink = engine.GetTrackEditLink(ti.Id) ? true : nulland on load callengine.SetTrackEditLink(id, true)forEditLink == trueafter group parents are restored, without leaving an undo step (load clears history — verify) - T008 Create
src/managed/Nota.Application/Editing/GroupLink.cs(SPDX header):readonly record struct LinkTrack(int Id, int GroupId, bool IsGroup, bool IsReturn, bool EditLink);GroupLink.Build(IEnumerable<LinkTrack>);int RootOf(int trackId)(outermost linked ancestor group, -1 none);IReadOnlyList<int> Members(int trackId)(the other non-group, non-return tracks with the same root; empty when unlinked);IReadOnlyList<int> ExpandTracks(IEnumerable<int>)(closure under membership, input order kept, then members);static bool Matches(double startA, double lenA, double startB, double lenB)withpublic const double MatchTolerance = 1.0 / 256applied to start and end ("within 1/256 of a beat", FR-006);bool IsLinked(int trackId);bool AnyLinked - T009 Create
tests/Nota.SmokeTest/GroupLinkTests.cs(SPDX header) withRun()and register it intests/Nota.SmokeTest/Program.csnext toArrangementMovesTests(both places it is listed). First checks — the ABI table of contracts/c-abi.md against the real engine: set/get on a group, refused on an audio track, idempotent set adds no undo step, undo/redo, duplicate group keeps it, unknown id → false; save → load round trip keeps it and an old project (no field) loads unlinked - T010 [P] Add
GroupLinkrule checks totests/Nota.SmokeTest/GroupLinkTests.cs: unlinked group → no members; linked group with A, B → members of A = [B]; nested: outer linked + inner unlinked → inner's tracks in the outer set; inner linked alone → own set; group and return tracks never members;Matchestrue at exact and 1/512-off edges, false at 1/128 off or different length;ExpandTracks([A, X])= [A, X, B]
Checkpoint: scripts/build.sh green with the flag and rules in place; no UI change yet.
Phase 3: User Story 2 — Select once, see the whole group selected (P1)
Goal: selecting a clip or a range on a linked track selects the matching material.
Independent Test: quickstart rows 2, 7 and 11.
- T011 [US2] Add
public bool EditLink;to the track VM insrc/managed/Nota.App/ArrangementView.Vms.csand fill it inRefreshfrom_engine.GetTrackEditLinkfor group tracks (src/managed/Nota.App/ArrangementView.cs); add a cachedGroupLink _linkrebuilt at the end ofRefreshfrom_tracks(ArrangementView.Groups.cs) - T012 [US2] In
src/managed/Nota.App/ArrangementView.cs: addprivate readonly HashSet<(int track, int clip)> _selLinked = new();and a helperIEnumerable<(int,int)> MatchesOf(int trackId, int clipIndex)that looks up the clip VM and returns the matching clips on_link.Members(trackId)(GroupLink.MatchesonStartBeat/LengthBeats); every place that clears_selclears_selLinked - T013 [US2] Make
Select(trackId, clipIndex, keepTrackSet, linked = true)addMatchesOfto_seland_selLinkedwhenlinked(src/managed/Nota.App/ArrangementView.cs);ToggleSelectadds the clip with its matches, and removing a clip removes its matches that are in_selLinked - T014 [US2] ⌥-click bypass (FR-012): in
src/managed/Nota.App/ArrangementView.LaneControl.csremember the press modifiers for the pending click and, on release of a pending click with Alt held, call_o.Select(track, clip, linked: false); ⌥-drag behaviour unchanged - T015 [US2]
SetSelection/ReselectPlaced: after replacing_sel, recompute_selLinked— forReselectPlacedmark as linked the placed clips that came from_selLinkedentries (map by request order of the move/duplicate), for marquee / ⌘A leave_selLinkedempty (src/managed/Nota.App/ArrangementView.cs,ArrangementView.KeyMoves.cs) - T016 [US2] Time ranges (FR-008):
TimeSelectionTrackIds()returns_link.ExpandTracks(...)of the row span (non-return rows);SetTimeSelectionwidens_timeSelRowLo/Hito cover the visible rows of every touched set so the range draws over all members (src/managed/Nota.App/ArrangementView.cs)
Checkpoint: selection and ranges link; edits on the selection (delete, duplicate, copy, cut, nudge, block drag) already follow.
Phase 4: User Story 1 — Edit two takes as one (P1) 🎯 MVP (with US2)
Goal: split, move, trim, fades, delete, duplicate, nudge, cut / copy act on matches as one undo step.
Independent Test: quickstart rows 3, 4, 5, 6 and 12.
- T017 [US1] Split at playhead (FR-010): in
SplitSelectedAtPlayhead(src/managed/Nota.App/ArrangementView.cs) add, for each linked track of the selection, every clip of its members spanning the playhead; run the split loop inside_engine.BeginUndoGroup()/EndUndoGroup()(try/finally) - T018 [US1] Clip menu Split here (
src/managed/Nota.App/ArrangementView.LaneControl.cs, theMenuKit.Item(Loc.T("Split here")…)): when the track is linked, split the clip and every member clip spanningatin one undo group (factor aSplitLinkedAt(trackId, clipIndex, at)helper inArrangementView.csshared with T017) - T019 [US1]
DeleteSelectedClips(src/managed/Nota.App/ArrangementView.cs): wrap the delete loop in one undo group so a linked delete is one step - T020 [US1] Trim / resize: in
OnPointerReleased(src/managed/Nota.App/ArrangementView.LaneControl.cs) collect the grabbed clip's matches that are in_selLinkedbefore committing (matched on the pre-drag_origStart/_origLen), then apply the sameTrimClip/ResizeAudioClip(by each clip's kind) to all of them inside one undo group; raiseRaiseClipGeometryChangedfor each - T021 [US1] Clip ADSR / fades:
CommitAdsr(src/managed/Nota.App/ArrangementView.LaneControl.cs) sets the sameClipAdsron the grabbed clip's audio matches in_selLinked, in one undo group - T022 [US1] Vertical drag move (research R5): in the group-move commit, entries whose
(track, clip)is in_selLinkedkeepdestTrack = m.trackwhile taking the time shift; in the drag preview (UpdateActiveDrag/ the_groupMoverow drawing inArrangementView.LaneControl.cs) those entries stay on their own rows; therowDeltavalidity check ignores them - T023 [US1] ⌥↑ / ⌥↓ (
MoveSelectedClipsToTrackinsrc/managed/Nota.App/ArrangementView.KeyMoves.cs): compute the row shift from entries not in_selLinkedand leave the linked entries out of the move - T024 [US1] Verify (read the code paths, no change expected) that nudge, duplicate, copy, cut, paste and block drag act on
_selincluding the matches and are single undo steps; note any exception in this file
Checkpoint: Stories 1 + 2 = the MVP; quickstart rows 2–7, 11, 12 pass.
Phase 5: User Story 3 — Arm the group with one click (P2)
Goal: arming one member arms the set; ⌥-click arms one track.
Independent Test: quickstart rows 8 and 9.
- T025 [US3] In
src/managed/Nota.Presentation/TrackArm.cs: build aGroupLinkfromTryGetTrackInfo+GetTrackEditLink;Set(engine, trackId, on, additive, linked = true)appliesonto the track and (whenlinked) its members; the exclusive pass skips the set; return true when any track other thantrackIdchanged.FollowSelectiontreats the set as one track (an armed set counts as one, arming arms the set) - T026 [US3] In
src/managed/Nota.App/TrackArming.cs:Set(engine, trackId, on, additive, linked = true)forwards; addIsBypass(KeyModifiers)(Alt held); updateTipto mention "⌥-click to arm one track of a linked group" viaMenuKit.Keys - T027 [US3] Pass
linked: !TrackArming.IsBypass(mods)at every arm button:src/managed/Nota.App/ArrangementView.cs(arm chip),MixerView.cs,MixerView.Compact.cs,SessionView.Mixer.cs,TrackInspectorView.cs(each already has the click modifiers) - T028 [US3] Add linked-arm checks to
tests/Nota.SmokeTest/GroupLinkTests.cswith the real engine: linked A, B + C outside: plain arm A → A, B on, C off; additive → C stays; disarm B → A off;linked: false→ only that track; Link off → today's behaviour
Checkpoint: arming works from every view.
Phase 6: User Story 4 — Turn the link on, see it, keep it (P2)
Goal: the Link key, member marks, menu item, MCP.
Independent Test: quickstart rows 1 and 10; ⌘Z after toggling restores it.
- T029 [US4] Link key on the group header (slim bar and full row) in
src/managed/Nota.App/ArrangementView.cs/ArrangementView.Groups.cs, built like the M / S keys withGlyphKind.ChainLink, accent when on, tooltip from contracts/ui.md; click →SetTrackEditLink(id, !on), status "The group's tracks are linked" when turned on,Refresh(); raise the event the Mixer listens to for track-state changes - T030 [US4] Member mark: a 10 px
ChainLinkglyph before the name in a linked member's header, secondary text colour, tooltip "Linked with {0}" (src/managed/Nota.App/ArrangementView.csheader builder) - T031 [US4] Group header context menu: checkable Link tracks item (
src/managed/Nota.App/ArrangementView.Groups.csor wherever the group header menu is built) - T032 [P] [US4] Mixer: the Link key on group strips in
src/managed/Nota.App/MixerView.csandMixerView.Compact.cs, and the Session mixer group column insrc/managed/Nota.App/SessionView.Mixer.cs; repaint on undo / external change like M / S - T033 [P] [US4] MCP
set_group_link/get_group_linkinsrc/managed/Nota.Mcp/Tools/TrackTools.cswith the descriptions from contracts/mcp.md - T034 [P] [US4] Localise the new strings (French entries; English is the key) in
src/managed/Nota.App/Languages/fr.jsonper contracts/ui.md, and satisfy the DesignTokenCheck allow-lists if they flag the new labels
Checkpoint: all stories done.
Phase 7: Polish & Cross-Cutting
- T035 Run the quickstart scenarios in the app (headless harness per memory recipe) and capture a before/after shot of a linked group header for the PR
- T036 [P] Preferences → Shortcuts: add the two ⌥-click lines via the
nota-shortcutsskill - T037 [P] FEATURES.md via
nota-features(Tracks and mixer → Group; Arrangement editing), user docs EN + RU vianota-docs
Nota closing tasks
- T038 Run
scripts/build.shuntil native + managed + smoke test are green — green except the render-pooloverloadedburst check, which flakes ondeveloptoo (alternating base/branch rounds 2026-11-04: base failed 1 of 4, branch 1 of 4 under load; unrelated to this change, which adds no audio-thread code) - T039 AGPL-3.0-only SPDX two-line header on
GroupLink.csandGroupLinkTests.cs - T040 New dependency: N/A (none added)
- T041
CHANGELOG.md[Unreleased]→ Added: group Link (#184) - T042 Engine behaviour change → smoke test covers the ABI (T009) — confirm green
Dependencies & Execution Order
- Phase 2 blocks everything (T002 → T003 → T004 → T005/T006 → T007; T008 independent of the engine tasks; T009 after T006/T007; T010 after T008).
- US2 (Phase 3) before US1 (Phase 4): US1's trim / ADSR / vertical-move code reads
_selLinked. - US3 (Phase 5) needs only Phase 2 — can run in parallel with Phases 3–4 (different files:
TrackArm.cs,TrackArming.cs, arm call sites). - US4 (Phase 6) needs Phase 2; T029–T031 touch
ArrangementView*.cs, so run them after Phase 4 to avoid conflicts; T032–T034 are parallel. - Polish after all stories.
Parallel examples
After Phase 2: Phase 3 (ArrangementView) ‖ Phase 5 (TrackArm / TrackArming) ‖ T033 (MCP)
In Phase 6: T032 (Mixer) ‖ T033 (MCP) ‖ T034 (strings)
Implementation Strategy
- Phase 2 → build green (flag + rules + smoke).
- Phases 3 + 4 → MVP: linked selection and edits (Link can be toggled through MCP until T029).
- Phase 5 → arming. 4. Phase 6 → UI entry points. 5. Polish, docs, build.