Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve comparison by highlighting code fragments better #1588

Open
rien opened this issue Sep 19, 2024 · 0 comments
Open

Improve comparison by highlighting code fragments better #1588

rien opened this issue Sep 19, 2024 · 0 comments
Assignees
Labels

Comments

@rien
Copy link
Member

rien commented Sep 19, 2024

In #1583 it was mentioned that the comparison could be a bit clearer. It is not clear which highlighted parts are matched with each other. If the user clicks on a highlighted/matched fragment where the other fragment is out of the view, it scrolls to that part, but this is not obvious and bugged.

Screenshot of the Dolos UI comparing two similar submissions

Possible improvements

  • Show matched fragments that are ignored because of template code, but visualize them in a distinct manner (e.g. greyed-out?)
  • Add a visible way to highlight matched fragments, for example a label or tag in the top of each fragment
  • A way to iterate or scroll through the matching Fragments
  • A way to show the underlying matching tokens contained within a match

In the past there has been a a collapsible sidebar with a list of all fragments, this was removed because the UI was confusing and complex. We could re-implement this with a better UI.

Related bugs/issues that could be fixed with this issue:

What should be changed

The code responsible for the highlighting is contained within the components in https://github.com/dodona-edu/dolos/tree/main/web/src/components/pair - specifically PairCodeMatchEditor.vue (one side of the pair) and PairCodeMatch.vue (both sides, with communication between).

The code quality in these components is not superb because it mostly comes down to convincing the Monaco Editor to show these fragments properly, and highlighting sections of code is a tricky thing.
While adding this feature, these components could be split up and cleaned up a bit.

@rien rien added enhancement New feature or request web UI labels Sep 19, 2024
@rien rien moved this to Needs discussion in Dolos Planning Sep 19, 2024
@mikaelGusse mikaelGusse self-assigned this Sep 24, 2024
@rien rien removed the enhancement New feature or request label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

No branches or pull requests

2 participants