XWIKI-24755: XClass properties can only be reordered with a mouse in the class editor - #6267
Draft
Sereza5 wants to merge 2 commits into
Draft
XWIKI-24755: XClass properties can only be reordered with a mouse in the class editor#6267Sereza5 wants to merge 2 commits into
Sereza5 wants to merge 2 commits into
Conversation
…the class editor * Added a reorderControls widget adding a move up and a move down button to each item of a list * Made both buttons move the item on click and on the up and down arrow keys * Announced the new position of the moved item in a live region * Announced that the item is already at the end of the list it is moving towards * Replaced a pending announcement when a new move is performed * Replaced the class editor move handle span with that widget * Removed the default border and padding of the move buttons * Left room for the focus indicator of the last property tool * Documented that the sortable keeps its default cancel option to protect the move buttons * Added the move up and move down translation keys * Deprecated the moveProperty.handle.label translation key * Added the property move actions and the move button getters to ClassEditPage * Started the property drag from the property title in movePropertyBefore * Added reorderPropertyWithoutDragging to EditClassIT
Contributor
Author
|
Started a forum post at https://forum.xwiki.org/t/proposal-move-up-move-down-buttons-in-the-class-editor/18809 to discuss the changes proposed here, since it impacts the UI in a meaningful way. |
…the class editor * Replaced the default cursor of a property title with a grab cursor * Added a grabbing cursor while a property is dragged * Set the pointer cursor on the property tools * Added vertical padding to the property title * Set the grab cursor on the whole Live Data column name * Removed the pointer cursor of the Live Data sort icon
Contributor
Author
|
Pushed What changed
Tests
Worth noting for whoever runs the node build: Left to do: one last check with the skill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira URL
https://jira.xwiki.org/browse/XWIKI-24755
Changes
Description
reorderControlswidget (uicomponents/widgets/reorderControls.js, registered asxwiki-reorder-controls), adding a move up and a move down<button>to each item of a list. A button moves its item on a click or tap and on the up and down arrow keys, keeps the focus so moves can be chained, and announces the new position in a shared polite live region.<span class="tool move">drag handle. The widget'sonMovecallback persists the change, so drag and drop and the buttons both end up in the existingupdateOrder()and the hiddenNumberfield stays in sync.Move property <name> up), mirroring the delete tool.overflow: hiddenwas clipping the last tool's focus indicator.core.editors.class.moveProperty.handle.labelis deprecated in place, and the fourmoveProperty.up/down.text/tooltipkeys are added.Clarifications
sortablekeeps its defaultcancel, which excludes buttons, so an imprecise tap can never become a drag, which would defeat the point for the users SC 2.5.7 protects. Dragging still works from the property title, whereClassEditPage.movePropertyBeforenow starts it.uicomponents/dashboard/dashboard.js) are still pointer-only and the natural next consumer. The object editor would follow once XWIKI-5671 has a persistence model, which is out of scope here: an xobject's number is its reference and oldcore has no renumber API, so it needs a design decision first.keyboardDragNDrop(), XWIKI-21009); this widget targets plain DOM lists. TheNumbermeta-property stays hidden, since the order is now operable without it.Screenshots & Video
The actions of a property title, on a class holding three properties: the delete link with the single drag handle, then the delete link with the two move buttons.
Executed Tests
Built the changes with:
mvn clean install -Plegacy,integration-tests,qualityonxwiki-platform-web-war,xwiki-platform-flamingo-skin-resourcesandxwiki-platform-test-ui-- BUILD SUCCESS, 0 Checkstyle violations.mvn checkstyle:check@default checkstyle:check@test -Pdocker,integration-testsonxwiki-platform-flamingo-skin-test-docker-- 0 violations on both rulesets.mvn test-compile -Plegacy,docker,integration-testson the same module -- BUILD SUCCESS.Then tested them with:
mvn verify -Pdocker,integration-tests,legacy -pl <flamingo-skin-test-docker> -Dxwiki.test.ui.servletEngine=tomcat -Dxwiki.test.ui.database=postgresql -Dit.test='EditClassIT#reorderProperty+reorderPropertyWithoutDragging'--2/2tests pass.reorderPropertyWithoutDraggingis new: both controls arebuttonelements with the expected screen-reader name and tooltip, a click moves the property up and down and leaves the focus on the button, the first property cannot move up and the last cannot move down, the arrow keys work on both buttons, and the new order survives a save and reload.reorderPropertyis the pre-existing drag and drop test, kept green now that the handle is gone and the drag starts from the property title.Expected merging strategy