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

Visualize diff #230

Closed
4 tasks done
rien opened this issue Jul 28, 2020 · 6 comments
Closed
4 tasks done

Visualize diff #230

rien opened this issue Jul 28, 2020 · 6 comments
Assignees

Comments

@rien
Copy link
Member

rien commented Jul 28, 2020

Comparing two files is the main functionality of Dolos, so this should be a clear and easy-to-use component of our web UI.

Requirements:

  • code highlighting of a single file
    • the highlighter should be flexible enough so we can inject/extend the highlighting with our own styling
  • highlighting which parts are unique and which parts are shared
  • easy and intuitive navigation between two files
    • barcode chart: show a mini map of the file (fitting on one page) showing the parts that are shared (red) and unique (green); in order no to clutter the chart, we might only show the shared regions (hunks)
    • clicking on a shared part should scroll the common part of the other file into view; apart from aligning the two regions in the two files, we could also show a "diff" (in this case a diff between the original texts) between the two shared regions, highlighting their differences
    • if there are multiple matching parts in the other (or the current) file, they should be shown on the mini map when selected; there should be a way to toggle between these multiple parts
    • synchronous scrolling between both files (e.g. after aligning them on two hunks); Atom uses keyboard shortcut Ctrl-Alt-S to toggle scroll-sync on/off
  • an overview of the matches between two files with some basic information (how long, how many kmers); where matches can be selected (showing them on the barcode chart and code viewer) and ignored
@pdawyndt
Copy link
Contributor

pdawyndt commented Jul 28, 2020

Can we look into some existing tools for inspiration. Any existing implementations we could reuse?

Maybe try some of the browser-based IDEs that we have been looking into. Both VS Code Server and Theia have file comparison features.

@rien
Copy link
Member Author

rien commented Jul 28, 2020

Other tools are definitely a good source for inspiration, but our implementation will be very specific because there are some distinct differences with normal differs or merge tools. So if we would decide to reuse other code, it should be very flexible and extendible.

@pdawyndt pdawyndt changed the title Visualize comparison of two files Visualize diff Aug 3, 2020
@ArneCJacobs
Copy link
Contributor

For code highlighting we could either use Prism js or Highlight js

@rien
Copy link
Member Author

rien commented Aug 7, 2020

  • No empty space between highlighted text
  • Extract left and right code panel to components
  • Cycle trough all hunks (left and right) when selecting a token
  • Highlight all hunks on hover
  • Store selected and hovered hunks/tokens in state
  • Create barcode component

@ArneCJacobs
Copy link
Contributor

ArneCJacobs commented Aug 12, 2020

Current todo status:

  • Refine barcode component
    • the currently selected block should be shown
    • all the blocks in the barcode component should represent a line
    • the blocks should have the same colours as the selections in the code view
    • the height of the barcode should be relative to the amount of lines: see this
    • there should be a translusent square in the barchart representing where you are currently in the code view
  • the current selection should be stored in the vuex store
  • when scrolling horizontally, the line numbers should stay visible

@ArneCJacobs ArneCJacobs self-assigned this Aug 14, 2020
@ArneCJacobs
Copy link
Contributor

This issue was resolved with PR #256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants