Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
C# audioaudio-unitavaloniacpp20cross-platformdawdigital-audio-workstationdspjucelinux-audiomcp-servermidimusicmusic-productionpiano-rollplugin-hostsequencersynthesizervstvst3
Research: Arrangement group trays
Feature: spec.md · Plan: plan.md · Issue: nota-daw/nota#584
What the code does today, and the decisions this feature takes. Line numbers are as of
develop @ eec6a4ff and only a guide.
Today
- Header column.
ArrangementView.RebuildHeaders(ArrangementView.cs~2265) places one card per visible row on the_headerscanvas atRowTop(i),HeaderWwide andRowH(i)tall, so cards line up with the lanes by construction._tracksis in hierarchy order withDepthset and folded descendants dropped (ArrangementView.Groups.csApplyHierarchy). - Slim group row. An unselected group is
BuildGroupBar(26 px,GroupRowHeight): chevron, name, M / S / (Cue) / Link, the "Group" tag, and aMeterBar(horizontal)3 px tall withVerticalAlignment.Bottomin aPanelover the whole row — that is why it runs under the name and the chips. A selected group is a fullBuildTrackCard. - Nesting.
HeaderBarsdraws one 4 px bar per enclosing group atk * GroupIndent(14), then the row's own bar (3 px, inset 6 top/bottom for tracks; 4 px full height for a group's own row). Content starts atx + NameGap(12). - Tints. Group card:
TrackTint(color, 0.16); a member card:TrackTint(groupColor, 0.06)of its direct group. Group lane:GroupLaneBgplusTrackTint(color, 0.16)(ArrangementView.LaneControl.cs~1158). - Track meter overflow — root cause.
MeterBar's vertical constructor setsMinHeight = 40(Controls/MeterBar.cs). The header meter hasMargin(6, 6, 4, 6)andVerticalAlignment.Stretch; on a Compact row (30 px) only 18 px are left, on the smallest Standard row (50 px) 38 px. Avalonia honoursMinHeight, so the meter is laid out 40 px tall from its top margin and runs into (and is clipped at) the card's bottom edge — the "pokes out" in the issue's screenshot. - Folded count.
ApplyHierarchyalready walks the full child map (folded groups included) and setsGroupSlotCount= the number of non-group descendant tracks. That is exactly the clarified count. (The Mixer'sHiddenIdsincludes nested groups; not reused.) - Look.
NotaThemeService.Look(Nota.App/Theme), enumLookinNota.Application/Looks.cs. A look change callsRepaintEverything(invalidate only) and raisesNotaThemeService.Changed; it does not rebuild the header cards. The clip style follows the look throughArrangementView.ClipStyle, set byMainWindowfrom settings. - 0.59.2 reference (
git show v0.59.2:src/managed/Nota.App/ArrangementView.cs):SpineGrid(depth, spine, body)= columns[depth*10 px][3 px spine][*];BuildGroupBaronBrush.SurfaceRaised, name 11 / SemiBold, chips 3 apart, a horizontal meter 4 tall docked bottom of aDockPanel(margin 0,0,0,3) so it takes its own line, body margin 8,0,8,0; track cards onBrush.SurfaceCard, vertical meter 8 wide, margin(0,4,3,4)compact /(0,6,3,6)otherwise; a selected row's spine inNotaPalette.Accent. No group lane tint. - Tests.
tests/Nota.SmokeTestreferencesNota.Presentation, notNota.App; pure layout code there is testable (precedent:PianoRowMap+FoldTests).DesignTokenCheck*scansArrangementView*.cssource for raw radii / numbers with allow-lists.
Decisions
R1 — Tray geometry (new look)
- Decision: one fixed step per nesting level, 6 px = a 3 px tray edge + a 3 px gap.
For a row whose tray chain (enclosing groups, outer → inner; a group's own header row
includes itself) has length k, tray i has its edge at
x = i * 6; the row's card (a member) or its header content (a group) starts atx = k * 6. Every tray and every card share one right edge; the trays' right corners are rounded where a tray starts (top right, on its header row) and where it closes (bottom right). The member card is insetTrayInsetR(4 px) from the right so the tray shows around it; top-level tracks are not inset, but every row lays out its controls against the same right content edge (R3). - Rationale: SC-001 asks a depth-2 track's name to start ≤ 12 px further in than a top-level track's: two levels × 6 = 12 ✓. The issue's "about 4 px" inset meant the visible gap; 3 px plus the 3 px edge keeps the step at 6. A shared right edge is what keeps the controls' columns fixed at every depth (FR-007).
- Alternatives: 4 px gap + 3 px edge (7 px/level → 14 px at depth 2, fails SC-001);
nested
Borders per group (cannot work: header rows are separate canvas children per row, aligned to lanes); insetting nested trays on the right too (moves the controls per depth, fails FR-007).
R2 — Tray painting
- Decision: a pure layout in
Nota.Presentation(GroupTrayLayout) turns the visible rows (id, parent id, is-group, folded, colour) into per-row slices: the chain of trays the row sits in, which tray (if any) the row heads, how many trays close on the row (innermost first), and the content left.ArrangementViewpaints each card's background from its slice (a small custom-drawn layer under the existing card content), so cards stay per-row and aligned to their lanes. - Rationale: rows are already per-row canvas children and rebuilt per change; a slice per row needs no cross-row visual tree. The layout is testable headlessly.
- Alternatives: one big backdrop control behind all headers (must track every row's
RowTop, fold and live row-height drags — more coupling for no gain).
R3 — Wash, closings and row heights
- Decision: wash = 16 % of the group colour on its header row (today's group tint), 8 %
on the rest of its tray (
TrackTint(color, 0.08)); a member card sits onBrush.Panel(no 6 % tint). The innermost tray closing on a row takes a 4 px strip at the bottom of that row, each further tray closing there a 2 px one (outer below inner), carved out of the row's height (found in implementation: four 4 px strips left a Compact row 14 px, short of its 20 px name row); the card / content is laid out in the remaining height. A folded group's row closes its own tray. Controls and the meter lay out against one right content edge for every row:HeaderW − TrayInsetR − HeaderRightPad-style constant, the same for a top-level track as for a member. - Rationale: FR-009 (no row grows), FR-004 (no stacked tints on a card). Two closings on a Compact row leave 22 px — the 20 px name row fits.
- Alternatives: a separate spacer row after each group (breaks the row ↔ lane mapping
and every
RowTopcaller).
R4 — Group row meter (new look)
- Decision: the slim group row gets the same vertical
MeterBaras track cards, docked right in the same column; the horizontal rail goes. All header meters (both looks) getMinHeight = 0and margins that leave equal inner padding top and bottom. - Rationale: FR-005, FR-008; the
MinHeightis the overflow's root cause. - Alternatives: shrinking the margins only (still overflows on Compact).
R5 — Classic look staircase
- Decision: a second header-geometry path that reproduces 0.59.2's
SpineGridand slimBuildGroupBar(surfacesSurfaceRaised/SurfaceCard, 11 px name, horizontal meter docked below the title, accent spine when selected), with today's controls inside (Cue key when shown, Link) and the folded count. No tray, no group lane wash. Tokens, not 0.59.2's raw numbers, wherever a token exists (the classic look already maps radii and colours). - Rationale: FR-010–FR-012, SC-004.
- Alternatives: restoring 0.59.2's whole header builder (would drop features added since: sends, Cue, Link marks, takes toggle, player tag).
R6 — Live look switch
- Decision:
ArrangementViewgets aHeaderLookproperty (likeClipStyle). The main window sets it at start-up and fromNotaThemeService.Changedonly when the look differs; the setter rebuilds the headers and invalidates the lanes (group lane wash). - Rationale: FR-013 / SC-005; a theme or accent change must not rebuild headers.
- Alternatives: reading
NotaThemeService.Lookinside the builders without a rebuild trigger (headers would keep the old look until the next refresh).
R7 — Folded count text
- Decision: after the name, " · N" in the type-tag style (Label 11, ink 3); N =
GroupSlotCount. Shown only when folded, in both looks. Localized as a number only (no word), so no new string. - Rationale: FR-006 + clarification; no new localization key.
R8 — Out of scope, confirmed
Mixer group bands, Nota Remote, sticky headers, the group lane's mini-clip preview, the takes rows and the footer rows (returns, master) are untouched.