Allow viewing of workspace diff

Created on 12 December 2024, 3 months ago

Problem/Motivation

When reviewing a workspace you can easily see the list of all content within the workspace that was changed, but seeing the specific changes isn't possible without going to each entity to view the diff tab.

Steps to reproduce

Attempt to understand the line by line changes within a workspace and realize it's not easy to see that information.

Proposed resolution

Create a "Diff" tab on each workflow entity that allows users to see the line by line diff between each entity and the live state of the site, or another workspace?

This is what the code looks like running in a custom module I created as a prototype. (I created this the day before Thanksgiving so I had food on the mind in my test content.)

Remaining tasks

  • I will upload the prototype code I used into a new MR
  • The powers that be will decide if this is wanted in this module or if it should be in core. I went this route based upon the activity and responsiveness I was seeing in your issue queue (thank you for that and this module!).
  • Decide on the exact feature set/requirements.
  • Improve/revise the prototype code I have included to meet the requirements above.

User interface changes

Adds a "Diff" tab to each workspace and a page that renders the line by line diff. Perhaps we need a way to filter the entities included in this diff, as it could be large and cause memory issues.

API changes

N/A

Data model changes

N/A

✨ Feature request
Status

Active

Version

2.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States adamzimmermann

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Pipeline finished with Success
    5 months ago
    Total: 239s
    #304398
  • Pipeline finished with Success
    5 months ago
    Total: 189s
    #304403
  • Issue created by @adamzimmermann
  • πŸ‡ΊπŸ‡ΈUnited States adamzimmermann
  • Pipeline finished with Success
    3 months ago
    Total: 395s
    #366183
  • πŸ‡·πŸ‡΄Romania amateescu

    We already have this functionality as an optional integration with the Diff module. It's provided as a View changes operation for each entity on the workspace overview page: https://git.drupalcode.org/project/wse/-/blob/2.0.x/wse.module?ref_type=...

    Was that not working well enough for your use case?

  • πŸ‡ΊπŸ‡ΈUnited States adamzimmermann

    That's a great question. I forget all of the context around the original request from the editorial staff, but I believe it was centered around the idea of not wanting to have to click that button for each node when a workspace might contain changes from dozens of entities. Let me see if someone still on the project can chime in here with more information.

  • πŸ‡ΊπŸ‡ΈUnited States adamzimmermann

    I heard back from the editorial team:

    "...a large part of the appeal of workspaces for us is launching/closing a competition, where we have to make many edits to many nodes around the site. Currently that's done manually on individual nodes in succession. With this we can do it all at once and be able to identify exactly what was done where all at once/in one view."

  • πŸ‡·πŸ‡΄Romania amateescu

    That's an interesting use case and I agree it makes sense to provide a way to view all differences in a single screen :) Here's a few points on the approach:

    - I'm not sure this needs to be on a separate screen, the table at the top duplicates the one from the main "manage workspace" screen, but it's a bit less user-friendly in my opinion (entity type and bundle machine names instead of labels, no pagination, etc.)
    - I agree with this integration being in a sub-module, the main WSE module feels pretty crowded these days

    With that said, how would you feel about these changes:

    - move the inline diffs into the main "manage workspace" screen, and insert them in the table rows of each changed entity
    - add a wse_diff.settings config to specify a "Show changes inline" boolean (FALSE by default), which would toggle between the current Diff integration from the main module (an entity operation) and this new "all in one place" view
    - move the current Diff integration from the main module to wse_diff, and provide an upgrade function which installs the new sub-module if the Diff module is also enabled on the site

  • Pipeline finished with Failed
    3 months ago
    Total: 347s
    #370090
  • πŸ‡ΊπŸ‡ΈUnited States adamzimmermann

    Those changes make sense to me. I'll see if I can find some time to take a swing at this in the next several weeks and report back with any questions.

  • Pipeline finished with Skipped
    3 months ago
    #371252
  • Pipeline finished with Failed
    3 months ago
    Total: 446s
    #374573
  • Pipeline finished with Failed
    3 months ago
    Total: 306s
    #376364
  • Pipeline finished with Success
    3 months ago
    Total: 350s
    #376378
  • Pipeline finished with Success
    3 months ago
    Total: 304s
    #377579
  • Pipeline finished with Failed
    2 months ago
    Total: 223s
    #384137
  • Pipeline finished with Failed
    2 months ago
    Total: 235s
    #384143
  • Pipeline finished with Success
    2 months ago
    Total: 274s
    #384160
  • Pipeline finished with Success
    2 months ago
    Total: 233s
    #384166
  • Pipeline finished with Success
    2 months ago
    Total: 565s
    #389062
  • Pipeline finished with Success
    about 2 months ago
    Total: 457s
    #393793
  • Pipeline finished with Failed
    about 2 months ago
    Total: 308s
    #393912
  • Pipeline finished with Failed
    about 2 months ago
    Total: 173s
    #394285
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 76s
    #394292
  • Pipeline finished with Success
    about 2 months ago
    Total: 533s
    #398299
  • Pipeline finished with Failed
    about 2 months ago
    Total: 304s
    #403512
  • Pipeline finished with Failed
    about 2 months ago
    Total: 222s
    #403528
  • Pipeline finished with Failed
    about 2 months ago
    Total: 250s
    #403530
  • Pipeline finished with Success
    about 2 months ago
    Total: 400s
    #403789
  • Status changed to Needs work 22 days ago
  • πŸ‡ΊπŸ‡ΈUnited States adamzimmermann

    @amateescu

    The refactoring of all diff related functionality to the new wse_diff module is going to larger than I hoped, and it will cause us to repeat more code than I would like too. I'm sure we could abstract it somehow to keep it DRY, but that just adds more complexity.

    Should that effort be a separate issue? Keeping that refactor separate would have my vote after seeing what it entails.

    Thoughts?

    I'll keep going for now and push up my work sometime this week.

  • πŸ‡·πŸ‡΄Romania amateescu

    @adamzimmermann, I think it's fine to leave the refactoring of existing diff integration for a followup. If you didn't start it already, feel free to only do the other points from #7.

  • Pipeline finished with Failed
    15 days ago
    Total: 224s
    #432893
  • Pipeline finished with Success
    14 days ago
    Total: 231s
    #434092
  • πŸ‡ΊπŸ‡ΈUnited States adamzimmermann

    adamzimmermann β†’ changed the visibility of the branch 3493448-2-allow-viewing-of to hidden.

  • Pipeline finished with Failed
    6 days ago
    Total: 399s
    #441531
  • πŸ‡ΊπŸ‡ΈUnited States adamzimmermann

    This has all of the changes we discussed for the refactor, but some questions arose during that process. So it's ready for some initial review with the new approach, but I'm sure it will need additional revisions.

Production build 0.71.5 2024