Skip to content

feat(spx-gui): move sound editor into stage editor tabs and add stage quick entries#2927

Merged
nighca merged 8 commits intogoplus:devfrom
cn0809:issue-2925
Mar 12, 2026
Merged

feat(spx-gui): move sound editor into stage editor tabs and add stage quick entries#2927
nighca merged 8 commits intogoplus:devfrom
cn0809:issue-2925

Conversation

@cn0809
Copy link
Copy Markdown
Collaborator

@cn0809 cn0809 commented Mar 10, 2026

close: #2925

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the user interface and underlying state management for sound editing within the SPX GUI. By integrating sound management directly into the Stage Editor as a dedicated tab and introducing quick access buttons on the Stage Panel, the changes aim to streamline the user workflow and improve the overall organization of editing functionalities. This consolidation enhances the user experience by providing a more intuitive and accessible way to manage project sounds alongside other stage-related assets.

Highlights

  • Sound Editor Relocation: The sound editing functionality has been moved from a standalone top-level editor and panel into a dedicated tab within the Stage Editor, consolidating sound management under the stage context.
  • Stage Quick Entry Buttons: The Stage Panel now features quick entry buttons for 'Widgets', 'Sounds', and 'Backdrops', providing direct access to these sections within the Stage Editor.
  • Refactored State Management: The internal EditorState and StageEditorState have been updated to reflect the new hierarchy, with sound selection and management now handled by StageEditorState.
  • Component Reorganization: All sound-related Vue components (e.g., SoundPlayer, SoundRecorder, SoundItem) have been physically relocated to the spx-gui/src/components/editor/stage/sound/ directory.
  • UI Color Update: The UI color token associated with 'sound' elements has been changed from purple to blue for a more consistent visual experience.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • spx-gui/src/components/asset/BlobSoundPlayer.vue
    • Updated import path for SoundPlayer component.
  • spx-gui/src/components/asset/index.ts
    • Updated import path for SoundRecorderModal component.
  • spx-gui/src/components/asset/library/SoundItem.vue
    • Updated import path for SoundPlayer component.
  • spx-gui/src/components/asset/library/SoundPreview.vue
    • Updated import path for SoundPlayer component.
  • spx-gui/src/components/asset/library/management/SoundItem.vue
    • Updated import path for SoundPlayer component.
  • spx-gui/src/components/editor/ProjectEditor.vue
    • Removed SoundEditor component and its import.
    • Adjusted conditional rendering for SpriteEditor.
  • spx-gui/src/components/editor/code-editor/ui/resource/ResourceItem.vue
    • Updated import path for SoundItem component.
  • spx-gui/src/components/editor/editor-state.test.ts
    • Removed assertions related to selectedSound being null.
    • Removed test cases for selecting sound by ID and name.
    • Updated test cases to reflect sound selection being managed by stageSelected.
    • Removed test case for handling non-existent sound ID.
    • Updated test case for sound removal to check stageState.selectedSound.
    • Updated test case for empty project sound selection.
  • spx-gui/src/components/editor/editor-state.ts
    • Removed 'sound' from SelectedType enum.
    • Removed 'sound' type from Selected interface.
    • Updated EditorState constructor to pass sounds getter to StageEditorState.
    • Removed logic for auto-selecting sounds.
    • Removed selectedSoundIdRef and selectedSound getter.
    • Updated selected getter to remove 'sound' case.
    • Modified select method to remove 'sound' target type.
    • Modified selectByName method to remove 'sound' target type.
    • Updated selectSound method to delegate to stageState.selectSound.
    • Updated selectResource method for Sound to use selectSound.
    • Updated comments for route history scenarios.
  • spx-gui/src/components/editor/panels/EditorPanels.vue
    • Removed SoundsPanel component and its import.
    • Removed expanded panel logic and related watchers.
    • Updated radar description for Sprites panel.
  • spx-gui/src/components/editor/panels/sound/SoundSummaryItem.vue
    • Removed file.
  • spx-gui/src/components/editor/panels/sound/SoundsPanel.vue
    • Removed file.
  • spx-gui/src/components/editor/panels/sprite/SpritesPanel.vue
    • Removed expanded prop and related event emission.
    • Removed unused styling.
  • spx-gui/src/components/editor/panels/stage/StagePanel.vue
    • Added quick action buttons for Widgets, Sounds, and Backdrops.
    • Added openTab function to navigate stage tabs.
    • Imported new SVG icons for quick actions.
    • Added UIDivider component.
    • Updated styling for overview and added styles for quick actions.
  • spx-gui/src/components/editor/panels/stage/backdrop.svg
    • Added new SVG icon for backdrop quick entry.
  • spx-gui/src/components/editor/panels/stage/sound.svg
    • Added new SVG icon for sound quick entry.
  • spx-gui/src/components/editor/panels/stage/widget.svg
    • Added new SVG icon for widget quick entry.
  • spx-gui/src/components/editor/stage/StageEditor.vue
    • Added 'sounds' to SelectedType enum.
    • Added 'sounds' type to Selected interface.
    • Added a new UITab for 'Sounds'.
    • Updated StageEditorState constructor to initialize SoundsEditorState.
    • Added soundsState property and selectedSound getter to StageEditorState.
    • Updated selected getter to include 'sounds' case.
    • Added selectSound method to StageEditorState.
    • Updated selectByRoute and getRoute to handle 'sounds' paths.
    • Imported SoundsEditor component and Sound type.
  • spx-gui/src/components/editor/stage/sound/SoundDetail.vue
    • Renamed from spx-gui/src/components/editor/sound/SoundEditor.vue.
    • Removed EditorHeader and UITabs as it is now a detail view.
    • Renamed opeartions class to operations.
    • Updated import paths to reflect new location.
  • spx-gui/src/components/editor/stage/sound/SoundItem.vue
    • Renamed from spx-gui/src/components/editor/sound/SoundItem.vue.
    • Updated import paths to reflect new location.
  • spx-gui/src/components/editor/stage/sound/SoundPlayer.vue
    • Renamed from spx-gui/src/components/editor/sound/SoundPlayer.vue.
    • Updated import paths to reflect new location.
  • spx-gui/src/components/editor/stage/sound/SoundRecorder.vue
    • Renamed from spx-gui/src/components/editor/sound/SoundRecorder.vue.
    • Changed reload button color from 'blue' to 'boring'.
    • Changed playback button color from 'purple' to 'blue'.
    • Updated import paths to reflect new location.
  • spx-gui/src/components/editor/stage/sound/SoundRecorderModal.vue
    • Renamed from spx-gui/src/components/editor/sound/SoundRecorderModal.vue.
  • spx-gui/src/components/editor/stage/sound/SoundsEditor.vue
    • Added new component for managing sounds within the Stage Editor.
    • Implemented SoundsEditorState for sound selection and routing.
    • Includes functionality for adding sounds from local files, asset library, and recording.
  • spx-gui/src/components/editor/stage/sound/VolumeSlider.vue
    • Renamed from spx-gui/src/components/editor/sound/VolumeSlider.vue.
  • spx-gui/src/components/editor/stage/sound/waveform/WaveformDisplay.vue
    • Renamed from spx-gui/src/components/editor/sound/waveform/WaveformDisplay.vue.
    • Updated waveform stroke and fill colors to use grey tokens.
  • spx-gui/src/components/editor/stage/sound/waveform/WaveformPlayer.vue
    • Renamed from spx-gui/src/components/editor/sound/waveform/WaveformPlayer.vue.
  • spx-gui/src/components/editor/stage/sound/waveform/WaveformRangeControl.vue
    • Renamed from spx-gui/src/components/editor/sound/waveform/WaveformRangeControl.vue.
  • spx-gui/src/components/editor/stage/sound/waveform/WaveformRecorder.vue
    • Renamed from spx-gui/src/components/editor/sound/waveform/WaveformRecorder.vue.
  • spx-gui/src/components/editor/stage/sound/waveform/WaveformWithControls.vue
    • Renamed from spx-gui/src/components/editor/sound/waveform/WaveformWithControls.vue.
  • spx-gui/src/components/editor/stage/sound/waveform/index.ts
    • Renamed from spx-gui/src/components/editor/sound/waveform/index.ts.
  • spx-gui/src/components/editor/stage/sound/waveform/sum-processor.js
    • Renamed from spx-gui/src/components/editor/sound/waveform/sum-processor.js.
  • spx-gui/src/components/ui/tokens/colors.ts
    • Updated the color token for 'sound' from purple to blue.
  • spx-gui/src/models/spx/project.ts
    • Added a comment explaining why sounds are stored at the project level.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively refactors the sound editor into the stage editor tabs, which is a great improvement for the UI structure. The addition of quick entry points on the stage panel also enhances usability.

I've found one issue in SoundsEditorState related to auto-selection of sounds, which I've detailed in a specific comment. It's worth noting that the test case that would have likely caught this bug (should handle adding new sounds correctly) was removed in spx-gui/src/components/editor/editor-state.test.ts. I recommend adding a new test to cover this auto-selection behavior in the new SoundsEditorState to prevent future regressions.

Comment thread spx-gui/src/components/editor/stage/sound/SoundsEditor.vue Outdated
Comment thread spx-gui/src/components/editor/stage/StageEditor.vue
Comment thread spx-gui/src/components/editor/stage/sound/sounds-editor-state.ts
Comment thread spx-gui/src/components/editor/stage/sound/sounds-editor-state.ts Outdated
@fennoai
Copy link
Copy Markdown
Contributor

fennoai Bot commented Mar 10, 2026

Clean restructuring — moving sounds into the stage editor tabs and adding quick-entry buttons is a clear UX improvement. The backward-compat routing handling (soundsstage/sounds) is well thought out and the new SoundsEditorState follows established patterns. One bug to fix: soundsState is never registered for disposal (see inline). The await removal in copilot.ts is the correct fix.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves the sound editor from a separate top-level editor (accessible via selected.type === "sound") into the StageEditor as a dedicated tab, alongside existing Code, Widgets, and Backdrops tabs. It also adds quick-entry buttons in the StagePanel for opening Widgets, Sounds, and Backdrops tabs directly.

Changes:

  • Removed sound as a top-level SelectedType in EditorState, delegating sound selection to StageEditorState with a new SoundsEditorState class. The old SoundsPanel in EditorPanels is removed.
  • Added three quick-entry buttons (Widgets, Sounds, Backdrops) in StagePanel with SVG icons, and restructured the panels layout so SpritesPanel is always expanded.
  • Moved sound editor components from editor/sound/ to editor/stage/sound/, updated all import paths across the codebase, and changed the sound color theme from purple to blue (matching stage).

Reviewed changes

Copilot reviewed 28 out of 40 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
editor-state.ts Removed sound from top-level SelectedType; sounds now route through stage state
editor-state.test.ts Updated tests to verify sounds are selected via stageState.selectedSound
StageEditor.vue Added sounds tab and SoundsEditorState; updated StageEditorState class
sounds-editor-state.ts New SoundsEditorState class managing sound selection
SoundsEditor.vue New component rendering the sound list and detail panel
AddSoundMenu.vue New menu component for adding sounds (local file, library, recording)
StagePanel.vue Added quick-entry buttons for Widgets, Sounds, Backdrops tabs
EditorPanels.vue Removed SoundsPanel; simplified layout to Sprites + Stage panels
SpritesPanel.vue Always expanded; removed expand/collapse logic
SoundsPanel.vue Deleted (functionality moved to SoundsEditor)
SoundSummaryItem.vue Deleted (no longer needed)
ProjectEditor.vue Removed top-level SoundEditor rendering
colors.ts Changed sound color from purple to blue
WaveformDisplay.vue Updated waveform stroke/fill colors to grey tones
WaveformPlayer.vue New component for audio playback with waveform visualization
WaveformRecorder.vue New component for audio recording with waveform
WaveformWithControls.vue New component wrapping waveform display with range/cursor controls
WaveformRangeControl.vue New component for draggable range selection on waveform
VolumeSlider.vue Moved component for volume control
SoundDetail.vue Removed header tabs; updated imports for new location
SoundRecorder.vue Updated import paths and button colors
SoundRecorderModal.vue Moved component
SoundPlayer.vue, SoundItem.vue Updated import paths
copilot.ts Removed unnecessary await on postTextStream
project.ts Added documentation comment for sounds field
widget.svg, sound.svg, backdrop.svg New SVG icons for quick entries
monitor-gray.svg Deleted (replaced by UIIcon)
Various import updates Updated paths for moved sound components

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread spx-gui/src/components/editor/stage/StageEditor.vue
Comment thread spx-gui/src/components/editor/panels/sprite/SpritesPanel.vue Outdated
Comment thread spx-gui/src/components/editor/panels/stage/StagePanel.vue
Comment thread spx-gui/src/components/editor/panels/stage/StagePanel.vue
Comment thread spx-gui/src/components/editor/stage/widget/WidgetsEditor.vue
Comment thread spx-gui/src/components/editor/editor-state.test.ts
tilemap?: Tilemap | null
sprites: Sprite[]
// Sounds are kept at the project level (not in Stage) because sprite animations
// reference sounds by ID, and `removeSound` must clean up those cross-sprite references.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这么着感觉不是个事儿

这里 animation 与 sound 的关系本质上跟 monitor 那个 PR 中 monitor 与 sprite 的关系类似,但是现在是在用两种不同(且都比较将就)的方式来解决

长远来看还是得有个更可靠的不用在逻辑组织方式上妥协的方案,我单独记个 issue 跟进下吧

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracked in #2941: #2941

Comment thread spx-gui/src/components/editor/panels/stage/StagePanel.vue Outdated
@nighca nighca merged commit b94043f into goplus:dev Mar 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move SoundEditor into StageEditor tabs and add stage quick entries

3 participants