Page MenuHomePhorge

Allow collapsing/expanding workboard column content by clicking its header
Needs ReviewPublic

Authored by aklapper on Mon, May 27, 21:37.
Tags
None
Referenced Files
F2243892: D25672.1719466970.diff
Wed, Jun 26, 05:42
Unknown Object (File)
Mon, Jun 24, 02:22
Unknown Object (File)
Sun, Jun 23, 22:47
Unknown Object (File)
Sun, Jun 23, 22:47
Unknown Object (File)
Sun, Jun 23, 22:47
Unknown Object (File)
Sun, Jun 23, 22:47
Unknown Object (File)
Sun, Jun 23, 22:47
Unknown Object (File)
Sun, Jun 23, 22:47

Details

Summary

Reduce users' need for scrolling on smaller screens with 920px or less viewport width by using HTML5's <details>/<summary> so clicking on a workboard column header hides the content of that column. Keep expanding its content by default.

On mobile devices, display an arrow in the column header box below the header text to potentially make those users aware of this functionality that benefit the most from it. Do not render these arrows on tablets or desktop devices (though the collapse/expand functionality still works there).

See https://caniuse.com/details for browser (in)compatibility.

Closes T15843

Test Plan

Go to a project workboard with several columns and tasks in them on a screen with 920px or less width. See a small arrow below the column header text. Click on a column header to collapse and expand the column content.

Diff Detail

Repository
rP Phorge
Branch
workboardColumnCollapse (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1331
Build 1331: arc lint + arc unit

Event Timeline

Obviously this is very WIP (but still works).

For example, I have no idea how not to apply this functionality to desktop view.

Also, what happens in an ancient browser? https://caniuse.com/details

Very cool!

Not sure if we prefer to make isCollabsable a property of the base classes, instead of making them non-final - we have a lot of these kinds of properties going around. 🤷‍♂️

For ancient browsers, IIRC, the fallback is just to show both parts without the "details" section being collapsible. Curios to see how this renders though - is the toggle button pretty? Can it be customized?

There are 2 places where we differentiate "small screen" - most things happen just with CSS, but there's something that happens in the PHP code - I think Home has that (It used to only show the menu), and possibly Differential Revision page. I think there's no JS element that triggers on load and checks for width, but I could be wrong.
Naturally, stuff that happens in PHP isn't "responsive" for dynamically changing the viewport size.
But I also don't think it's that important not to enable this on Desktop? Assuming the default state is "open".

Not sure if we prefer to make isCollabsable a property of the base classes, instead of making them non-final

Uhm, very good point. Yes! I obviously forgot everything about object oriented programming from many years ago. :-/

Add PHPDoc for setCollapsible

Display custom collapse/expand arrows only on mobile screens; display them after the column header name instead of before

Avoid non-ASCII bytes in CSS by using FontAwesome

IMHO this is ready to review.

Only issue remaining is backwards compatibility for browsers not understanding <summary> and <details>. https://stackoverflow.com/questions/22644268/details-and-summary-tag-compatibility-issues was not too useful either.

See https://caniuse.com/details - YMMV but I'd say I do not want to care too much about folks still using IE11, Firefox 48, Chrome 11, Edge 18, Android browser 3, Safari 5.1, or Opera Mini.

aklapper edited the test plan for this revision. (Show Details)

Use consistent class scope; fix a typo

Use consistent CSS scopes. Tested. And really really last change for now. I think.