Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] web_chatter_position: implement feature on controller and add switch button #3040

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

trisdoan
Copy link
Contributor

Context

  • The Switch Button was dropped during migration to 16.0, which I assumed it was due to the approach taken at that time.
    • In Odoo 15, the position was patched in Controller and Renderer and adjusted by DOM
    • In Odoo 16, it was chosen to do it via Compiler, which the component (Form) needs to be destroyed to re-trigger the Compiler.
    • There was a comment about it but probably missed.

This changes

  • Revert to the approach implemented on Odoo 15.0: by taking advantage of OWL cycles
  • Re-introduce the switch button

Result

  1. No Attachment present
web_chatter_result.webm
  1. Attachment present
    web_chatter_result-(2).webm

@trisdoan
Copy link
Contributor Author

Hello @ivantodorovich, would you mind taking a look at this

@trisdoan trisdoan changed the title [IMP] web_chatter_position: implement feature on controller and add switch button [16.0][IMP] web_chatter_position: implement feature on controller and add switch button Dec 26, 2024
@trisdoan trisdoan force-pushed the 16.0-imp-web_chatter_position-add-switch-button branch from 6943a08 to 21e030a Compare December 27, 2024 07:46
@trisdoan trisdoan marked this pull request as draft December 27, 2024 09:52
@trisdoan
Copy link
Contributor Author

trisdoan commented Dec 27, 2024

DRAFT: event listeners are lost when chatter is at the bottom

@trisdoan trisdoan force-pushed the 16.0-imp-web_chatter_position-add-switch-button branch from 21e030a to 4ec2e8b Compare December 30, 2024 03:55
@trisdoan trisdoan marked this pull request as ready for review December 30, 2024 03:55
@fanha99
Copy link
Contributor

fanha99 commented Dec 30, 2024

nice

@ivantodorovich
Copy link
Contributor

Hello!

Thanks for your contribution!

I remember this was an intentional compromise to keep it simple. Hopefully you find a way to achieve it, though.

Did a few functional tests, and unfortunately it doesn't seem to work properly. The side panel show on smaller screens.

Screen.Recording.2025-01-07.at.9.39.24.AM.mov

@trisdoan trisdoan force-pushed the 16.0-imp-web_chatter_position-add-switch-button branch 2 times, most recently from 79f985c to 21714b6 Compare January 8, 2025 05:13
@trisdoan trisdoan force-pushed the 16.0-imp-web_chatter_position-add-switch-button branch from 21714b6 to 2bbf73f Compare January 8, 2025 05:17
@trisdoan
Copy link
Contributor Author

trisdoan commented Jan 8, 2025

Hello @ivantodorovich, I updated the code, how does it look to you?

Why it happened

  • When option is sided and the screen is small (particularly smaller than XXL), the chatter is hidden.

Solution

  • Add a check (if the screen is big enough) before patching the position of the chatter. If it's too small, let the chatter handled by standard
  • Add class: d-none d-xxl-inline-block to hide the switch dynamically whenever the screen is too small

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