Skip to content

track the currentIndex of each subdir in fs tree#1366

Merged
maks merged 5 commits intomasterfrom
334-store-prev-dir-indexes
Apr 7, 2026
Merged

track the currentIndex of each subdir in fs tree#1366
maks merged 5 commits intomasterfrom
334-store-prev-dir-indexes

Conversation

@maks
Copy link
Copy Markdown
Collaborator

@maks maks commented Mar 16, 2026

Uses a small stack to track the current position in each dir as we navigate down through a set of samples subdirs, so that we maintain prev position as we go back up the dir tree.

This makes navigating something like the AKWF subdirs a much more pleasent experience.

The stack size is 32, so only support 32 subdirs deep but that should be plenty for even extremely deeply organised sample pack file hierarchies.

Fixes: #334

@maks maks requested a review from democloid March 16, 2026 07:29
Base automatically changed from 1358-wrong-list-position to master March 16, 2026 21:12
@maks maks force-pushed the 334-store-prev-dir-indexes branch from 237f423 to 579ec26 Compare March 20, 2026 07:07
Copy link
Copy Markdown
Collaborator

@democloid democloid left a comment

Choose a reason for hiding this comment

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

I don't necessarily have a problem with the idea, but we are introducing a hard limit in depth, at which point we may want to warn the user in some way. How does this actually fail at that point from a user perspective? do we want to colorize directories on a different color at the last level?

I'd implement this with an actual stack before reviewing, seems cleaner.

Comment thread sources/Application/Views/ImportView.h Outdated
@maks maks requested a review from democloid March 27, 2026 05:29
@maks
Copy link
Copy Markdown
Collaborator Author

maks commented Mar 27, 2026

I don't necessarily have a problem with the idea, but we are introducing a hard limit in depth, at which point we may want to warn the user in some way. How does this actually fail at that point from a user perspective? do we want to colorize directories on a different color at the last level?

@democloid 32 levels deep is aleady a crazy deep file tree! The most I have seen in sample packs is 6 levels deep. For comparison our codebase here is max 18 deep. Also we don't have any way we show that a dir exceeds its max of file entries either and just silently truncate at the limit.

@maks maks force-pushed the 334-store-prev-dir-indexes branch from ef3b442 to 7e1638b Compare April 7, 2026 07:50
@maks maks merged commit 173dd3e into master Apr 7, 2026
1 check passed
@maks maks deleted the 334-store-prev-dir-indexes branch April 7, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sample browser should remember position when returning to parent directory

2 participants