Commit Graph

289 Commits

Author SHA1 Message Date
3dtours 66eef405a7 FIX: tăng velocity thêm tính năng midi key khác sử dụng cho midi note 2026-07-29 22:34:05 +07:00
3dtours 971dad84e7 FEAT: thêm tính năng midi key khác sử dụng cho midi note 2026-07-29 22:25:21 +07:00
3dtours 4cead1010e FEAT: thêm tính năng hiển thị ở master track 2026-07-29 22:13:54 +07:00
3dtours 7b5d4bf27a FEAT: thêm tính năng MasteringModules Modal 2026-07-29 22:03:20 +07:00
3dtours 47af85c072 FIX: sửa UNDO/REDO bị lỗi màn hình đen 2026-07-29 18:19:02 +07:00
3dtours a1767e338a fix: Select Instrument stays open after picking instrument
Remove setInstrumentSelectorTrackId(null) from
setTrackInstrumentWithProgram. Modal stays open so user can
switch tracks and assign instruments without reopening.
2026-07-29 11:56:26 +07:00
3dtours 8051cf3edb fix: add missing aiTypeaheadRef definition 2026-07-29 11:52:49 +07:00
3dtours 35e767795a fix: Synth button opens modal with inline track selector
Remove external track dropdown. Add select dropdown inside the
instrument selector modal between title and search box. Users
can switch tracks without closing the modal.
2026-07-29 11:52:12 +07:00
3dtours 7bfdd72850 feat: Synth button shows track dropdown for quick instrument assign
Synth button opens a dropdown listing all tracks instead of opening
the modal directly. Selecting a track opens the instrument selector
for that track. No need to close modal and click each track's Synth.
2026-07-29 11:49:34 +07:00
3dtours 41b5a70a60 fix: AI SUGGEST auto-updates after saving preset in manager
Add aiPresetVersion counter. Increment on modal close. AI panel
compares version and calls loadPresets() to sync from localStorage.
2026-07-29 11:45:31 +07:00
3dtours a3e681afc0 fix: re-fetch instrument data after login for new machines
Auth success handler now eagerly loads instrumentSelectorData
via listPlugins + getSoundfontCatalog. The mount-time useEffect
runs before auth token is set, so it silently fails on new machines.
2026-07-29 11:34:50 +07:00
3dtours d4262acb9f fix: rewrite drag handler with stable crossOffset + outTracks merge 2026-07-29 11:13:31 +07:00
3dtours e40fdf15ad fix: use original baseTrackId for crossOffset, never update drag.trackId 2026-07-29 11:10:59 +07:00
3dtours 0d763c5a0b fix: targetTrackId undefined outside updateActiveTracks closure
Move track Y-position computation before updateActiveTracks so
targetTrackId is accessible for setDraggedSectionItem update.
2026-07-29 11:09:05 +07:00
3dtours ad6fa1feb9 fix: auto-add tracks when drag exceeds track count
Compute maxTargetIdx across all multiIds items. Prepend new
tracks to prev array before mapping if needed.
2026-07-29 11:08:11 +07:00
3dtours 9abb0e6a50 fix: cross-track drag computes target from mouse Y position
Replace hoveredTrackIdRef with Y-position calculation through
track heights from prev state. Works reliably during drag.
2026-07-29 11:03:30 +07:00
3dtours 6c6a326b7d fix: single-item cross-track drag
Each track filters the item independently. Only target track
receives the inserted item. Removes duplicate state update.
2026-07-29 11:02:03 +07:00
3dtours 8e8fc58082 fix: group drag uses original trackId for offset math
Store trackId in multiIds at drag start. Each item computes
target from original track + crossOffset, immune to stale state
from previous drag events. Track 1 item drags n tracks -> track
1+n, track 2 item -> track 2+n, etc.
2026-07-29 11:00:51 +07:00
3dtours ec355da58d fix: group drag cross-track uses live prev state for index mapping
Build trkIds from prev (updateActiveTracks callback) instead of
stale activeTracksRef. Fix srcItem lookup with proper for loop.
2026-07-29 10:55:39 +07:00
3dtours 9c3a435f26 fix: group drag cross-track maintains relative track offsets
Each item computes its own target track as srcIdx + crossOffset.
Items from different source tracks land on different target tracks,
preserving the group's vertical layout shape.
2026-07-29 10:52:50 +07:00
3dtours 12d2639455 fix: group drag keeps items on their original tracks
Remove all cross-track logic in multiIds path. Each item only
updates its time position (delta) on its current track. No
merging or track reassignment.
2026-07-29 10:50:37 +07:00
3dtours e99bc8624f fix: group drag moves all items, clamp to track 0, auto-add track
Restore multiIds cross-track move for all selected items.
Clamp targetTrackId to first track. Auto-add new track via
addNewTrack() when dragging below the last track.
2026-07-29 10:47:53 +07:00
3dtours 9869566d3e fix: multi-item drag no longer merges all items into target track
Only the dragged item (drag.itemId) crosses tracks. Other selected
items stay on their original tracks and only move horizontally.
2026-07-29 10:42:42 +07:00
3dtours e544d5e694 fix: show all presets always, no filter by selection
Remove selection-based filter entirely. Suggestions list stays
stable across select/deselect — no preset appears at top when
deselecting.
2026-07-29 10:18:47 +07:00
3dtours 614d83b971 fix: filter excludes non-rearrange presets in AI suggestion list
Remove || p.is_favorite from filter when MIDI item selected.
Only presets with category === 'Rearrange / Variation' appear.
2026-07-29 10:17:36 +07:00
3dtours 895ad0b7d9 fix: restore AI suggestion filter by selection, cache PromptTemplateManager
Cache PromptTemplateManager in ref to prevent new instance per
render. Filter: show only Rearrange/favorites when MIDI item
selected, all presets otherwise. Root cause of 'suggestion added
at top' was stale array reference from new instance every render.
2026-07-29 10:11:10 +07:00
3dtours 98ca21bd9a fix: AI Suggestion list changing on item select/deselect
Always show full preset list instead of filtering to rearrange/
favorites when item selected. Prevents suggestion list from
visually changing during selection/deselection.
2026-07-29 10:08:05 +07:00
3dtours 5ed943b3d6 fix: stuck MIDI notes when ARM toggled off mid-note
Remove !st.isArmed guard in note-off handler. Stop note on ALL
tracks regardless of ARM state — FluidSynth stopNote on inactive
channel/pitch is a no-op, so this is safe.
2026-07-29 10:02:30 +07:00
3dtours b00f0cff95 feat: mixer VU meter, fader scaling, track name color
- Master strip: add fader placeholder + VU meter bar
- MixerStrip: items-end -> items-stretch so fader + VU fill height
- VU meter: bar height maps volumeDb, color green/amber/red
- Track name uses track.color instead of fixed text-zinc-400
2026-07-29 09:54:18 +07:00
3dtours 2187440681 feat: Mixer Panel display-only with F7 toggle
Add MixerStrip component for display-only track strips (no audio
routing). Mixer panel at bottom with drag resize handle (80-400px).
F7 keyboard shortcut, status bar toggle button, View menu item.
onUpdateTrack handles mute/solo/volume changes directly on tracks.
2026-07-29 09:49:47 +07:00
3dtours 35fb29201d fix: AI Suggestion shows only Rearrange presets when MIDI item selected
When hasSelItem is true, suggestions filtered to only
Rearrange / Variation category + favorites.
2026-07-28 21:04:19 +07:00
3dtours 393dd7190f fix: rearrangeMidiMelody newId not defined
newId was defined inside updateActiveTracks callback but
referenced outside (line 15002 return). Moved declaration
before the callback as rearrangeNewId, accessible in both
the callback body and the outer return statement.
2026-07-28 20:58:44 +07:00
3dtours fc81f19b1c fix: MIDI rearrange tool spec double-wrapped, AI returns _unknown
REARRANGE_TOOL_SPEC already has {type:'function', function:{...}}
wrapper. callLLM's tools.map(t => ({type:'function', function:t}))
added ANOTHER wrapper, creating nested:
  {type:'function', function:{type:'function', function:{name}}}
which AI models couldn't parse -> function name became _unknown.
Fix: pass .function (inner spec) instead of the outer wrapper.
2026-07-28 20:51:27 +07:00
3dtours 61f4b90af0 feat: Action Log hidden by default, click header to toggle
- showAIActionLog state defaults to false
- Action Log header clickable (cursor-pointer), shows '-' when
  visible, '+' when hidden
- Body always rendered with CSS class 'hidden' toggled, avoids
  deep ternary nesting that exceeded Babel 8 maxTargets limit
2026-07-28 20:43:08 +07:00
3dtours 9cbf5940f4 chore: Copilot prompt textarea 8 rows 2026-07-28 20:27:58 +07:00
3dtours 4c3d649506 fix: remove preset auto-optimization from AI send paths
matchPreset was replacing systemInstruction with the preset's
template on keyword match. Typing 'epic orchestra' would
auto-apply 'Epic Orchestra Intro (8 Bars)' restrictive template.

Removed both override blocks (Piano Roll MIDI gen + DAW
rearrange). System instruction stays as generic default.
User can still fill prompt via suggestion click without
forced template override.
2026-07-28 20:26:03 +07:00
3dtours 0dc3f10406 fix: AI Copilot shows all presets in suggestion list
Change suggestions from getContextualSuggestions (filtered)
to promptMgr.presets (all). MIDI item name still shown in
header when hasSelItem is true.
2026-07-28 20:20:22 +07:00
3dtours 6a46b1ffe4 fix: AIPresetModal merge backend presets instead of overwrite
Backend sync effect (useEffect mount) was unconditionally
replacing mgr.presets with data.presets, destroying:
- Frontend-only default presets (12 vs backend's 7)
- User-defined presets in localStorage not yet synced to backend

Fix: merge backend presets by id — keep all local presets,
append any backend presets whose id doesn't exist locally.
User presets + frontend defaults are never lost.
2026-07-28 20:17:52 +07:00
3dtours 71edf7ffb3 feat: AIPresetModal - 'Người dùng' filter for user-defined presets
Add 'Người dùng' category to filter dropdown. Filter logic
checks p.is_user_defined when this category is selected.
Shows only presets the user has created/added.
2026-07-28 20:15:11 +07:00
3dtours c09ad7f48d feat: AI Copilot suggestion toggle button
Add showAISuggestions state + 'Sug' toggle button in Copilot
Prompt header. When hidden, suggestion list is unmounted
(showAISuggestions ? ... : null). Button styling: visible
state = bg-zinc-800/zinc-400, hidden = indigo-950/indigo-400.
2026-07-28 20:11:23 +07:00
3dtours ad29df46d2 fix: AI suggestion list shows only rearrange presets for MIDI item
Use suggestions (filtered by getContextualSuggestions) instead
of promptMgr.presets (all). When MIDI item selected, only
Rearrange/Variation + favorites shown. When no MIDI item,
non-rearrange presets shown instead.
2026-07-28 20:09:45 +07:00
3dtours 2a9748e12e feat: AI Copilot panel - full scrollable preset list + MIDI item name
Replace horizontal suggestion chips (max 6/4) with vertical
scrollable list (max-h-36, no-scrollbar) showing ALL presets
from PromptTemplateManager (capped at 50). Header shows
'AI Suggestion' label. When MIDI item selected, MIDI item
name displayed in header. Each preset shows star/fav icon,
name, and category tag. Click fills the prompt textarea.
2026-07-28 20:07:29 +07:00
3dtours bb49035bee fix: sửa lỗi xóa track khi nhấn phím Del, đúng là phải xóa items được chọn 2026-07-28 19:34:47 +07:00
3dtours 10c0a743c6 feat: CC lane dropdown with Velocity, Sustain, Modulation, Pitch Bend, Pan
Replaced flex div with velocity/pan buttons with a
<select> dropdown containing 5 CC type options.
Default: Velocity. Button toggle shows short label.
2026-07-28 10:20:52 +07:00
3dtours f0b62d5a1c fix: Ctrl+S in SECTION-TAB stale closure, saveSectionTab uses initial sessionTabs
Keyboard handler (useEffect [] deps) captures handleSaveSectionTab
from first render, which has sessionTabs = []. When section tab
is opened later, saved handleSaveSectionTab finds no tab and
returns silently. Added handleSaveSectionTabRef, updated on
every render, used in keyboard handler via ref.current.
2026-07-28 10:13:28 +07:00
3dtours b5f3f987b7 fix: Ctrl+click empty space starts sweep select with yellow cursor
Line 1163 called onSweepSelectStart which set up sweep
state (yellow selection rectangle). Mousemove then
selected all items in the sweep range. Changed to
onClearSelection = () => setSelectedItemIds(new Set())
which only clears selection without starting sweep.
2026-07-28 10:10:05 +07:00
3dtours 5ec329933a fix: Ctrl+S in SECTION-TAB exports SF instead of saving section
First Ctrl+S handler (line 8066, handleExportSFS) catches
ALL Ctrl+S before second handler (line 8157, save section)
ever runs. Moved section-tab check into first handler:
activeTab.startsWith('session_') -> handleSaveSectionTab.
Main session Ctrl+S still exports SF (same as before).
2026-07-28 10:07:02 +07:00
3dtours aafc750274 fix: sub-tab keyboard block captures Ctrl+A/S in SECTION-TAB
Line 7942 checked activeTabRef.current !== 'main', which
is true for SECTION-TAB (session_xxx). Sub-tab block
only handles audio/image keys then unconditionally
returns at line 8005 -> Ctrl+A/S never reached.
Changed to exclude section tabs via
!activeTabRef.current.startsWith('session_').
2026-07-28 10:03:46 +07:00
3dtours 62a41d4502 fix: Ctrl+S saves section in SECTION-TAB, Ctrl+A selects all items
Ctrl+S in SECTION-TAB (activeTab starts with session_):
calls handleSaveSectionTab(curTab).
Ctrl+A in MAIN/SECTION-TAB: collects sections, midiItems,
clips from activeTracksRef.current into selectedItemIds.
Ignores sub-tab contexts (PIANO_ROLL).
2026-07-28 09:59:13 +07:00
3dtours 385d62cfaf fix: Insert Section visible in SECTION-TAB context menu
JSX rendering menu at line 17500 lacked the
!sessionTabs.some(s => s.id === activeTab) guard.
Added it - section tab context menu no longer offers
Insert Section (sections cannot contain section items).
2026-07-28 09:55:37 +07:00