Skip to content

Remember sort order of the file table in git diff view - #9430

Merged
matthiasblaesing merged 1 commit into
apache:masterfrom
Saljack:diff-file-table-remember-sort
Jul 3, 2026
Merged

matthiasblaesing merged 1 commit into
apache:masterfrom
Saljack:diff-file-table-remember-sort

Conversation

@Saljack

@Saljack Saljack commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

I want to always sort files by path in Git Diff view. This stores the sort configuration of the table in the Git Diff view. It is inspired by the same implementation in the subversion module.

Closes #7742

@mbien mbien added git [ci] enable versioning job ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Jun 6, 2026
@matthiasblaesing

Copy link
Copy Markdown
Contributor

I had a quick look and initially though that it did not work. I opened a testrun with this, changed sorting, closed IDE and reopened. The state was not persistet. Looking at the implementation i then saw that sorting is stored when the diff is closed. This seems counter intuitive. Consider this event order:

  1. Open two diffs
  2. Change the sort order in the first view
  3. Change the sort order in the second view
  4. Close the second view
  5. Close the first view

I would expect that the last setting survives, but in this case it is the first one.

It is inspired by the same implementation in the subversion module.

Can you point where that can be found? I was not able to find it.

@Saljack

Saljack commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@matthiasblaesing Thanks for your review. I did not realize that this table is used for general git diffs. I wanted mainly sorted files in Git Commit Diff view. Where you can have only one instance of the table.
image
image

Let me check it and fix it.

Can you point where that can be found? I was not able to find it.

https://github.com/apache/netbeans/blob/master/ide/subversion/src/org/netbeans/modules/subversion/ui/commit/CommitTable.java#L195

@Saljack

Saljack commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@matthiasblaesing Updated. Now it stores on click on the table header, and there is a change in sort order. Storing on a close diff is removed.

@Saljack
Saljack force-pushed the diff-file-table-remember-sort branch from 3bc7dfe to 7229123 Compare June 21, 2026 08:51
@Saljack

Saljack commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Fixed author and commiter name

@matthiasblaesing matthiasblaesing left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense to me. Thank you!

@matthiasblaesing matthiasblaesing added this to the NB31 milestone Jul 3, 2026
@matthiasblaesing
matthiasblaesing merged commit 26a988b into apache:master Jul 3, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) git [ci] enable versioning job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git Commit Diff tab file list does not remember sorting and is unsorted by default

3 participants