[MGNLUI-7152] Columns in content app not adapting correctly when minimizing actionbar the first time Created: 13/May/22  Updated: 25/Apr/23  Resolved: 18/Apr/23

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.18
Fix Version/s: 6.3.0, 6.2.33

Type: Bug Priority: Neutral
Reporter: Mercedes Iruela Assignee: Sang Ngo Huu
Resolution: Fixed Votes: 3
Labels: VN-Analysis
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 5d 1.5h Time Spent: 3d 5.5h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: File Responsive columns.webm     PNG File image-2023-03-10-11-56-39-272.png     PNG File screenshot-1.png    
Issue Links:
Relates
dependency
depends upon MGNLUI-7907 Investigate to recalculate grid on re... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-7985 Implement Sub-task Completed Sang Ngo Huu  
MGNLUI-7986 Review Sub-task Completed Adam Siska  
MGNLUI-7987 Pre-int QA Sub-task Completed Adam Siska  
MGNLUI-7988 QA Sub-task Completed Jaromir Sarf  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Date of First Response:
Epic Link: AuthorX Support
Sprint: Nucleus 34
Story Points: 2
Team: Nucleus
Work Started:
Approved:
Yes

 Description   

This is reproducible on demo-author

Steps to reproduce:

  1. Open link
  2. Reload with cache refresh (ctrl+f5 or on mac cmd+shift+r)
  3. Minimize Actionbar

Current:
now as a result there is a white space where the actionbar has been

Expected
Columns' width is adapted correctly when the action bar is minimized.

Workaround
Maximize + Minimize again -> page is displayed correctly again. It only happens the first time the actionbar is minimized.



 Comments   
Comment by Quach Hao Thien [ 10/Mar/23 ]

Discovery

When the Actionbar is collapse for the first time, the ContentViews that contains the Grid, is expanded as expected, but the Grid's width is not recalculate, but keep the same value as before expanded

The reason is, the LayoutManager didn't add the GridConnector to ManagedLayout (layout should be measure in need), and hence the Grid's width was not recalculated as well

But after expand the Actionbar, the LayoutManager adds GridConnector to the list ManagedLayout, so from now on, for every change to layout, the grid will be recalculated.

This could be a bug of vaadin when the grid doesn't work well with expandable layout.

What to do

There are 2 approaches:

  1. Find a proper way to add the GridConnector to LayoutManager com.vaadin.client.LayoutManager#setNeedsHorizontalLayout. This approach requires the understanding of how LayoutManager work.
    pros and cons: cannot prove whether it works
  2. Using Rpc to send an event from ActionbarConnector to tell UI repaints the workbench after the Actionbar is collapsed (e.g using workbench.markAsDirtyRecursive())
    • pros: fix the problem
    • cons: not ensure the performance if the workbench has too many component

Ref: https://stackoverflow.com/questions/69563132/vaadin-grid-recalculatecolumnwidths-problems-how-to-make-it-more-consistant

Comment by Quach Hao Thien [ 29/Mar/23 ]

done poc: https://jira.magnolia-cms.com/browse/MGNLUI-7907

Generated at Mon Feb 12 09:43:37 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.