Skip to content
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

enhancement: context aware preview app media rendering #9882

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fschade
Copy link
Collaborator

@fschade fschade commented Oct 29, 2023

Description

Until now, the preview app had always displayed all images,
regardless of what the user had selected or where the request came from.

Of course, permissions have been taken into account so far,
but the behavior was still wrong in certain cases.

In the following scenarios, the app displayed all media from the same folder:

  • the user created a single file public link, navigated to the shared via link panel,
    clicked the single shared resource.
  • the user created a single file share (regardless of access permissions), navigated to the
    shared with others panel, clicked the single shared resource.
  • the user searched for a file, clicked one of the media search results.
  • the user marked a single file as favorite, navigated to the favorites list,
    clicked on one from that list.

now the behavior is changed and the preview app takes the referer into consideration and displays
only the selected resource in one of the above cases.

not sure if its the perfect way to have a explicit list of those context's, maybe a exclude list would be more (everything expect the direct space referer)!? what do you think?

Related Issue

Motivation and Context

ezgif-2-09128abecb

How Has This Been Tested?

  • unit testst
  • e2e tests (ci)

Screenshots (if appropriate):

Screen.Recording.2023-10-29.at.15.08.42.mp4

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@fschade fschade added the Status:Needs-Review Needs review from a maintainer label Oct 29, 2023
@fschade fschade self-assigned this Oct 29, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

73.3% 73.3% Coverage
0.0% 0.0% Duplication

Copy link
Member

@dschmidt dschmidt 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 like this kind of specific route handling in a concrete app implementation.

The app loads the files via loadFolderForFileContext, that function should be patched instead to handle the context correctly and load the correct folder.
Being able to implement that was one of the reasons to introduce the folder loaders. The proper implementation for this change would be to use those in loadFolderForContexr imho

@fschade
Copy link
Collaborator Author

fschade commented Oct 29, 2023

@tbsbdr i talked to @dschmidt and we discussed some use cases:

Scenario: a user has 5 single file public links, the user navigates to the shares, shared via link panel. The user clicks one file from the list.

a) the user can browse through (preview) all 5 files, no matter in which parent folder the individual file is

b) the user gets only 1 file in the preview, no navigation, no nothing (the user has to close the preview and select another file to see it.)

same applies for search, favorite, ….

b) is currently implemented in that pr, as described in the issue, a) sounds more useful to me but involves more work and maybe more network traffic (search folder loader, favorites loader, …), but this must be evaluated to give a valuable answer

what do you say, a or b?

@dschmidt
Copy link
Member

I'd argue browsing through multiple single file shares might be a bit odd, but especially for favorites I think it makes lot of sense to be able to browse.

Anyhow I think the behavior should be implemented in the composable so all apps loading a context folder share the same behavior. Currently it's only the preview app but I like to be prepared for additional ones

@fschade
Copy link
Collaborator Author

fschade commented Oct 29, 2023

I'd argue browsing through multiple single file shares might be a bit odd, but especially for favorites I think it makes lot of sense to be able to browse.

Anyhow I think the behavior should be implemented in the composable so all apps loading a context folder share the same behavior. Currently it's only the preview app but I like to be prepared for additional ones

I agree, have it there makes totally sense to me too, but then the composable has to have knowledge about the app context too!?

if we decide to have that „single file“ behavior globally, the composable is the best place for it.

Let’s discuss that tomorrow after my dentist appointment :(

@dschmidt
Copy link
Member

The composable has access to file context, file context contains the route which is exactly what you need here. I think it comes all together pretty nicely.

I don't insist on single file or folder loading behavior for specific cases, in fact we can go through all scenarios and define behavior individually. I just insist on handling it through the composable to make it consistent and keep it separated from app logic

but yes, we can totally discuss tomorrow or whenever you are feeling better

@fschade
Copy link
Collaborator Author

fschade commented Oct 30, 2023

@JammingBen, @dschmidt and i discussed the behavior again today and came to the conclusion that we prefer solution a

the user can browse through (preview) all 5 files, no matter in which parent folder the individual file is (all from the list)

in that case its not a bugfix anymore and should be part of our regular sprint work and needs a user story.

cc.: @tbsbdr.

i keep that open for later reference as a draft.

@fschade fschade removed the Status:Needs-Review Needs review from a maintainer label Oct 30, 2023
@fschade fschade marked this pull request as draft October 30, 2023 16:35
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.

[Preview app] Shows images that are not in the current file list
2 participants