Skip to content

Conversation

@joshuamegnauth54
Copy link
Contributor

Closes: #766

Shift clicking the file browser button now opens the browser in the same directory as the currently viewed image.

Closes: woelper#766

Shift clicking the file browser button now opens the browser in the same
directory as the currently viewed image.
@Stoppedpuma
Copy link
Collaborator

Stoppedpuma commented Jan 16, 2026

Thanks so much! This PR helps me out a ton! I've tested this just now on macOS and this seems to work great with the rfd feature!

The only issue I can see that this PR has is this does not seem to work without the file_open (rfd) feature as this is something that should also work on Oculante's built-in file manager.

@joshuamegnauth54
Copy link
Contributor Author

To be honest, I didn't know if I had to implement it for the built-in file manager too. 😆 I'll take a look at it soon though.

@Stoppedpuma
Copy link
Collaborator

Stoppedpuma commented Jan 16, 2026

No worries! I completely understand! I do admit that this area is a bit confusing, especially since file_open is split into its own feature rather than making it an option in preferences. I'll have to look back at the last time this came up in discussions to see if there was a reason we don't already do this.

Edit: that thread can be found at #604 if it interests you.

Like the last commit, this implements opening the file browser in the
current image directory when the button is shift clicked. This commit
specifically implements it for the built-in file browser. The solution
is a bit hacky compared to the file dialog implementation since I had to
force the built-in browser to reload the directory.
@joshuamegnauth54
Copy link
Contributor Author

I implemented it for the built-in file browser too. 😁 The implementation for the built-in browser isn't the best, but I'll rethink it and make it nicer in the future if I figure it out.

@Stoppedpuma
Copy link
Collaborator

Stoppedpuma commented Jan 17, 2026

Awesome!

I've tested this just now and just ran into this weird issue that seems to update the path bar but not the directory contents?

image

These are the contents of a dir at ~/pictures/example/ which can also be seen below, not the tests folder at ~/dev/git/oculante/tests

image

To reproduce, open Oculante regularly and select an image in a dir, for example ~/downloads, then close that window and run this branch with cargo run /path/to/image (that's in a different directory of course!). Shift + Click or just Click on the file manager, then do the other one (If you clicked, do shift click instead this time) and only the path bar updates, the contents are different depending on which click variant you did first.

If the embedded file browser is opened in a certain mode then switched
to a different mode, it must be forced to refresh or else it shows stale
entries.
@joshuamegnauth54
Copy link
Contributor Author

I experienced that issue too, but I thought I fixed it the first time around. 😅 It should be fixed now though.

@Stoppedpuma
Copy link
Collaborator

Stoppedpuma commented Jan 20, 2026

Thanks! Unfortunately I found two more cases where I'm able to reproduce this still.

The first is when making use of the compare feature:

  1. cargo run /path/to/image
  2. shift + click to verify directory is originally correct
  3. add to compare
  4. Shift + click, add image from another dir
  5. Shift + click yet again to check that dir is corect
  6. add the second image to compare
  7. Switch back to the first image and Shift click, the stale results show on either the first image, or the second one when you shift click.

The second is drag and dropping an image into Oculante.

I apologise that this is so problematic, we really should have made tests a high priority to make finding these cases easier. I'll mention to woelper that it's something we definitely should work on with as high priority as switching away from Notan to make development easier in the future.

@joshuamegnauth54
Copy link
Contributor Author

I think I fixed it for compare! 😁 I'll take a look at drag and drop soon.

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.

Ability for file manager to open from directory of currently viewed image

2 participants