Hi everyone,
The goal of this proposal is to discuss the alternatives to implement support for row creation to Live Data. This is part of a general process to improve Live Data usability and uses, but this specific proposal does not cover the livedata macro itself nor AWM, only row creation.
Also, while I will be using the terms rows and columns a lot, everything mentioned also applies to the card layout (so, cards and fields).
Here is the design page: https://design.xwiki.org/xwiki/bin/view/Proposal/LiveDataAddEntryAction
Right now, a lot of the requirements to support this process are already implemented in Live Data:
- the current layouts already include a
Add entrybutton, though it is disabled. - the current REST endpoints already support the
POSTrequest to add a new entry, and it just needs to be actually implemented in the livetable source.
As such, this proposal will focus on the addition process for the user. On that front, there are two main open questions for the livetable source: where to store the new data, and how to display it to the user once it has been created.
Page Creation
The data of the new entry will need to be stored in a page. There are a few alternatives I can think of when the user clicks the Add entry button:
- Ask the user for the full page location for each new row
- Ask the user only for the page name for each new row
- Use the current space
- Use a configured space in the livedata macro
- Ask for the space for the first row and keep using the same for the following ones
- Do not ask anything and auto-generate page names
- Use the current space
- Use a configured space in the livedata macro
- Ask for the space for the first row and keep using the same for the following ones
Personally, I vote for option 2.1 (which is also the current behavior of AWM) since it’s the most straightforward and intuitive to me. Option 2.2 could also be optionally implemented to cover most of the other use-cases.
There is also the question of how to ask the user for this information:
- Always open a popup at the very start of the row creation, with the field auto-focused
- Use appropriate columns if the Live Data displays them (e.g.,
doc.locationanddoc.title, the location is usually not editable but there could be an exception during the row creation process) - Enter a “row creation mode” that would add special editable columns to support this use-case.
Option 2 seems to be a decent compromise here, there is a slight overhead when the popup opens but I expect most of Live Data uses to display the page title.
Display Update
A Live Data has pagination and filters. This means that, once a user has created a new row, it might not be displayed because it is not part of the currently displayed page or it’s filtered out. There are a few ways to handle this when a new row is validated:
- Refresh the whole table, disable filters and move to the page containing the new row
- Ignore page limits and filters and simply keep displaying all the new rows until refresh, page switch or filter update
- Do nothing, once created the new data will simply disappear if not all conditions are met
I like option 2 more, I believe it’s the less distracting one when quickly inputting new rows in bulk.
Creation process proposal
We want a process that can be done entirely through keyboard once the creation button has been clicked once.
Assuming the chosen options are 2.1, 2, 2, an ideal creation process could be:
- Click the row creation button (
Add entry) - Depending on whether or not the Live Data displays
doc.title, either make it editable or open a popup - The new row appears and the first editable column is opened in edit mode and focused
- Tab and Shift+Tab can cycle between the columns. If the editor for the current cell displays a list, the list elements must first be cycled through to reach the other columns
- The new row will be created once validated. This can be done through a few different actions:
- Cycling with Tab until the user exists the row and reaches the creation button again
- Pressing Return
- Pressing Ctrl+Return, which will also create a new row and loop back to step 1
What do you think? Feel free to suggest any other alternatives I might have missed and/or ask for clarifications.
Thanks.