Feature #43095
closedSupport automatic list marker insertion in textareas
0%
Description
When editing a text using Markdown or Textile formatting, it's helpful to automatically insert the next list marker when pressing Enter after a list item.
This patch introduces a Stimulus controller that detects the current line and autofills the appropriate marker for both ordered and unordered lists, depending on the selected text formatting.
The behavior includes:- Autofilling the next bullet or number when pressing Enter
- Removing the list marker when pressing Enter on an empty list item
- Support for nested lists
- Compatible with both Textile and CommonMark
- Properly ignores Enter key during text composition with IME (e.g. Japanese input). this is implemented using compositionstart and compositionend events, which have been supported by all major browsers since 2015 and are stable to use.
It improves editing efficiency for users writing structured content.
Files
Related issues
Updated by Mizuki ISHIKAWA 2 months ago
- File 0001-Add-automatic-list-marker-insertion-for-textareas.patch 0001-Add-automatic-list-marker-insertion-for-textareas.patch added
I've corrected the warning on the lint and will reattach it.
Updated by Mizuki ISHIKAWA 2 months ago
- File 0001-Add-automatic-list-marker-insertion-for-textareas.patch 0001-Add-automatic-list-marker-insertion-for-textareas.patch added
I’ve reposted the patch with support for the 1) syntax in CommonMark and some minor behavior fixes.
Updated by Marius BĂLTEANU about 2 months ago
Thanks Mizuki for working on this patch. Before integrating this, we need first to adapt the current implementation of jstoolbar to Stimulus. I've some working code on my local environment, but it is not ready, the main concern that I have now is how can I rewrite it without being a major breaking change.
One option that I thought about is to completely write (based on the existing code) a new component to Stimulus and keep both implementation on 6.1.0 even if that will mean some duplicated code:- in core we will use only the new one based on Stimulus
- plugin developers will have enough time to move their implementation to the new toolbar component.
- in Redmine 7, we remove the jstoolbar legacy.
One more advantage of moving now to Stimulus for JS toolbar is that we cleanup up the views and we can start experimenting Turbo for some views (like news) and, also, to async load the edit form in issue and other pages in order to enable the check / uncheck task list items without handling the event on both backend and frontend (#39130).
Updated by Mizuki ISHIKAWA about 2 months ago
Marius BĂLTEANU
I think the vision of moving jstoolbar to Stimulus and introducing asynchronous loading is wonderful! I'm really looking forward to it!
As for the auto-completion feature for list markers, I agree that in the long run it probably makes sense to integrate this into jstoolbar. However, at this stage it’s a separate feature—similar to auto_complete—so I believe it could be implemented independently without waiting for the jstoolbar migration to Stimulus.
Updated by Mizuki ISHIKAWA 19 days ago
- File 0001-Add-automatic-list-marker-insertion-for-textareas.patch 0001-Add-automatic-list-marker-insertion-for-textareas.patch added
- Ensured proper behavior in Safari.
- Enabled marker completion for all text areas with jstoolbar.
- Added explanatory comments for the regular expressions.
This update was created with the help of Katsuya HIDAKA.
Updated by Mizuki ISHIKAWA 19 days ago
- File 0001-Add-automatic-list-marker-insertion-for-textareas.patch 0001-Add-automatic-list-marker-insertion-for-textareas.patch added
I'm reattaching the patch because there were some missing changes.
Updated by Katsuya HIDAKA 19 days ago
I have tested the patch in #note-7 and confirmed that it works well.
- Tested with Chrome, Firefox, Safari, and MS Edge
- Works with both Textile and Markdown
- Works in all text areas that accept Textile/Markdown
This feature is implemented as a standalone Stimulus controller, so I believe it would be easy to integrate even in future development of related functionality.
I believe this feature will clearly improve the input experience in Redmine. It should also contribute to its modernization. I hope it will be introduced.
Updated by Marius BĂLTEANU 19 days ago
- Target version changed from Candidate for next major release to 6.1.0
Updated by Marius BĂLTEANU 18 days ago
- Target version changed from 6.1.0 to 7.0.0
Updated by Go MAEDA 18 days ago
Marius, I noticed that you changed the target version of this issue to 7.0.0.
Would it be possible to include it in version 6.1.0 instead?
I don't see any concerns with committing this patch. On the contrary, it brings a significant usability improvement for textareas, so I believe it would be better to deliver it to users as soon as possible. If we wait until 7.0.0, users will only get this feature about a year from now.
Could you please reconsider and move the target version back to 6.1.0?
Updated by Marius BĂLTEANU 18 days ago
- it's quite a lot of code added with a few days before the release
- the feature doesn't work for task list items
- the code needed to be part of the JS toolbar because it extends its functionality and it is not a completely different feature like the auto_completes. In auto_completes, we don't have code that checks for the formatter as we have here, here a quick example:
let formatter switch (this.format) { case 'common_mark': formatter = new CommonMarkListFormatter() break case 'textile': formatter = new TextileListFormatter() break default: return }
Anyway, it is a nice feature, I've committed it, but with concerns regarding the technical debt that we just added.
Updated by Marius BĂLTEANU 18 days ago
- Status changed from New to Resolved
- Assignee set to Marius BĂLTEANU
- Resolution set to Fixed
Updated by Go MAEDA 17 days ago
- Target version changed from 7.0.0 to 6.1.0
Thank you for committing the patch.
Improving Redmine's UI is one of the important themes, and I believe this feature is a valuable step toward enhancing the usability of the textarea. It is great that we can deliver this improvement to users in Redmine 6.1.
Updated by Mischa The Evil 16 days ago
- Status changed from Closed to Reopened
Marius BĂLTEANU wrote in #note-12:
I've committed the patch [...]
This does not yet appear to have been committed to the trunk of the canonical SVN repo prior to 6.1-stable branch creation, thus it would be missing in an upcoming 6.1 release.
Can you check and handle this (either by rescheduling this issue or by last-minute committing the patch and merging the changeset to the 6.1-stable branch)?
Updated by Marius BĂLTEANU 16 days ago
Mischa The Evil wrote in #note-16:
Marius BĂLTEANU wrote in #note-12:
I've committed the patch [...]
This does not yet appear to have been committed to the trunk of the canonical SVN repo prior to 6.1-stable branch creation, thus it would be missing in an upcoming 6.1 release.
Can you check and handle this (either by rescheduling this issue or by last-minute committing the patch and merging the changeset to the 6.1-stable branch)?
You're right, thanks for pointing this out. I've committed the patch now and I will merge it to 6.1-stable once the tests pass.
Updated by Marius BĂLTEANU 8 days ago
- Related to Feature #43258: automatic list marker - with SHIFT-RETURN just a new line added
Updated by Marius BĂLTEANU 8 days ago
- Related to Defect #43265: Automatic list marker does not work for task list items added