tg icon indicating copy to clipboard operation
tg copied to clipboard

Entity Centre: floating and D'n'D for Insertion Points

Open 01es opened this issue 1 year ago • 0 comments

Description

Insertion Points (IPs) have their designated placement as part of the overall Entity Centre layout. They can be resized vertically and expanded to full screen.

As the next step in the evolution of IPs, it is required to support:

  • [x] 1. Ability to float an Insertion Point by unsnapping it. Floated IP should behave identical to an Entity Master - be resizable, minimisable, movable, expendable. The dimensions of a floated IP should be the same as it was before floating, but its position should be centred.

    A floatable IP should remain associated with its Entity Centre (i.e., be visible only when its centre is in view) and it should be possible to snap the IP back to its last position (let's call this "snap position"), having the height set to the same value it had before being floated (unsnapped).

    Additional title bar buttons are required to enable floating and snapping IP back to its last snap position.

  • [x] 2. Ability to minimize/restore an Insertion Point while snapped. This would be analogous to how minimise/restore works for Entity Master, but the IP would remain snapped in place and restoring would revert only the height. IPs below the minimised IP would move up, and down when restored.

  • [x] 3. Ability to change a snap position for IPs. Users should be able to D'n'D a snapped IP by its title bar above or below of any other IP. The width of the dropped IP should attain the width of the target section, while the height should remain, potentially pushing IPs below further to the bottom.

    Once dropped, the new snap position should become the last snap position for that IP.

    There should be a visual indication (e.g., a horizontal line) of where an IP is going to be snapped once dropped.

    Ability to change a snap position for IPs should be a configurable option and be disabled by default. API method .withCustomisableLayout() should be called to enable this option.

  • [x] 4. Restoration of dimensions associated with double-tapping the bottom right corner should restore the dimensions, and if in floated state, the position (i.e., centered). There is no need to snap a floated IP back to its last snap position.

All manipulations with IPs should be stored locally in order to be able to restore the state after reloading the application in the browser.

Change overview

Entity Centres that have insertion points can now be configured to support customisation of the layout (placement) for the insertion points, so that the user could drag and drop an insertion point into any other snap position. To enable this capability simply call .withCustomisableLayout() after all insertion points are defined.

Note: One should be careful when enabling custom layout for insertion points. In some cases it might work not like expected, because some of the insertion points might contain components which have implemented drag'n'drop event listeners. The implementation of these event listeners might conflict with insertion point drag'n'drop implementation on entity centre. Therefore, before enabling custom insertion point layout, one should enhance drag'n'drop implementation for the inner components of the insertion points not to accept an insertion point being dragged.

Expected outcome

Improved control by users over the size and position of Insertion Points.

01es avatar Jun 13 '24 02:06 01es