Skip to content

Display title changes events as diffs #5657

Closed

Description

@FloEdelmann

Description

In GitLab, the title change event in an issue's or PR's timeline shows exactly what is changed as a diff. On GitHub, it's like "this is the old title, this is the new title, figure out what changed for yourself". For issues/PRs with longer titles, it can be difficult to spot subtle changes.

Screenshot

GitLab

grafik
https://invent.kde.org/plasma/discover/-/merge_requests/214#note_349280

GitHub

grafik
https://togithub.com/refined-github/refined-github/pull/5626#event-6609835934

Example URL

https://togithub.com/refined-github/refined-github/pull/5626#event-6609835934

Activity

  1. fregante commented on May 22, 2022

    @fregante
    Member

    Seems easy but producing a reliable diff might not be, plus add the DOM since GitHub renders the backticks. How would this diff this be rendered?

    - Hello world
    + Hello `world`

    It's impossible to render this way because the visible text is the same, only the "style" changes

  2. FloEdelmann commented on May 22, 2022

    @FloEdelmann
    MemberAuthor

    We could diff only "real" changes to textContent. "Style"-only changes are quite visible without the diff anyway.

  3. cheap-glitch commented on May 22, 2022

    @cheap-glitch
    Contributor

    This has been bothering me too for a while. Ideally the two titles should be collapsed if the changes are minimal, e.g.

    Add type/bug and kind/bug to list of supported labels in bugs-tab

    Seems easy but producing a reliable diff might not be

    This is the tricky part. Pulling in a diffing lib just for this is clearly overkill.

    That said, I wonder if a very crude word-diffing algorithm could do the job in just a few lines — and if there's too much differences between the two titles it's not worth having a diff anyway, so the feature could just give up in that case.

  4. fregante commented on May 22, 2022

    @fregante
    Member

    We could diff only "real" changes to textContent.

    i.e. avoid applying the diff if any rendered text is present? If not, this is a "real" change that also has a style change:

    code is not nothing code is nothing

    Pulling in a diffing lib just for this is clearly overkill

    💯

    a very crude word-diffing algorithm

    Could be looked at if really crude and non-problematic, after we figure out what to do with rendered titles.

  5. fregante commented on May 23, 2022

    @fregante
    Member

    What if we just improve the wrapping with del,ins{display:block}? I think this would make it immediately more readable, it would be a tiny CSS change in refined-github.css, and it would also fully work on style-only changes.

    Before

    Screen Shot 15

    After

    Screen Shot 14

  6. cheap-glitch commented on May 23, 2022

    @cheap-glitch
    Contributor

    What if we just improve the wrapping

    That's definitely an improvement, I like it!

    That said, I still think a single-line diff would be ideal (especially in the example shown above), so I'd like this issue to remain open even if we make that change.

  7. changed the title [-]Highlight PR/issue title changes as diff[/-] [+]Display title changes events as diffs[/+] on May 29, 2022
  8. fregante commented on May 29, 2022

    @fregante
    Member

    I think this only works if the changes are minimal. See this change:

    - Highlight PR/issue title changes as diffs
    + Display title change events as diff

    It will be displayed as:

    Screen Shot 9

    Which I don’t think it's any more clearer than what #5658 will do. Plus we can't select the old title anymore if we made a mistake and want to undo it.

  9. added a commit that references this issue on Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions