105 Commits

Author SHA1 Message Date
Kabiru Mwenja fd22629702 Code Maintenance/STC-462: Tidy the activity-tab paginator and centralise filter modes (#23552)
https://community.openproject.org/wp/STC-462

Two readability passes over the work package activity tab, no behaviour change. The paginator's private methods are reordered to follow their call order so the file reads top-down from `#call`, and the three activity filter modes (`:all`, `:only_comments`, `:only_changes`) — until now bare symbols duplicated across the controller, paginator, journal components and the hidden form — move into a single `WorkPackages::ActivitiesTab::Filters` module so the modes have one source of truth and can't drift apart. The diff reaches beyond the paginator into the controller, several components and a form, since that's where the symbols were scattered.
2026-06-05 16:50:08 +03:00
Kabiru Mwenja 5fdf57df69 Defer activity-tab sequence_version to anchor resolution
The work package activity tab computed a per-journal sequence_version on
every render — a ROW_NUMBER() window function over a LATERAL join — only to
stamp the legacy data-anchor-activity-id that #activity-N deep links rely on.
Nothing mints those links anymore; copy and share links use
#comment-<journal id>, which needs no extra query.

The activity number is now resolved on demand. Only a request carrying
?anchor=activity-N runs the window function, mapping the number to a journal
id the paginator exposes as resolved_anchor. The view hands that to the
client, which rewrites #activity-N to the canonical #comment-<id> and scrolls
using the comment anchor already present in the DOM. Default renders no longer
touch the window function.

References WP #68063.
2026-06-05 14:26:04 +03:00
Klaus Zanders 1fd5469c33 Merge branch 'dev' into merge-release/17.1-20260223152205 2026-02-23 16:25:43 +01:00
OpenProject Actions CI c779e8fc67 Merge branch 'release/17.0' into release/17.1 2026-02-23 14:29:39 +00:00
Kabiru Mwenja c406e7c5c3 Scope journal lookup to work package in activities tab
https://community.openproject.org/wp/72390
https://community.openproject.org/wp/72393
2026-02-23 16:33:31 +03:00
Klaus Zanders 516c42fcf7 Correctly handle error cases for activity tab controller 2026-02-09 15:08:07 +01:00
Klaus Zanders c2bc836ea1 Consistently load work packages via visible scope 2026-02-09 15:07:49 +01:00
Kabiru Mwenja 0e5e6e51cf Implementation/71141 remove work package activity tab lazy pagination feature flag (#21817)
https://community.openproject.org/work_packages/71141
2026-01-30 14:06:12 +03:00
Kabiru Mwenja 02b1682559 Set AT limit explicity to 20 items 2025-11-13 13:49:46 +03:00
Kabiru Mwenja 00864f158a bug/66552 Add filter support to activities tab paginator for better page distribution (#20733)
Implements `:only_comments` and `:only_changes` filters to prevent paginating journals that don't match the active filter, reducing unnecessary HTTP requests during lazy loading.

Use SQL-based heuristic to filter journals with changes at database level

  * Include journals with: initial version, attachments, custom fields, file links, cause metadata, or attribute changes
  * Compare work_package_journals columns with immediate predecessor to detect data changes _(handles non-sequential journal versions)_

https://community.openproject.org/wp/66552
2025-10-27 10:41:14 +03:00
Kabiru Mwenja 0731145265 Defer loading of emoji (re)actions menu for improved performance (#20580)
https://community.openproject.org/wp/68046
2025-10-10 15:42:04 +03:00
Kabiru Mwenja 22b139c8f4 Merge branch 'dev' into merge-release/16.5-20251010123254 2025-10-10 15:36:38 +03:00
Kabiru Mwenja fe5ced5130 Defer loading of journal items actions menu for improved performance (#20566)
https://community.openproject.org/wp/68046
2025-10-10 10:42:19 +03:00
Kabiru Mwenja 79404866ce Add feature flag for activity tab lazy pagination 2025-10-08 19:10:41 +03:00
Kabiru Mwenja 790f9a44d6 Extract work package activity tab pagination 2025-10-08 15:42:46 +03:00
Kabiru Mwenja 13853fdedd Re-initialize pagination JIT for tab replacement
Pick up any changes to sorting or filtering preferences
2025-10-08 15:42:44 +03:00
Kabiru Mwenja 79673c5a89 Support paginated deep linking of comments 2025-10-08 15:42:43 +03:00
Kabiru Mwenja 2484b48525 Switch from infinite scrolling to managed lazy loaded pages
Akin to lazy frames but with better intersection threshold control
2025-10-08 15:42:42 +03:00
Kabiru Mwenja c1d070ab6f Extract journal_sorting.{asc?,desc?} inquiry 2025-10-08 15:42:40 +03:00
Kabiru Mwenja aabd15be15 Abort infinite scrolling for 1 page collections 2025-10-08 15:42:39 +03:00
Kabiru Mwenja 447a45b575 Add infinite scrolling stimulus controller 2025-10-08 15:42:38 +03:00
Kabiru Mwenja 2468d4d98a Set up POC for infinite scrolling on AT (Messy Commit!) 2025-10-08 15:42:38 +03:00
Kabiru Mwenja 33d3953701 bug/63545 When editing a comment in the activity tab and polling occurs, the form can be force closed (#19507)
The activities tab polling mechanism updates newly updated journals, based on the last update timestamp. In case an attachment is added, or the journal is updated in any other places- the UI item would be updated\ on the next poll, overriding the edit form.

This commit adds an exclusion for any forms that are in "edit" state- it does not yet take into account conflict resolution.

https://community.openproject.org/wp/63545
https://community.openproject.org/wp/65680
2025-07-15 14:46:29 +03:00
OpenProject Actions CI 602ef20d64 Merge branch 'release/16.1' into dev 2025-06-25 07:47:08 +00:00
Kabiru Mwenja 34e136169e bug/65077 Inline comment attachments are not linked to the comment when submit is via API (#19304)
Relocate attachment claims in corresponding (journal) comment create and update services as
dependent services so that they are always invoked in both API & HTML contexts.

Follows:
 * https://github.com/opf/openproject/pull/18537
 * https://github.com/opf/openproject/pull/18648

https://community.openproject.org/work_packages/65077
2025-06-25 10:24:24 +03:00
Kabiru Mwenja 587f9ee6bf Replace custom activities tab onSubmit action with default turbo:submit
Reduce complexity by relying on `TurboDrive.navigator.submitForm(formElement, submitter)` action.

https://community.openproject.org/wp/63556
2025-06-18 14:50:28 +03:00
Kabiru Mwenja b8fe97296c Set a default hash value in grouped emoji reactions by reactable
Attempt to establish a consistent data structure, where a hash key read always returns a Hash
2025-05-27 14:06:42 +03:00
Kabiru Mwenja 98ce241beb Restructure emoji reactions queries to be independent of the Reactable assoc mixin
Atm, `Journal` is the only reactable model, so emoji reaction queries were naively performed on the "Journal" static interface. However, should we introduce another Reactable, then this approach falls apart quickly as the methods would be duplicated and practically accessible from any of the Reactables.

Therefore, we extract emoji reactions "grouping" queries into their own encapsulation that makes it agnostic to the reactable- it further adds convenience method parameters allowing either an "reactable:" kw arg or "reactable_type:" and "reactable_id:" pair.

https://community.openproject.org/wp/64167

Follows #18988
2025-05-27 14:06:39 +03:00
Kabiru Mwenja 07951c5272 implementation/64104 Extend API V3 to cover Emoji reactions on work package comments (toggle) and extend documentation
https://community.openproject.org/work_packages/64104
2025-05-23 17:14:01 +03:00
Kabiru Mwenja 4b874d8494 Use consistent naming for Journal emoji reactions convenience method 2025-05-21 17:02:40 +03:00
Kabiru Mwenja c93e0ec577 Use internal comment scope when quering emoji reactions 2025-05-21 17:00:40 +03:00
Kabiru Mwenja a817e74ae9 Touch up InternalCommentMentionsSanitizer (#18736)
* Rename InternalMentionsSanitizer "notes" to "comment" Better represent that the class recieves a "work package comment" and not a "note"
* Fully qualify `InternalCommentMentionsSanitizer` class name
2025-04-25 22:32:57 +03:00
Bruno Pagno 97ccf0bfc5 adjust internal comments internal representation 2025-04-24 13:12:32 +02:00
Kabiru Mwenja 66ea574dfc implementation/63384 On work package comment edit set attachment replacements (#18648)
Set comment attachment replacements on edit

When a comment is updated, replace attachments.

https://community.openproject.org/wp/63384
2025-04-22 09:55:10 +03:00
Kabiru Mwenja 8ead44ad71 Merge branch 'dev' into implementation/62363-adapt-attachment-uploads-on-comments-so-that-they-are-attached-to-the-container-on-submit 2025-04-10 13:15:18 +03:00
Bruno Pagno 9db8d0f7d3 fix polling of restricted comments 2025-04-08 08:59:20 +02:00
Kabiru Mwenja e5bab5fa1f Remove client side attachment event handling 2025-04-08 08:49:36 +03:00
Kabiru Mwenja 5bf56b9ffb Derive comment attachment claims from rich text content
Claim inline attachments that are actually in use- leave any previosly uploaded but unclaimed
attachemnts for clean up (later)- this way we don't clog up storage with unused image files
2025-04-08 08:48:55 +03:00
Kabiru Mwenja 00c7d1537a Make journals attachable in a basic form 2025-04-04 18:41:12 +03:00
Kabiru Mwenja 22cc675c24 Handle internal server error on mention sanitization request 2025-04-04 16:50:31 +03:00
Kabiru Mwenja ee42e9e49d Ensure journals are always sanitized 2025-03-25 22:16:21 +03:00
Kabiru Mwenja 3433e7ea63 Sanitize mentions on wp restricted comments 2025-03-25 21:46:34 +03:00
Kabiru Mwenja 357b68b331 Use method call instead 2025-03-18 19:41:20 +03:00
Kabiru Mwenja 380678e0fd [rubocop] Use expect(journal: [:notes, :restricted]) instead.
See https://github.com/rails/rails/pull/51674 for context.
OR https://gorails.com/episodes/how-to-use-params-expect-rails-8
2025-03-13 10:12:01 +03:00
Kabiru Mwenja 30c0351d56 Draft out restricted comment box 2025-03-12 13:56:34 +03:00
Kabiru Mwenja 6c55715f94 Bare-bones for writing restricted journals
TODO:
 1) Account for associated journals such as attachments, ensure those are restricted
 2) Exclude restricted journals from aggregation? (Unclear)
 3) Exclude comment-only journals from "snapshots" i.e. making a copy of the current wp state
2025-02-27 15:25:23 +03:00
jjabari-op 5ca7abe4a4 Update app/controllers/work_packages/activities_tab_controller.rb
Co-authored-by: Kabiru Mwenja <k.mwenja@openproject.com>
2024-11-21 09:23:21 +01:00
Jonas Jabari 56ce2ffa2c limit scope of notification update streams 2024-11-20 18:39:17 +01:00
Jonas Jabari 8b06a06b68 introduce deffered loading for older journals 2024-11-18 18:59:25 +01:00
jjabari-op 3d0401e8b2 Bug/59065 error toast giving a 500 error without relevant details (#17207)
https://community.openproject.org/work_packages/59065
2024-11-18 11:50:02 +03:00