Skip to content

fix(softwareKeyboard): retain state between toggles - #294

Open
nlsg wants to merge 4 commits into
andremichelle:mainfrom
nlsg:fix-retain-softwareKeyboard-state
Open

fix(softwareKeyboard): retain state between toggles#294
nlsg wants to merge 4 commits into
andremichelle:mainfrom
nlsg:fix-retain-softwareKeyboard-state

Conversation

@nlsg

@nlsg nlsg commented Jul 8, 2026

Copy link
Copy Markdown

retain state of the on screen keyboard: channel, octave, and velocity

Summary by CodeRabbit

  • Refactor
    • Improved the internal handling of software MIDI controls while preserving existing behavior.
    • Octave, channel, and velocity inputs continue to control MIDI note playback and pitch mapping.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 91fe6bb4-6e82-4863-af7f-c5f9d21f7cfb

📥 Commits

Reviewing files that changed from the base of the PR and between fb67cfa and 891dc86.

📒 Files selected for processing (1)
  • packages/app/studio/src/ui/software-midi/SoftwareMIDIPanel.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/app/studio/src/ui/software-midi/SoftwareMIDIPanel.tsx

📝 Walkthrough

Walkthrough

SoftwareMIDIPanel moves its clamped octave, channel, and velocity observables to module scope while preserving their use by number inputs and MIDI pitch computation.

Changes

Software keyboard state ownership move

Layer / File(s) Summary
Move clamped keyboard observables to module scope
packages/app/studio/src/ui/software-midi/SoftwareMIDIPanel.tsx
Module-level observables define clamped octave, channel, and velocity values; the component reuses them for controls and MIDI logic.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the state-retention fix for the software keyboard between toggles.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@andremichelle

Copy link
Copy Markdown
Owner

Just move octave, channel and velocity over the SoftwareMIDIPanel function. No need to create them in StudioService.

@nlsg

nlsg commented Jul 9, 2026

Copy link
Copy Markdown
Author

thanks for the feedback, i thought about it for a while now.. Since the SoftwareMIDIPanel seems to be reconstructed everytime it is shown, i don't get where the state should be held while it is absent..

first i thought i should attach the state to the #softwareKeyboardLifecycle but the Terminator implementation does not forsee holding arbitrary state accross terminations - which is probably sensical..

anyway.. im looking forward for a propper solution.. might you implement it, or give me a tip?

btw: thank you very much for creating openDAW a was awaiting a project like that, its super awsome :)

regards, nils

@andremichelle

Copy link
Copy Markdown
Owner

I meant moving them literally above the SoftwareMIDIPanel. I can do this, but that would render your PR obsolete.

@nlsg
nlsg force-pushed the fix-retain-softwareKeyboard-state branch from f8a9c77 to d7f42a9 Compare July 24, 2026 18:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/app/studio/src/ui/software-midi/SoftwareMIDIPanel.tsx`:
- Around line 37-39: Remove the trailing comma after the octave declaration in
the SoftwareMIDIPanel declarations, and ensure octave, channel, and velocity are
valid separate const statements (or declarators within one const statement).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 04b9e028-00bc-4fa1-9a9d-cb6cd944bab2

📥 Commits

Reviewing files that changed from the base of the PR and between d7f42a9 and fb67cfa.

📒 Files selected for processing (2)
  • packages/app/studio/src/service/StudioService.ts
  • packages/app/studio/src/ui/software-midi/SoftwareMIDIPanel.tsx

Comment thread packages/app/studio/src/ui/software-midi/SoftwareMIDIPanel.tsx Outdated
@nlsg

nlsg commented Jul 24, 2026

Copy link
Copy Markdown
Author

I hope that's what you ment, seems much cleaner. Thanks for beeing so patent btw.

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.

2 participants