Merge branch 'main' into rust-ui
This commit is contained in:
@@ -2612,4 +2612,56 @@ export const actions = {
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
clearNodeGraph: {
|
||||
execute: async (action) => {
|
||||
// Get the current graph state to find all node IDs
|
||||
const graphStateJson = await invoke('graph_get_state', { trackId: action.trackId });
|
||||
const graphState = JSON.parse(graphStateJson);
|
||||
|
||||
// Remove all nodes from backend
|
||||
for (const node of graphState.nodes) {
|
||||
try {
|
||||
await invoke("graph_remove_node", {
|
||||
trackId: action.trackId,
|
||||
nodeId: node.id,
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(`Failed to remove node ${node.id}:`, e);
|
||||
}
|
||||
}
|
||||
|
||||
// Reload the graph from backend
|
||||
if (context.reloadNodeEditor) {
|
||||
await context.reloadNodeEditor();
|
||||
}
|
||||
|
||||
// Update minimap
|
||||
if (context.updateMinimap) {
|
||||
setTimeout(() => context.updateMinimap(), 100);
|
||||
}
|
||||
},
|
||||
rollback: async (action) => {
|
||||
// Restore the entire graph from the saved preset JSON
|
||||
try {
|
||||
await invoke("graph_load_preset_from_json", {
|
||||
trackId: action.trackId,
|
||||
presetJson: action.savedGraphJson,
|
||||
});
|
||||
|
||||
// Reload the graph editor to show the restored nodes
|
||||
if (context.reloadNodeEditor) {
|
||||
await context.reloadNodeEditor();
|
||||
}
|
||||
|
||||
// Update minimap
|
||||
if (context.updateMinimap) {
|
||||
setTimeout(() => context.updateMinimap(), 100);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to restore graph:', e);
|
||||
alert('Failed to restore graph: ' + e);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Metronome body (trapezoid) -->
|
||||
<path d="M12 4 L8 20 L16 20 Z" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linejoin="miter"/>
|
||||
<!-- Base -->
|
||||
<rect x="6" y="20" width="12" height="2" fill="currentColor"/>
|
||||
<!-- Pendulum arm -->
|
||||
<line x1="12" y1="8" x2="14" y2="16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
||||
<!-- Pendulum weight -->
|
||||
<circle cx="14" cy="16" r="1.5" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 554 B |
@@ -172,7 +172,7 @@ function serializeLayoutNode(element, depth = 0) {
|
||||
// that matches the panes object keys, not the name property
|
||||
const dataName = element.getAttribute("data-pane-name");
|
||||
|
||||
// Convert kebab-case to camelCase (e.g., "timeline-v2" -> "timelineV2")
|
||||
// Convert kebab-case to camelCase (e.g., "preset-browser" -> "presetBrowser")
|
||||
const camelCaseName = dataName.replace(/-([a-z0-9])/g, (g) => g[1].toUpperCase());
|
||||
|
||||
console.log(`${indent} -> Found pane: ${camelCaseName}`);
|
||||
|
||||
+8
-8
@@ -32,7 +32,7 @@ export const defaultLayouts = {
|
||||
type: "vertical-grid",
|
||||
percent: 30,
|
||||
children: [
|
||||
{ type: "pane", name: "timelineV2" },
|
||||
{ type: "pane", name: "timeline" },
|
||||
{ type: "pane", name: "stage" }
|
||||
]
|
||||
},
|
||||
@@ -63,7 +63,7 @@ export const defaultLayouts = {
|
||||
{ type: "pane", name: "infopanel" }
|
||||
]
|
||||
},
|
||||
{ type: "pane", name: "timelineV2" }
|
||||
{ type: "pane", name: "timeline" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -81,7 +81,7 @@ export const defaultLayouts = {
|
||||
type: "vertical-grid",
|
||||
percent: 50,
|
||||
children: [
|
||||
{ type: "pane", name: "timelineV2" },
|
||||
{ type: "pane", name: "timeline" },
|
||||
{ type: "pane", name: "nodeEditor"}
|
||||
]
|
||||
},
|
||||
@@ -107,7 +107,7 @@ export const defaultLayouts = {
|
||||
percent: 50,
|
||||
children: [
|
||||
{ type: "pane", name: "stage" },
|
||||
{ type: "pane", name: "timelineV2" }
|
||||
{ type: "pane", name: "timeline" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -142,7 +142,7 @@ export const defaultLayouts = {
|
||||
percent: 50,
|
||||
children: [
|
||||
{ type: "pane", name: "infopanel" },
|
||||
{ type: "pane", name: "timelineV2" }
|
||||
{ type: "pane", name: "timeline" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -168,7 +168,7 @@ export const defaultLayouts = {
|
||||
percent: 70,
|
||||
children: [
|
||||
{ type: "pane", name: "stage" },
|
||||
{ type: "pane", name: "timelineV2" }
|
||||
{ type: "pane", name: "timeline" }
|
||||
]
|
||||
},
|
||||
{ type: "pane", name: "infopanel" }
|
||||
@@ -196,7 +196,7 @@ export const defaultLayouts = {
|
||||
percent: 70,
|
||||
children: [
|
||||
{ type: "pane", name: "infopanel" },
|
||||
{ type: "pane", name: "timelineV2" }
|
||||
{ type: "pane", name: "timeline" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -223,7 +223,7 @@ export const defaultLayouts = {
|
||||
percent: 60,
|
||||
children: [
|
||||
{ type: "pane", name: "infopanel" },
|
||||
{ type: "pane", name: "timelineV2" }
|
||||
{ type: "pane", name: "timeline" }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
+1138
-26
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1179,12 +1179,12 @@ class AudioTrack {
|
||||
name: clip.name,
|
||||
startTime: clip.startTime,
|
||||
duration: clip.duration,
|
||||
offset: clip.offset || 0, // Default to 0 if not present
|
||||
};
|
||||
|
||||
// Restore audio-specific fields
|
||||
if (clip.poolIndex !== undefined) {
|
||||
clipData.poolIndex = clip.poolIndex;
|
||||
clipData.offset = clip.offset;
|
||||
}
|
||||
|
||||
// Restore MIDI-specific fields
|
||||
|
||||
+2
-1
@@ -883,7 +883,8 @@ export const nodeTypes = {
|
||||
<input type="range" data-node="${nodeId}" data-param="3" min="-24" max="24" value="0" step="1">
|
||||
</div>
|
||||
<div class="node-param" style="margin-top: 4px;">
|
||||
<button class="add-layer-btn" data-node="${nodeId}" style="width: 100%; padding: 4px; font-size: 10px;">Add Sample Layer</button>
|
||||
<button class="add-layer-btn" data-node="${nodeId}" style="width: 100%; padding: 4px; font-size: 10px; margin-bottom: 2px;">Add Sample Layer</button>
|
||||
<button class="import-folder-btn" data-node="${nodeId}" style="width: 100%; padding: 4px; font-size: 10px;">Import Folder...</button>
|
||||
</div>
|
||||
<div id="sample-layers-container-${nodeId}" class="sample-layers-container">
|
||||
<table id="sample-layers-table-${nodeId}" class="sample-layers-table">
|
||||
|
||||
+7
-1
@@ -42,6 +42,12 @@ export let context = {
|
||||
recordingTrackId: null,
|
||||
recordingClipId: null,
|
||||
playPauseButton: null, // Reference to play/pause button for updating appearance
|
||||
// MIDI activity indicator
|
||||
lastMidiInputTime: 0, // Timestamp (Date.now()) of last MIDI input
|
||||
// Metronome state
|
||||
metronomeEnabled: false,
|
||||
metronomeButton: null, // Reference to metronome button for updating appearance
|
||||
metronomeGroup: null, // Reference to metronome button group for showing/hiding
|
||||
};
|
||||
|
||||
// Application configuration
|
||||
@@ -91,7 +97,7 @@ export let config = {
|
||||
currentLayout: "animation", // Current active layout key
|
||||
defaultLayout: "animation", // Default layout for new files
|
||||
showStartScreen: false, // Show layout picker on startup (disabled for now)
|
||||
restoreLayoutFromFile: false, // Restore layout when opening files
|
||||
restoreLayoutFromFile: true, // Restore layout when opening files
|
||||
customLayouts: [] // User-saved custom layouts
|
||||
};
|
||||
|
||||
|
||||
+54
-2
@@ -213,6 +213,23 @@ button {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* Maximize button in pane headers */
|
||||
.maximize-btn {
|
||||
margin-left: auto;
|
||||
margin-right: 8px;
|
||||
padding: 4px 8px;
|
||||
background: none;
|
||||
border: 1px solid var(--foreground-color);
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.maximize-btn:hover {
|
||||
background-color: var(--surface-light);
|
||||
}
|
||||
|
||||
.pane {
|
||||
user-select: none;
|
||||
}
|
||||
@@ -675,7 +692,7 @@ button {
|
||||
margin: 0px;
|
||||
}
|
||||
#popupMenu li {
|
||||
color: var(--keyframe);
|
||||
color: var(--text-primary);
|
||||
list-style-type: none;
|
||||
display: flex;
|
||||
align-items: center; /* Vertically center the image and text */
|
||||
@@ -773,7 +790,7 @@ button {
|
||||
background-color: var(--shade);
|
||||
}
|
||||
#popupMenu li {
|
||||
color: var(--background-color);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
#popupMenu li:hover {
|
||||
background-color: var(--surface-light);
|
||||
@@ -1022,6 +1039,24 @@ button {
|
||||
animation: pulse 1s ease-in-out infinite;
|
||||
}
|
||||
|
||||
/* Metronome Button - Inline SVG with currentColor */
|
||||
.playback-btn-metronome {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.playback-btn-metronome svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
/* Active metronome state - use highlight color */
|
||||
.playback-btn-metronome.active {
|
||||
background-color: var(--highlight);
|
||||
border-color: var(--highlight);
|
||||
}
|
||||
|
||||
/* Dark mode playback button adjustments */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.playback-btn {
|
||||
@@ -1209,6 +1244,7 @@ button {
|
||||
border-bottom: 1px solid #3d3d3d;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 16px;
|
||||
z-index: 200;
|
||||
user-select: none;
|
||||
@@ -1249,6 +1285,22 @@ button {
|
||||
border-color: #5d5d5d;
|
||||
}
|
||||
|
||||
.node-graph-clear-btn {
|
||||
padding: 4px 12px;
|
||||
background: #d32f2f;
|
||||
border: 1px solid #b71c1c;
|
||||
border-radius: 3px;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.node-graph-clear-btn:hover {
|
||||
background: #e53935;
|
||||
border-color: #c62828;
|
||||
}
|
||||
|
||||
.exit-template-btn:active {
|
||||
background: #5d5d5d;
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ class TimelineState {
|
||||
this.rulerHeight = 30 // Height of time ruler in pixels
|
||||
|
||||
// Snapping (Phase 5)
|
||||
this.snapToFrames = false // Whether to snap keyframes to frame boundaries
|
||||
this.snapToFrames = true // Whether to snap keyframes to frame boundaries (default: on)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+821
-161
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user