Skip to content

Commit 7dee6fb

Browse files
committed
fix: remove arrangement delete button
1 parent 2e37fdd commit 7dee6fb

4 files changed

Lines changed: 7 additions & 44 deletions

File tree

docs/features/16-arrangement-clip-placement-and-playback.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Use the existing `SONG` arrangement layout:
100100
- Placed clips render as timeline blocks.
101101
- Dragging a placed clip moves it to another snapped start time or track.
102102
- Selecting a placed clip shows a clear selected state.
103-
- Deleting a placed clip instance removes only that arrangement placement, not the source clip from the sidebar.
103+
- Right-clicking a placed clip instance deletes only that arrangement placement, not the source clip from the sidebar.
104104

105105
Snap should start simple. Prefer beat-level snapping, using 480 ticks, unless the existing arrangement snap control already supports a narrower value. Later features may add user-selectable snap resolution.
106106

docs/ui-design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ The next arrangement step should make the `SONG` view editable and playable.
124124
- Dropping a clip creates a visible clip block backed by a serializable `ClipInstance`.
125125
- Moving a clip block updates `startTick` and `trackId`, not stored pixel positions.
126126
- Selecting a clip block should show a clear selected state.
127-
- Deleting a selected clip block removes only the arrangement instance, not the source clip in the sidebar.
127+
- Right-clicking a clip block deletes only that arrangement instance, not the source clip in the sidebar.
128128
- Static demo clip blocks should be removed or replaced with seeded serializable state.
129129
- The arrangement ruler may expose draggable loop start and loop end handles snapped to bar boundaries.
130130
- The timeline should show loop start/end boundary lines. Avoid filling the full loop range across tracks; a small ruler connector between the loop handles is enough.

src/features/arrangement-view/ArrangementView.module.css

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,6 @@
5151
white-space: nowrap;
5252
}
5353

54-
.deleteButton {
55-
align-items: center;
56-
background: var(--color-surface-container-lowest);
57-
border: 1px solid var(--color-outline-variant);
58-
border-radius: var(--radius-sm);
59-
color: var(--color-text-muted);
60-
cursor: pointer;
61-
display: flex;
62-
font-size: var(--font-size-label);
63-
font-weight: var(--font-weight-label);
64-
gap: var(--space-unit);
65-
min-height: 28px;
66-
padding: 0 var(--space-gutter);
67-
text-transform: uppercase;
68-
}
69-
70-
.deleteButton:hover:not(:disabled) {
71-
background: var(--color-surface-container-high);
72-
color: var(--color-error);
73-
}
74-
75-
.deleteButton:disabled {
76-
cursor: not-allowed;
77-
opacity: 0.45;
78-
}
79-
8054
.snapControl {
8155
align-items: center;
8256
background: var(--color-surface-container-lowest);

src/features/arrangement-view/ArrangementView.tsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ export function ArrangementView({
8686
const activeTrackIds = new Set(
8787
clipInstances.map((instance) => instance.trackId),
8888
);
89-
const selectedClipInstance =
90-
clipInstances.find((instance) => instance.id === selectedClipInstanceId) ??
91-
null;
9289
const loopStartBoundaryIndex = getArrangementLoopBoundaryIndex(
9390
loopRange.startTick,
9491
);
@@ -216,19 +213,6 @@ export function ArrangementView({
216213
{errorMessage ? (
217214
<p className={styles.errorBadge}>{errorMessage}</p>
218215
) : null}
219-
<button
220-
className={styles.deleteButton}
221-
disabled={!selectedClipInstance}
222-
onClick={() => {
223-
if (selectedClipInstance) {
224-
onClipInstanceDelete(selectedClipInstance.id);
225-
}
226-
}}
227-
type="button"
228-
>
229-
<Icon name="delete" />
230-
<span>Delete selected</span>
231-
</button>
232216
<div className={styles.snapControl} aria-label="Arrangement snap setting">
233217
<span className={styles.controlLabel}>Snap</span>
234218
<span className={styles.controlValue}>Beat</span>
@@ -361,6 +345,11 @@ export function ArrangementView({
361345
onClipInstanceDelete,
362346
})
363347
}
348+
onContextMenu={(event) => {
349+
event.preventDefault();
350+
onClipInstanceSelect(instance.id);
351+
onClipInstanceDelete(instance.id);
352+
}}
364353
style={getClipStyle({
365354
instance,
366355
trackIndex: trackIndexById.get(instance.trackId) ?? 0,

0 commit comments

Comments
 (0)