Wieland Lindenthal d351296e6c Fix CTRL+Z in documents
https://community.openproject.org/wp/STC-779

Three independent defects together caused Y.UndoManager state to be lost
in the documents module:

1. `useCreateBlockNote(editorParams, [activeUser])` used `[activeUser]`
   as the recreation key. BlockNote's `useCreateBlockNote(options, deps)`
   uses `deps` as the sole `useMemo` key (options is intentionally NOT in
   deps). Since `block-note-element.ts` parses a fresh `activeUser` from
   the host attribute via `JSON.parse` on every `renderCallback` invocation,
   any path that re-rendered the React tree handed in a new object
   reference and rebuilt the editor (and its UndoManager).

2. `LiveCollaborationManager.initializeYjsProvider` was not idempotent.
   Stimulus's `init-yjs-provider` controller can fire `connect()` a second
   time without firing `disconnect()` (HMR replay, Turbo morph, parent
   re-attach). The duplicate call destroyed the live Y.Doc + provider and
   rebuilt both, remounting the editor and wiping its history. The
   controller now adopts the existing session via
   `getCurrentSessionFor(documentName)` instead of constructing a duplicate.

3. The `React.StrictMode` wrap in `block-note-element.ts` caused
   BlockNoteView to destroy and recreate the ProseMirror view between
   StrictMode's two dev-mode mounts. `y-prosemirror`'s `yUndoPlugin`
   destroys the `Y.UndoManager` on view-destroy (removing its
   `afterTransaction` handler from the Y.Doc), but the plugin state retains
   the now-dead UndoManager reference. After the second mount the editor
   reused the destroyed UndoManager, no handler was re-attached, no stack
   items were recorded, and Ctrl+Z was a no-op. StrictMode is dev-only and
   incompatible with the current y-prosemirror lifecycle, so it is removed
   from the BlockNote tree.

Verified on release/17.5: typing produces stack items, Ctrl+Z reverts to
the previous state, Ctrl+Shift+Z reapplies, and the Y.Doc has exactly one
`afterTransaction` observer (the live UndoManager's). Synthetic duplicate
`connect()` no longer remounts the editor.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 16:36:26 +02:00
2025-02-03 18:17:37 +01:00
2026-06-05 16:36:26 +02:00
2026-05-06 07:52:03 +02:00
2025-12-05 10:31:04 +01:00
2026-05-13 10:16:26 +02:00
2026-02-11 10:40:54 +01:00
2026-02-16 16:59:19 +01:00
2026-04-01 11:28:28 +02:00
2025-04-22 10:41:14 +02:00
2026-01-20 10:38:09 -03:00
2025-04-30 11:10:11 +02:00
2026-02-26 12:05:25 +01:00
2024-10-10 12:44:21 +02:00
2026-05-13 08:46:28 +02:00
2024-11-19 11:25:14 +01:00
2025-02-27 09:52:26 +01:00

OpenProject

GitHub release (latest by date) GitHub commit activity GitHub branch checks state Github Tests

We empower teams to achieve great things together for the good of society.

OpenProject is a web-based project management software. Use OpenProject to manage your projects, tasks and goals. Collaborate via work packages and link them to your pull requests on Github. Read more about the OpenProject GitHub integration.

Screenshot of OpenProject, showing the GitHub tab on a work package

OpenProject's key features are:

More information and screenshots can be found on our website.

Start now with OpenProject

Report bugs

You found a bug? Please report it to our OpenProject Community. Thank you!

Contribute

OpenProject is supported by its Community members, both companies and individuals.

We are always looking for new members to our Community, so if you are interested in improving OpenProject we would be glad to welcome and support you getting into the code. There are guides as well, e.g. a Quick Start for Developers, but don't hesitate to simply contact us if you have questions.

Working on OpenProject comes with the satisfaction of working on a widely used open source application.

Also, if you do not want to be limited to working on open source in your free time, OpenProject GmbH, the company contributing to the OpenProject development, is hiring.

Stay in contact

Here you can find our contact information. As we regularly update OpenProject, we recommend staying in touch here is where you can find us:

Security / responsible disclosure

We take security very seriously at OpenProject. We value any kind of feedback that will keep our Community secure. If you happen to come across a security issue we urge you to disclose it to us privately to allow our users and Community enough time to upgrade. Security issues will always take precedence over anything else in the pipeline.

For more information on how to disclose a security vulnerability, please see this page.

License

OpenProject is licensed under the terms of the GNU General Public License version 3. See COPYRIGHT and LICENSE files for details.

Credits

Icons

Thanks to Vincent Le Moign and his fabulous Minicons icons on webalys.com.

OpenProject icon font

Published and created by the OpenProject Foundation (OPF) under Creative Commons Attribution 3.0 Unported License with icons from the following sources Minicons Free Vector Icons Pack and User Interface Design framework both by webalys

Creative Commons License

OpenProject Icon Font by the OpenProject Foundation (OPF) is licensed under Creative Commons Attribution 3.0 Unported License and Free for both personal and commercial use. You can copy, adapt, remix, distribute or transmit it.

Under this condition: provide a mention of the "OpenProject Foundation" and a link back to OpenProject www.openproject.org.

S
Description
Project management (Rails). Reference for planning/roadmap surfaces.
Readme GPL-3.0 3.3 GiB
Languages
Ruby 80.1%
TypeScript 10.7%
HTML 7.2%
Sass 1.4%
Shell 0.3%
Other 0.2%