Skip to content

Conversation

@rmbh-odoo
Copy link
Contributor

Description:

Steps to reproduce:

  • Open the CF side panel and edit a StandaloneComposer inside a color scale.
  • Switch the sheet. The panel closes, so the composer is unmounted.
  • Previously, the composer remained in editing mode after unmount.

Current behavior before PR:

  • Unmounting the composer did not set editionMode to inactive.
  • This caused focus issues in other parts of the UI.

Desired behavior after PR is merged:

  • Unmounting the composer sets editionMode to inactive.
  • Focus and selection are now properly released.

Task: 5149215

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Oct 10, 2025

Pull request status dashboard

this.cancelEditionAndActivateSheet();
}

deactivateComposer() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The composer could/should clean itself.
Something like this seems to be working

diff --git a/src/components/composer/composer/abstract_composer_store.ts b/src/components/composer/composer/abstract_composer_store.ts
index edc1e0bce..83fdf0854 100644
--- a/src/components/composer/composer/abstract_composer_store.ts
+++ b/src/components/composer/composer/abstract_composer_store.ts
@@ -93,6 +93,7 @@ export abstract class AbstractComposerStore extends SpreadsheetStore {
     this.highlightStore.register(this);
     this.onDispose(() => {
       this.highlightStore.unRegister(this);
+      this._cancelEdition();
     });
   }
   protected abstract confirmEdition(content: string): void;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I didn’t know about this
Thanks for pointing it out! Learned something new today 😄

});
});

test("Composer becomes inactive when unmounted", async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you write a test that's showing the actual behavior (with the CF and sheet change) ?

Steps to reproduce:
- Open the CF side panel and edit a StandaloneComposer inside a color scale.
- Switch the sheet. The panel closes, so the composer is unmounted.
- Previously, the composer remained in editing mode after unmount.

Before this commit:
- Unmounting the composer did not set editionMode to inactive.
- This caused focus issues in other parts of the UI.

After this commit:
- Unmounting the composer sets editionMode to inactive.
- Focus and selection are now properly released.

Task: 5149215
@rmbh-odoo rmbh-odoo force-pushed the saas-18.2-fix-composer-unmount-inactive-rmbh branch from b13fa84 to a93564c Compare October 24, 2025 17:52
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.

3 participants