netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Git history and diff view improvements

Open mbien opened this issue 1 year ago • 3 comments

Lets try to make the git history UI a bit more useful. ~This doesn't fix the advanced search or its 24 branch limit~ (edit: it fixes it indirectly, see https://github.com/apache/netbeans/pull/7128#issuecomment-1990655432), this is mostly UI/UX.

screenshot: git-history-sbs

diff view: switch-layout

  • vertical / horizontal layout switcher
  • removed loading screen to make the diff load faster :)
  • when switching between diffs (eg using the arrows) the UI state is copied to the new diff (text/graphical mode, divider value etc)
  • git annotation colors for files
  • commit icon instead of folder icon

summary view: clearer-links

  • fixes https://github.com/apache/netbeans/issues/5680
  • made the links more obvious
  • added collapse msg link which was missing

merge-commits-desaturated

  • merge commits are a little bit desaturated and not rendered in bold

quick search filter: history-all-filter

  • implemented all-filter and made it the default
  • highlighting is now consistently working in the relevant columns
  • even in tooltips
  • some other bug fixes and things I probably forgot to write down

added file filter and path highlighting: git-history-file-filter

mbien avatar Mar 04 '24 02:03 mbien

~this is still a little bit WIP. I want to check if I can implement a file filter with highlighting etc, and also improve how the table behaves in single-file-history mode (https://github.com/apache/netbeans/issues/5680#issuecomment-1979131388)~

done, added a screenshot of the file filter.

mbien avatar Mar 05 '24 16:03 mbien

I found a few more issues but thats as much I want to do via a single PR.

File filter is now implemented, this required some optimizations - which is a good thing since this made everything faster.

  • the cell renderer code which calculated the longest path of the displayed file paths had O(n²) complexity, this is now linear
  • filter results are cached per revision and are invalidated when the search changes
  • some other smaller optimizations

mbien avatar Mar 10 '24 06:03 mbien

I added another commit which removes the branch filter of the toolbar. The reason for that is essentially https://github.com/apache/netbeans/pull/6594 which never got fully resolved.

The branch filter in the toolbar filtered the results after the git log command ran. This requires to have all branch information in the revisions, if some branches are missing, it is likely that the filter will remove too many commits (it often would show no results at all in larger repos). Removing the branch filter fixes it.

Secondly: there is a second branch filter in the search options section which runs during git log and is therefore not affected. Having two branch filters in the same UI is also a bit questionable, it confused me quite often tbh even when it worked. The typical usecase is to view the history of the checked out branch which is the default anyway.

toolbar branch filter removed with search section expanded: image

mbien avatar Mar 12 '24 05:03 mbien

things I haven't implemented:

  • I wanted to add file type icons to the diff view but couldn't find an elegant way of doing this
  • diff view file name column has no quicksearch highlighting due to the way how the tree works, I left a comment in-code
  • I haven't touched the file history window at all otherwise this PR would be too large. It doesn't listen to hotkeys etc. (NB has too many diff windows!)
  • UI persistence. Layout and table column settings are not persisted.

mbien avatar Mar 23 '24 09:03 mbien

going to squash/rebase to fewer commits and make this ready to merge soon

mbien avatar Mar 26 '24 00:03 mbien