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

Implement dark/light/default theme for viewer handlers #1051

Merged
merged 3 commits into from
Oct 20, 2021

Conversation

juliushaertl
Copy link
Member

Contributes to nextcloud/text#82

This PR adds the capability for mimetype handlers to indicate in which theme mode they run for their file displaying. The following 3 modes would be available:

  • dark: Background is always dark (e.g. current style, used for images)
  • light: Background is always light (e.g. Collabora doesn't offer a dark mode and has a bright interface so it can use the light viewer theme)
  • default: Background adapts to the accessibility settings (e.g. text adapts to the main background color so the default mode will use the same color as the modal background)

The only thing I'm not entirely happy is that the theme is only available once the viewer has fetched the fileinfo (which might take a bit depending on the network and server). In order to avoid flickering between dark/light, I for now introduced an intermediate loading state where there is no mask background and just the loading spinner until the theme is available. (See screen recordings for how that looks) Though I'm of course open for other ideas how to handle that.

Peek.2021-10-15.09-44.mp4
Peek.2021-10-15.09-44-dark.mp4

@juliushaertl juliushaertl added enhancement New feature or request 3. to review Waiting for reviews labels Oct 15, 2021
@juliushaertl juliushaertl added this to the Nextcloud 23 milestone Oct 15, 2021
Copy link
Member

@nimishavijay nimishavijay left a comment

Choose a reason for hiding this comment

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

Looks good! The spinner isn't that much of a problem. It is visible properly only when there are less number of files like in the Photos app screen recording. But it is not much of an issue and this looks like the best way.
So looks good to me! 🚀

@skjnldsv
Copy link
Member

/compile amend /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants