Skip to content

Diff mode #370

Open
Open

Description

@eric-burel

Is your feature request related to a problem?

This is a feedback I tend to get from end user: they would be eager to observe a diff between the initial files and the solution.

Describe the solution you'd like.

When clicking on "solve", having a way to observe not only the solution code, but the difference with the initial files:

  • files created/removed
  • within an existing file, lines created/removed/modified

Describe alternatives you've considered.

The text content explains bits of improvements but for a complex lesson that may not be enough.
Tools like "hackreels" allows to create complementary videos to show the evolution of a file, but doesn't extend much to multiple file.

Additional context

There might be libraries that help with computing the diff itself. Not an easy feature but might be very useful to learners.

Activity

  1. AriPerkkio commented on Oct 10, 2024

    @AriPerkkio
    Contributor

    Showing diff for the currently open file should be quite easy to do. All we need is to somehow compute the diff of two files in browser, and add diff syntax highlight to the editor.

    But I'm not sure how showing diff of all the created and removed files should be done. 🤔

  2. eric-burel commented on Oct 10, 2024

    @eric-burel
    ContributorAuthor

    But I'm not sure how showing diff of all the created and removed files should be done.

    I'd say it could be done in the tree view component ? Just adding a "+""-" in front of the filename and a different color.
    I didn't investigate the code at this point though to see how it could be implemented in the end.

  3. so0k commented on Dec 27, 2024

    @so0k

    But I'm not sure how showing diff of all the created and removed files should be done. 🤔

    similar to the vscode git view?

    • M (orange) for modified
    • D (red) for deleted file
    • A (green) for added file
    • R (gray) for renamed file
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