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

Report Viewer Redesign #1145

Merged
merged 43 commits into from
Jul 10, 2023
Merged

Report Viewer Redesign #1145

merged 43 commits into from
Jul 10, 2023

Conversation

Kr0nox
Copy link
Member

@Kr0nox Kr0nox commented Jun 20, 2023

This PR gives the UI of the Report Viewer a complete overhaul.
It is designed to be more user friendly, constistent and easier to extend.
It only adds minimal new features to stay in line with the old design and not display less information.

Changelist

Packages

Tailwind

  • Tailwind was added for easy and consistent styling
  • Also added postcss and autoprefixer to integrate it into the vue project

Font Awesome

  • Icons and Symbols that can be manipulated through text formatting
  • Also added necessary packages for vue integration

Removed

  • Removed gitart-vue-dialog since it is no langer used

General

  • Got rid of word Match in context of the similarity of two submissions
  • NEW: Added Button for switching Light-/Dakrmode in bottom right corner

Views

FileUpload

  • All old functionality still remains the same
  • NEW: Clicking the red rectangle will open the systems filepicker. This was added for easier and faster file selection

Overview

  • Data about the CLI run ist now located at the top of the page
    • Reduced information there
    • NEW: Rest is accesible over more button
  • The selector for the metric of the distribution chart is now located under it
  • Comparison table
    • Coloumn for both average and maximum similarity
    • Clicking Cluster coloumn redirects to the cluster view
    • Cluster coloumn displays member count and average similarity
    • NEW: Cluster icon is color coded for each cluster found
    • NEW: Hovering over the cluster will show a tooltip explaning it
    • NEW: Search bar for filtering the table added. Works by seperating (parts of) names by space. Commas get removed
  • Hiding members/ annonymicing
    • NEW: Hide All button over the comparison table. When all submissions are hidden, shows Show All option
    • NEW: When a submission name is fully typed into the search bar (Works by seperating names by space. Commas get removed), the report viewer will only display that submission again. It can be hidden again, by clicking the hide all button

Comparison

  • Data about the comparisons (similarities) are located at top of page
  • Match table is now a horizontal list at the top of the page (renamed to MatchList)
    • Only display file names and not their paths
    • Clicking on them still opens the match in code

Cluster

  • NEW: Clusters are now displayed in their own view
  • Comparison table with all members of the cluster on the right
  • Radarchart configuration was moved to the component to enable switching the font color for Light-/Darkmode

Information

  • NEW: Information about the CLI run is now displayed in a seperate view

Model

  • NEW: Added Distribution class
  • Overview.ts
    • Removed Metric object
    • Added Distribution object Array
    • Added Comparison Array
  • Extracted color(hue) calculation into utility functions
  • NEW: Metrics and their indexes in arrays are saved in their own enum
  • Moved file extraction for comparison and overview into their respective Factories

Store

  • Split State into uiState and state
    • uiState saves things that are only relevant to the ui that should be persistent through clearing the store
    • state saves stuff relevant to storing and retriving data
  • All file paths are now stored in unix style (../A/B/...) to ensure all modes working on all systems

Testing

  • Tested all views with real world date in browsers:
    • Chrome
    • Firefox
    • Edge
  • Tested local mode and deployed mode

A deployed version can be found here

@Kr0nox Kr0nox requested review from sebinside, TwoOfTwelve and a team June 20, 2023 09:48
@tsaglam
Copy link
Member

tsaglam commented Jul 3, 2023

Currently, I get a blank page on https://kr0nox.github.io/JPlag/. Is that only for me the case?

@Kr0nox
Copy link
Member Author

Kr0nox commented Jul 3, 2023

@tsaglam Should be up again

Copy link
Member

@sebinside sebinside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I finally found time to look through this giant PR, inspect the code and test a few things.
Besides that, Timur also played around quite a bit with the new Report Viewer.

I think the code is already in a quite good state. Besides the new design (which is already really good!), you simplified and enhanced a lot of things, thank you.
I also added some code comments, e.g., in the factories. Although I know this is not your code, we should still improve it in future versions :)

In addition to the comments in the code, I have the following suggestions (for later):

  • The Light/Dark mode toggle button is hard to see, maybe it could be included as a toggle switch in the header, like on the vue.js website for example?
  • The coloring of the comparison table with red lines is too much, I would suggest using a way lighter highlighting color, e.g., some shade of gray (pun intended)
  • I wonder whether the back navigation from the comparison view should be possible via the GUI and not only via the browser (same e.g. for the more button)
  • Overall there should be more in-code documentation of public methods and classes
  • Underlining headlines is a relic from ancient typewriter times and should be avoided :)
  • At least for scrolling with the mouse wheel was not possible in the comparison view top compartment
  • The warning about missing submissions (because of the limit) should be visible both in the comparison list and the cluster list (e.g., a cluster with low confidence shows 10 participants but listing them all shows only one entry)
  • Sometimes, matches require two clicks to become visible in the comparison view

In favor of quickly merging this PR, I would suggest not directly implementing the suggestions (other than the easy-to-implement ones in the code) but moving them to issue #1000 and then implementing them afterward.

Again thank you for your work. I'm looking forward to merging this PR!

report-viewer/src/components/CodePanel.vue Show resolved Hide resolved
report-viewer/src/model/Distribution.ts Outdated Show resolved Hide resolved

/**
* Factory class for creating Comparison objects
*/
export class ComparisonFactory {
public static getComparison(id1: string, id2: string) {
console.log('Generating comparison {%s} - {%s}...', id1, id2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should discuss whether we want console logs in a normal productive run without errors

const comparisons = [] as Array<ComparisonListElement>

const metrics = json.metrics as Array<unknown> as Array<Record<string, unknown>>
// Average
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be split up in functions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put his into a new PR since we are planning on changing something in the json to make it easier to implement new metrics. Then this code will have to change anyways

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please regard all of my comments as things that could also be done in an additional PR to speed up the process :)

/**
* Gets the overview file based on the used mode (zip, local, single).
*/
public static getOverview(): Overview {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a quite complex method especially the construction of the Overview object. Something to rework in the future

report-viewer/src/stores/store.ts Show resolved Hide resolved
report-viewer/src/style.css Show resolved Hide resolved
report-viewer/src/utils/ComparisonUtils.ts Outdated Show resolved Hide resolved
Copy link
Member

@tsaglam tsaglam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed earlier that the new viewer does not allow to drag the files in the comparison view to re-order them.

@Kr0nox
Copy link
Member Author

Kr0nox commented Jul 7, 2023

All still open comments are either points that need to be disgussed in more detail or will be handle in a different PR.

The Light/Dark mode toggle button is hard to see, maybe it could be included as a toggle switch in the header, like on the vue.js website for example?

We dont really have a header like that. we could add one, but at the moment it would only contain that switch.

The coloring of the comparison table with red lines is too much, I would suggest using a way lighter highlighting color, e.g., some shade of gray (pun intended)

Is done

Underlining headlines is a relic from ancient typewriter times and should be avoided :)

Was removed

At least for scrolling with the mouse wheel was not possible in the comparison view top compartment

It is possible on the trackpad by scrolling to the side. Do you have an example of any website that allows horizontal scrolling with the mouse wheel?

The warning about missing submissions (because of the limit) should be visible both in the comparison list and the cluster list (e.g., a cluster with low confidence shows 10 participants but listing them all shows only one entry)

How excactly do we want that displayed?

Sometimes, matches require two clicks to become visible in the comparison view

This investigating where that issue comes from

@tsaglam Dragging should be possible again

@Kr0nox
Copy link
Member Author

Kr0nox commented Jul 7, 2023

Sometimes, matches require two clicks to become visible in the comparison view

As far as I can see, this is already an issue on the develop branch. @sebinside can you confirm that this is the case for you too?
If so I think this might be an issue with either vite or a newer vue version

@sebinside
Copy link
Member

@Kr0nox Yes, the issue did already exist earlier. As far as I see, all other points are minor or can be discussed in the next meeting. So, when you feel ready (and the conflicts are resolved), I'll be happy to merge the PR.

@tsaglam
Copy link
Member

tsaglam commented Jul 7, 2023

One small thing, either for this PR, or a future one: The top list in the overview should have indexed pairs again because that helps to keep track of pairs when the search function is used.

Kr0nox added 2 commits July 7, 2023 13:29
# Conflicts:
#	report-viewer/package-lock.json
#	report-viewer/package.json
@Kr0nox
Copy link
Member Author

Kr0nox commented Jul 7, 2023

One small thing, either for this PR, or a future one: The top list in the overview should have indexed pairs again because that helps to keep track of pairs when the search function is used.

Do you mean just numerating the lines or giving every comparison a unique id?

@tsaglam
Copy link
Member

tsaglam commented Jul 7, 2023

Do you mean just numerating the lines or giving every comparison a unique id?

Just numbering the lines. So when I filter for a submission name, I see exactly at which positions the comparisons involving that submission are in the unfiltered list.

@Kr0nox
Copy link
Member Author

Kr0nox commented Jul 8, 2023

@tsaglam is implemented

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 8, 2023

[JPlag Report Viewer] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 8, 2023

[JPlag Plagiarism Detector] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@Kr0nox
Copy link
Member Author

Kr0nox commented Jul 9, 2023

@sebinside Conflicts are resolved. From my side this PR can be merged

@sebinside sebinside removed the request for review from TwoOfTwelve July 10, 2023 06:53
@sebinside sebinside merged commit 9f48d6f into develop Jul 10, 2023
@sebinside sebinside deleted the report-viewer/redesign branch July 10, 2023 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue/PR that involves features, improvements and other changes major Major issue/feature/contribution/change report-viewer PR / Issue deals (partly) with the report viewer and thus involves web-dev technologies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants