-
Notifications
You must be signed in to change notification settings - Fork 54
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
Full screen mode #1588
Full screen mode #1588
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine.
@nextcloud/designers what do you think ?
src/views/Viewer.vue
Outdated
<NcActionButton v-if="!isFullscreenMode" | ||
:close-after-click="true" | ||
@click="requestFullscreen"> | ||
<template #icon> | ||
<Fullscreen :size="20" /> | ||
</template> | ||
{{ t('viewer', 'Full screen') }} | ||
</NcActionButton> | ||
<NcActionButton v-else | ||
:close-after-click="true" | ||
@click="exitFullscreen"> | ||
<template #icon> | ||
<FullscreenExit :size="20" /> | ||
</template> | ||
{{ t('viewer', 'Exit full screen') }} | ||
</NcActionButton> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simplify this with a '"toggle full screen" kind of button? :)
Instead of two v-if/v-else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can. 😉 However, a few libraries that I have seen (to manage photo galleries) seem to use different icons to enter/exit full screen mode. More explicit text (Full screen/Exit full screen) also seems more appropriate to my taste. If we would like to keep these, I doubt that a single button with changing icon/text would be simpler/easier to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use two icons with v-if="isFullscreenMode"
and v-else
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<NcActionButton v-if="!isFullscreenMode" | |
:close-after-click="true" | |
@click="requestFullscreen"> | |
<template #icon> | |
<Fullscreen :size="20" /> | |
</template> | |
{{ t('viewer', 'Full screen') }} | |
</NcActionButton> | |
<NcActionButton v-else | |
:close-after-click="true" | |
@click="exitFullscreen"> | |
<template #icon> | |
<FullscreenExit :size="20" /> | |
</template> | |
{{ t('viewer', 'Exit full screen') }} | |
</NcActionButton> | |
<NcActionButton :close-after-click="true" | |
@click="toggleFullScreen"> | |
<template #icon> | |
<Fullscreen v-if="!isFullscreenMode" :size="20" /> | |
<FullscreenExit v-else :size="20" /> | |
</template> | |
{{ t('viewer', 'Toggle full screen') }} | |
</NcActionButton> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your suggestion! I have made a small adjustment and committed: 9cfff2a
src/views/Viewer.vue
Outdated
@@ -993,6 +1071,10 @@ export default { | |||
cursor: pointer; | |||
} | |||
|
|||
:deep(.modal-header) { | |||
background-color: rgba(0, 0, 0, 0.2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately that would not work out with bright theme viewer mode (not related to the global nextcloud theming), can you try this with he Text app for example? They use Viewer with a bright theme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried with the Text app and it is readable. One could even argue that having different background for the header is a good thing. 😉 Obviously this should be verified by the design team.
But - there is another problem that is much more serious.
In full screen mode content "slides" underneath the header - to use as much screen height as possible. This works good when browsing photos, but does not work at all for the text editor. Here is how it looks on Android.
The header is not visible at all. 😞
I guess we could have two modes of entering full screen:
- aggressive - used probably only for images when we "slide" content under the header
- normal - used for everything else, that would keep content below the header
Then the text editor would look like this in full screen:
I can implement these two modes in viewer, but I am not sure how to control which mode is used when. Could you please suggest something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @nextcloud/office
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say full-screen is only needed for images (and possibly videos).
Text files don't need fullscreen, and also should not have their header colored differently. :) So it's fine if they stay as they are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jancborchardt - text files in full screen mode now look like this:
src/views/Viewer.vue
Outdated
.modal-container-fullscreen { | ||
top: 0; | ||
bottom: 0; | ||
height: 100%; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we would not need that if we set the modal element as full screen instead of the modal ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even with the modal element made full screen this will be required - the CSS rule above sets top
and bottom
properties to --header-height
(50px AFAIK), to leave space for the header and have symmetric space at the bottom.
Line 1081 in 660d1fc
top: var(--header-height); |
As we want to use 100% of available screen height, we must set top/bottom to 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks quite good design-wise from my side.
@starypatyk also nice with the adjustment of the header in fullscreen.
I'd even say we could omit the filename and header bar background in fullscreen, instead making sure the icons on the top right have a half-transparent background (like in Talk)?
@jancborchardt - thanks for your comments. I looked at Talk for comparison and noticed that the icon in Talk is different than in my proposal. Talk uses the same icon to enter/exit full screen mode: In this PR there are separate icons for enter/exit and each of them is a different than the one used in Talk. There is also a small question regarding spelling - should it be "fullscreen" vs. "full screen"? Could you please suggest? Should I align Viewer to what is currently in Talk? Or vice versa? On the other hand I cannot see semi-transparent background for buttons in Talk. This is how Talk looks like in full screen mode in my environment. |
@starypatyk to answer your questions:
Would be awesome if you can adjust the wording and icon in Talk! :) Regarding the buttons, the viewer buttons are already semi-transparent, no? :) |
I think this might only be during a call. I'll pay attention to it during my next call and try to take a screenshot. |
Sure. I should be able to do it in the next few days.
Currently the buttons are fully transparent (unless focused). So without some semi-transparent background will be hard to spot on very light pictures. I have implemented your earlier suggestion - ef81778:
|
ef81778
to
3fd7881
Compare
Hi @skjnldsv, I have managed to fix most of the cypress tests to match proposed changes. The only one remaining is the Why is the whole There are important differences in two images.
But I also see small font differences in all images (base vs actual): In the last test run only the I am running my tests on Ubuntu (apparently similar to what is done in CI) - should I update all the base images or just the ones with significant differences? Or maybe it would make sense to increase threshold in PS. This is my first experience with cypress - I was surprised how quickly one can set it up and update the tests. 😮 |
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Co-authored-by: John Molakvoæ <skjnldsv@users.noreply.github.com> Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
85abbad
to
ab692ca
Compare
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
I think that I have implemented your suggestions. I have also managed to fix failing cypress tests. The PR is ready to merge. I do not plan more changes, unless you have additional comments. |
To avoid mistakenly adding an update of those snapshots.
Sooo glad to read this!! This is a very powerful tool indeed and luckily this is fairly easy to get around :)
To update the snapshots, you need to build with diff --git a/package.json b/package.json
index 174f0658..4fa6c0b9 100644
--- a/package.json
+++ b/package.json
@@ -35,8 +35,9 @@
"cypress": "npm run cypress:e2e",
"cypress:e2e": "cypress run --e2e",
"cypress:gui": "cypress open --e2e",
- "cypress:visual-regression": "TESTING=true cypress run --spec cypress/e2e/visual-regression.cy.js",
- "cypress:update-snapshots": "TESTING=true cypress run --env type=base --spec cypress/e2e/visual-regression.cy.js --config screenshotsFolder=cypress/snapshots/base"
+ "cypress:pre-snapshots": "TESTING=true npm run dev",
+ "cypress:visual-regression": "npm run cypress:pre-snapshots && cypress run --spec cypress/e2e/visual-regression.cy.js",
+ "cypress:update-snapshots": "npm run cypress:pre-snapshots && cypress run --env type=base --spec cypress/e2e/visual-regression.cy.js --config screenshotsFolder=cypress/snapshots/base"
},
"dependencies": {
"@fontsource/roboto": "^4.5.8", |
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Hi @skjnldsv,
Thanks for clarifying - I have updated one more image to get pixel perfect verification. 😉
I would rather not mix this with the functional changes for full screen. |
Would you be up to open another Pr for it afterwards? |
This PR is an attempt to implement full screen mode in the Viewer app.
Lack of full screen mode is inconvenient - esp. when viewing landscape photos on a mobile device. On Android this looks like this - only a small fraction of the screen is used to display the photo.
I have implemented a possibility to enter full screen mode - see screenshots below.
Additional item in the menu - "Full screen"
Viewer in full screen mode
Another item in the menu - "Exit full screen"
Implementation currently has the following limitations:
Any other questions/suggestions?