Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Feature] Keep tree state and selection in 'Files' tab when changing commit in history #1396

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

Open
johanw1232 wants to merge 2 commits into sourcegit-scm:develop
base: develop
Choose a base branch
Loading
from goran-w:files_preserve_tree_state

Conversation

Copy link
Contributor

@johanw1232 johanw1232 commented Jun 5, 2025

In the 'Files' tab for commit history window when previewing the selected file you lose the selection and expand state of all the nodes when selecting a new commit. It would be nice to keep the selection (if possible) when jumping between commits, for a quick glace of the changes made in a single file.

This PR aims to keep the selected item and update the preview to the new commit.

Mingun reacted with heart emoji
@love-linger love-linger self-assigned this Jun 6, 2025
@love-linger love-linger added the not-planned It's not planned in the future label Jun 6, 2025
Copy link
Collaborator

  • The directory structures may vary for different revisions.
  • Expanding a folder tree node means running the command git ls-tree -z <REVISION> -- <FOLDER_PATH> once. This will seriously affect the response speed of the entire interface. If the hierarchy is too deep, it may even cause the interface to freeze.
  • For the need to view the changes of the same file under different revisions, it is recommended to use the File Histories feature.

Copy link
Contributor

goran-w commented Jun 6, 2025
edited
Loading

  • The directory structures may vary for different revisions.

That is taken care of quite gracefully in this PR, by simply losing the selection (while still keeping the parent folder(s) expanded, if possible).

  • Expanding a folder tree node means running the command git ls-tree -z <REVISION> -- <FOLDER_PATH> once. This will seriously affect the response speed of the entire interface. If the hierarchy is too deep, it may even cause the interface to freeze.

I don't see a big slowdown even several levels deep in a folder with lots of files. (If this is an issue, we could have an option "Preserve selection in file-tree" or similar.)

  • For the need to view the changes of the same file under different revisions, it is recommended to use the File Histories feature.

That is not really the same thing, since this feature also shows the selected file in context at its path in the repo.

Having to drill down repeatedly to the same subfolder hierarchy each time another Commit gets selected is simply frustrating, and it makes the FILES view less useful than it could be.

mithom, heartacker, and Mingun reacted with thumbs up emoji

Copy link
Contributor

this is usefull

goran-w reacted with thumbs up emoji

@goran-w goran-w force-pushed the files_preserve_tree_state branch from 633242b to 4d9069b Compare August 4, 2025 07:54
Copy link
Contributor

goran-w commented Aug 4, 2025

Rebased the branch, to work with the newer async handling. May need some extra work just to remove "flickering" when re-expanding file-tree levels (should be done all-at-once before re-displaying tree).

@goran-w goran-w force-pushed the files_preserve_tree_state branch from 599832a to 876e2a3 Compare August 4, 2025 08:07
@love-linger love-linger force-pushed the develop branch 5 times, most recently from f325aaf to 6511d15 Compare August 19, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
not-planned It's not planned in the future
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /