Skip to content

fix(main-editor): report the tune editor to the sub-editor callbacks - #886

Merged
hm21 merged 1 commit into
stablefrom
fix/tune-editor-open-callback
Oct 9, 2026
Merged

hm21 merged 1 commit into
stablefrom
fix/tune-editor-open-callback

Conversation

@hm21

@hm21 hm21 commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Description

Problem. onOpenSubEditor, onStartCloseSubEditor and onEndCloseSubEditor reported the tune editor as SubEditor.unknown. openTuneEditor pushes the editor inside a HeroMode, so openPage's page is TuneEditor check never matched. The T is ... checks next to the page checks could not help either: T is a type argument, so T is TuneAdjustmentMatrix compares a Type object with a class and is always false. An app that reacts to the opened sub-editor, for example to reset the canvas zoom or show its own tune controls, had to special-case the tune editor at every call site.

Changes.

  • openPage looks through a HeroMode before checking the editor type.
  • The always-false T is ... checks are removed; the detection now relies on the page type alone, which is what already matched for every other editor.

Tests. In main_editor_test.dart, opening the tune editor reports [SubEditor.tune] to onOpenSubEditor. Before the fix it reported [SubEditor.unknown].

Verification.

  • flutter test (920) and flutter analyze pass on Flutter 3.47.2.
  • Galaxy S26, in an app that resets its canvas zoom from onOpenSubEditor for the paint, filter and tune editors: before, opening the tune editor from a zoomed canvas left the zoom in place; after, the canvas resets like it does for the other two.

Version bumped to 14.10.2 with a changelog entry.

Related Issue: none

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

openTuneEditor pushes the tune editor inside a HeroMode, so the
`page is TuneEditor` check in openPage never matched and onOpenSubEditor,
onStartCloseSubEditor and onEndCloseSubEditor reported SubEditor.unknown.
openPage now looks through the HeroMode. The `T is ...` checks next to it
compared a Type with a class and were never true, so they are dropped.
@hm21 hm21 self-assigned this Oct 9, 2026
@hm21
hm21 marked this pull request as ready for review October 9, 2026 07:50
@hm21
hm21 merged commit 97f5224 into stable Oct 9, 2026
3 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.

1 participant