Adding a properties from Live Data tables

Hi everyone,

I’d like your feedback on a design for adding a property to a class directly from a Live Data table, and removing it again (XWIKI-25519).

Why: today, adding a column to a table backed by a class means leaving the page, opening the class editor, adding the property, and coming back. Rows can already be added from Live Data (XWIKI-17627).

Full proposal: https://design.xwiki.org/xwiki/bin/view/Proposal/AddapropertyfromLiveData

Adding a property

The new column is created in the table itself, in its header, with no modal or separate form.

  1. Find the +: a small “+” button at the end of the header row, shown in edit mode only when you can add a property here. On wide tables it stays pinned at the right edge.

  1. Naming it: clicking + turns it into the header of the new column, and you type the name (“Due date”). The technical name is generated from it (dueDate).
  2. Type: a type list opens under the header, with a suggested type preselected from the name (e.g. date, deadline, due → Date; owner, assignee → User). Arrow keys pick another one. The list footer names the class that will be changed.
  3. Add: Enter adds the property to the class (Shift+Enter adds another one). Esc or clicking away cancels and nothing is saved.

  1. Fill in place: focus moves to the first cell of the new column; Enter saves and moves down. A notification confirms that the property was added to the class.

So the common case is: Tab to the +, type the name, Enter, fill, Enter. Everything works from the keyboard, and the + is a real button with the accessible name “Add property”.

Card layout

Cards have no header, so the + goes in the actions area that every card already has in edit mode. The rest of the flow is the same, and the new field appears on all the cards at once.

Removing a property

“Remove” can mean two things, so the UI keeps them apart. In edit mode, each column header (and each field on a card) gets a ⋯ menu with:

  • Hide in this table: the same toggle as the existing Properties panel. It only changes this view, and the values stay.
  • Delete property…: removes the property from the class and its values from every entry. Shown only when the source supports it and you can edit the class.

Deleting asks for confirmation with the same XWiki confirmation box used to delete an entry. The box names the property and the class, and warns that every Live Data using the class loses the column. Adding stays modal-free; only the destructive action gets a dialog. Document properties (doc.title, doc.date…) can only be hidden. If the source refuses a deletion, the item is disabled with the reason in a tooltip instead of being hidden.

Edge cases

  • Name collision: if the class already has the property (possibly hidden in this table), you’re offered to show the existing column or rename, instead of hitting an error.

  • Macro with an explicit properties list: the column is added to the class, but this table only shows its configured columns, so it would disappear on reload. The header and notification say so, with an “Add to the configuration” action.

Technical side

Note: I could not personally verify this part so it’s heavily AI generated.

Most of the backend already exists: LiveDataPropertyDescriptorStore has save() and remove(), and the REST API already exposes POST /liveData/sources/{sourceId}/properties. The livetable source just doesn’t implement them yet. The plan:

  • Implement save() (and remove() for deletion) in LiveTableLiveDataPropertyStore, with the rights check on the class document. Live Data stays generic: the UI only knows properties, the source knows classes.
  • The source advertises the capability with an addProperty action in meta.actions, only when the user can edit the class, like addEntry for rows. The client shows the + when in edit mode and that action is present.
  • Add addProperty() to the client LiveDataSource API, posting to the existing endpoint.
  • Validate on the server (duplicate or reserved names, invalid identifiers); a concurrent duplicate returns a conflict instead of overwriting.
  • On delete, also drop the property from the table’s columns, sort and filters, so no broken reference is left.

With this, XWIKI-12597 (class properties in the generic REST API) becomes a nice-to-have rather than a prerequisite.

Questions

  1. Does the inline header flow (name, type, Enter) work for you?
  2. Type suggestion from the name: can the suggestion keywords live in the translation files so it works in other languages? If not, I’d drop the suggestion and always preselect the default type.

WDYT?

Thanks!

Note: AI systems were used to help write this post

What happens if you move the focus out of the column / property name input? e.g. clicking outside. Does it remain editable? Until when?

What if you close it by mistake, by clicking outside or using Esc key? How do you reopen the type dropdown? What if I select the wrong type by mistake? How do I change the type afterward?

Also, how exactly is the column / property type suggested from its name? The user can use any supported language. Do you propose to keep a configurable dictionary? Is the suggestion updated as you type? Honestly, I don’t see the value in this suggest type feature. Too complex for too little benefit. Are there any tools that have this implemented?

So if I click outside by mistake the column is removed / lost? What if I press Enter and then realize I made a mistake / typo in the column / property name? How can I fix it?

I’m not fully convinced by the usefulness of the “Shift+Enter” feature.

What happens if you move the focus out of the cell before typing the value, or while typing the value? Can you edit again? Can you change the value if you made a mistake?

Thanks,
Marius

Only when in edit mode right?

Note: it should still be possible to edit the technical name.

It is unclear to me how that type to name mapping would work. Is it a simple inference when any name containing “date” would be suggested the Date type?
I’m also fine with String as the default type, and switching to another type a user action.

We can keep it editable, unsaved, until:

  • Users confirm / cancel it using a dedicated button
  • Exiting edit mode. If there’s any column left unsaved, we should show a warning about it. Note that the Esc is proposed as an exclusive “I don’t want this anymore” key.

That’s exactly my nr. 2 question. If it’s not possible to make it work under all languages, I’d drop this feature.

Yes, TODO apps have this extensively for parsing dates that you type on descriptions. You can check Todoist or Ticktick for example.

We can add options to edit these columns on the proposed menu for each.

We can drop it.

This is all part of the inline editing mode for rows that is also enabled by the LD edit mode. We don’t necessarily have to move to the first editable line, but I think it would speed things up.

Yes

We can add it when clicking the proposed technical name:

Yes, it should be a simple mapping from words appearing in the new column name to a proposed mapped type, it doesn’t have to be exact, if a column name somewhow matches two types, just use the most recent one matched.

But it’s important that this works in all languages, if it’s not possible then I’m in favor of dropping it and having the simple text by default.

Thanks for the feedback.