Snap the routing graph of a song with the header's magnet (#350)

The routing of a song is the same graph editor as a sound FX, but its
tab had no magnet, so its nodes could not be put on the grid.

- The Song tab carries the magnet next to Routing. It is off at first
  and acts on the routing graph.
- It is greyed out on the timeline, as Grid is greyed out in the
  routing. Switching the view only updates these two buttons, so a
  playing song is not handed its sequence again.
- The check hooks give the magnet and the snapping of the routing.

Tests:
- e2e 65 (melektaus-atx): ALL PASSED, 52 checks (1 new)
- Counter-check (magnet enabled on the timeline): exactly this check red
- Gate (melektaus-atx): CHECK EXIT 0, 270 files, 4178 tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-08 12:13:23 +02:00
1 parent 668682c4ff
commit 8c0d1cfd3f
3 files changed
+32 -2

No files matched your search

+3 -1
View File
@@ -1,7 +1,7 @@
import { findAssetOf } from '../../core/model/Project';
import type { HeadPart } from '../song/songView';
import { soundLibrary } from '../../viewport/SoundLibrary';
import { centreOf, type HookContext } from './hookHelpers';
import { centreOf, snapButton, type HookContext } from './hookHelpers';
/** The Song tab and its tracks (#334). */
export function songHooks({ state, editor }: HookContext) {
@@ -59,6 +59,8 @@ export function songHooks({ state, editor }: HookContext) {
edgeAt: (edgeId: string) => songEditor.routing.edgeGlobal(edgeId),
label: (nodeId: string) => songEditor.routing.nodeLabel(nodeId),
problem: (nodeId: string) => songEditor.routing.nodeProblem(nodeId),
snapping: () => songEditor.routing.snapEnabled,
snapButton: () => ({ ...snapButton(songEditor.snap), enabled: songEditor.snap.button.enabled }),
},
},
};