zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

[Feature Request?] Right-click functionality for multiple cells in tables #2126

Closed OLCadlywydd closed 2 years ago

OLCadlywydd commented 3 years ago

When editing a table, would it be possible to add right-click functionality for text when multiple cells are selected? When changing text properties in tables, you currently have to change each cell's text one-by-one, by selecting the text and then right-clicking to change it. This is very time-consuming if you want to change large amounts of text across different cells. When multiple cells are selected, you can change some properties, such as the cell background colour, but you are unable to change the text within those cells at all. See the below example when attempting to change cell text colour:

nZB8TSqMna

zadam commented 3 years ago

This is a functionality of CKEditor and would have to be implemented there.

OLCadlywydd commented 3 years ago

This is a functionality of CKEditor and would have to be implemented there.

Thanks for the response @zadam. It seems like this has been implemented since CKEditor 5 v18.0.0 as shown here. Is it possible to implement this in Trilium? Many thanks!!

table-selection

zadam commented 3 years ago

That is strange, this should be available then. Trilium integrates CKEditor 27.0 and should not have any diverging behavior in this regard.

OLCadlywydd commented 3 years ago

@zadam I believe that the TableSelection plugin needs to be enabled for this to work? https://ckeditor.com/docs/ckeditor5/latest/api/module_table_tableselection-TableSelection.html

From https://ckeditor.com/docs/ckeditor5/latest/features/table.html:

The TableSelection plugin introduces support for the custom selection system for tables that lets you:

  • Select an arbitrary rectangular table fragment — a few cells from different rows, a column (or a few of them) or a row (or multiple rows).
  • Apply formatting or add a link to all selected cells at once.

The table selection plugin is loaded automatically by the Table plugin and can be tested in the demos above.

Is it possible to add this plugin?

zadam commented 3 years ago

Yes, that's probably it. I wasn't aware that this is in a separate plugin. I will add this plugin in the next CKEditor upgrade (soon).

OLCadlywydd commented 2 years ago

@zadam I noticed that CKEditor has been upgraded, but this feature still doesn't seem to work? Were you able to add it?

Thanks!

zadam commented 2 years ago

I think I originally misunderstood what you're asking for. The trouble is that e.g. changing text color is available in the "balloon" toolbar which isn't appearing on cell selection so this functionality is not accessible.

TableSelection plugin was actually enabled all along ("The table selection plugin is loaded automatically by the Table plugin").

IMHO this is a limitation of Balloon block editor and you would need Classic editor (which isn't available in Trilium).

OLCadlywydd commented 2 years ago

Ahhhh I see, that make sense. Sorry for sending you down the rabbit hole with this. I'll raise a feature request with CKEditor instead. Thanks very much for looking at this!