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

feat: improve webapp, improve mobile player, improve design ✨ #629

Open
wants to merge 88 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
8f350dc
feat: add dev container config
IEduStu Apr 16, 2024
1089a62
fix: dev container config
IEduStu Apr 16, 2024
e45db84
fix: make exposed dev port public by default
IEduStu Apr 16, 2024
054bb8e
fix: add note about exposing port in dev container
IEduStu Apr 16, 2024
382eb44
fix: make maskable icons not get overriden during the build
IEduStu Apr 16, 2024
2eb8d3d
feat: improve mobile design
IEduStu Apr 17, 2024
c4c7f20
feat: improve mobile design
IEduStu Apr 17, 2024
d8b9f10
feat: mobile controls overlay
IEduStu Apr 17, 2024
a9090ca
fix: bugs
IEduStu Apr 17, 2024
ff90922
fix: bugs
IEduStu Apr 17, 2024
14e5d6c
fix: bugs
IEduStu Apr 17, 2024
8d529ad
feat: open video in nPlayer on iOS
IEduStu Apr 17, 2024
45bfd45
fix: colors
IEduStu Apr 17, 2024
c99a649
fix: iOS webapp config
IEduStu Apr 17, 2024
6e22348
fix: remove double scrollbars
IEduStu Apr 17, 2024
c74879b
fix: preserve existing desktop play behavior
IEduStu Apr 17, 2024
2769b03
build: allow manually triggering the CI
IEduStu Apr 17, 2024
3d14818
test: fix tests
IEduStu Apr 17, 2024
6a636c9
style: lint
IEduStu Apr 17, 2024
d6806fb
build: make deploying to GitHub Pages work
IEduStu Apr 17, 2024
d405cf3
build: fix config
IEduStu Apr 17, 2024
18d66fa
build: make deploying to GitHub Pages work
IEduStu Apr 17, 2024
0e2b259
fix: toggle show controls on tap when buffering on mobile
IEduStu Apr 17, 2024
2abceb3
fix: bugs
IEduStu Apr 17, 2024
e6061f1
fix: support toggling video fullscreen on iOS
IEduStu Apr 17, 2024
aea1518
fix: bugs
IEduStu Apr 17, 2024
de54300
feat: workaround to hide iOS navigation bar in the player on the webapp
IEduStu Apr 17, 2024
d00e6b1
pr: update workflow
IEduStu Apr 17, 2024
46d439c
pr: fix shade in addons screen
IEduStu Apr 17, 2024
d50e02c
pr: fix Firefix flickers in the Discover screen
IEduStu Apr 17, 2024
ac078a3
pr: fix layouts edge cases, text cropping, login screen, search scree…
IEduStu Apr 17, 2024
09efeff
feat: add support for the wordaround to hide iOS system navigation ba…
IEduStu Apr 17, 2024
d5bab29
fix: focus on the correct settings section button
IEduStu Apr 17, 2024
912f0ed
fix: gliches in Safari in Settings screen
IEduStu Apr 17, 2024
ff4c2f5
fix: layout bugs, settings screen bug
IEduStu Apr 17, 2024
34c4411
refactor: switch from `env()` to css vars
IEduStu Apr 17, 2024
782df15
fix: no hover on touch screens
IEduStu Apr 20, 2024
ca278bb
fix: focus scroll on scrollable elements
IEduStu Apr 20, 2024
ae1f859
fix: improve navigation buttons contrast
IEduStu Apr 20, 2024
8dbd63e
fix: make slider work correctly on touch screens
IEduStu Apr 20, 2024
72bfd86
fix: make screen switching animation feel smoother
IEduStu Apr 20, 2024
f308360
fix: animation was too long in the user menu
IEduStu Apr 20, 2024
9834ac4
fix: fine-tune touch gesture recofnition numbers
IEduStu Apr 20, 2024
02d011c
fix: smaller UI areas on mobile in the player
IEduStu Apr 20, 2024
cf5ff44
fix: subtitles should not render under unsafe areas
IEduStu Apr 20, 2024
7ab52f9
fix: double tap gesture called twice
IEduStu Apr 20, 2024
50668c9
fix: toast shadow was clipped
IEduStu Apr 20, 2024
7a0a992
fix: video area should expand blow unsafe areas
IEduStu Apr 20, 2024
691fc7a
feat: airplay support on Safari
IEduStu Apr 20, 2024
474c004
fix: airplay active state effects
IEduStu Apr 20, 2024
014e90d
fix: improve Airplay active state detection
IEduStu Apr 20, 2024
b16ae81
fix: show the Airplay button on all Safari browsers
IEduStu Apr 20, 2024
f6da39e
fix: toasts container caused a scroll on the library screen
IEduStu Apr 21, 2024
8c69dd2
fix: make player menu font more clear
IEduStu Apr 21, 2024
101c461
fix: don't render embedded subtitles under safe areas
IEduStu Apr 21, 2024
ac072ee
fix: pad top and bottom sides of the video to not cover the bottom un…
IEduStu Apr 21, 2024
51ce1b1
fix: only pad the bottom of the video
IEduStu Apr 21, 2024
584acb8
pr: support multi-branch and single-branch GitHub Pages deployments
IEduStu Apr 22, 2024
e4cba7a
fix: slider touch end event
IEduStu Apr 22, 2024
06130ea
fix: remove duplicate top navbar top safe inset margin
IEduStu Apr 22, 2024
edd2d8d
fix: make sure the scrollbar is not cropped on all platforms, improve…
IEduStu Apr 26, 2024
1081a1e
fix: generic detection of overlay scrollbars
IEduStu Apr 26, 2024
9e31fda
fix: when clicking on the `Download this video` button in the player,…
IEduStu Apr 30, 2024
48198a4
fix: simplify download video button logic
IEduStu Apr 30, 2024
097af8d
feat: copy download link button, use i18n
IEduStu May 1, 2024
e380c7e
fix: align texts with new translations PR
IEduStu May 1, 2024
ba55ea9
fix: workarounds for CSS issues on Safari
IEduStu May 1, 2024
ff2d9a9
fix: position issue
IEduStu May 1, 2024
b2fdded
fix: check for `overflow: clip` support
IEduStu May 1, 2024
a744f02
Merge remote-tracking branch 'origin/development' into mobileImprovem…
IEduStu May 18, 2024
f005cc8
fix: shrink header in player only when there's no enough space
IEduStu May 18, 2024
c817d6f
fix: dialog buttons direction on mobile
IEduStu Jun 19, 2024
b9304b4
fix: attempt to fix status bar color issue
IEduStu Jun 19, 2024
0fccb85
Merge remote-tracking branch 'origin/development' into mobileImprovem…
IEduStu Jul 24, 2024
1e0a56c
fix: focused settings scrtion buttons on some zoom levels
IEduStu Jul 24, 2024
51fe50f
chore: use new translation texts from sub-PR
IEduStu Jul 24, 2024
6392137
fix: streaming server message margin
IEduStu Jul 25, 2024
2911efd
fix: CI workflow
IEduStu Jul 25, 2024
30f0346
fix: focused settings section buttons
IEduStu Jul 25, 2024
25a62ad
fix: focused settings section buttons
IEduStu Jul 25, 2024
85544ca
Merge remote-tracking branch 'origin/development' into mobileImprovem…
IEduStu Jul 26, 2024
b791e7e
Merge remote-tracking branch 'origin/development' into mobileImprovem…
IEduStu Jul 31, 2024
ed078e1
fix: CR comments
IEduStu Sep 17, 2024
3513606
style: lint
IEduStu Sep 17, 2024
f357299
Merge remote-tracking branch 'origin/development' into mobileImprovem…
IEduStu Sep 17, 2024
f15e365
fix: rever to last not broken `@stremio/stremio-core-web` version
IEduStu Sep 17, 2024
596190a
Merge remote-tracking branch 'origin/development' into mobileImprovem…
IEduStu Sep 18, 2024
1aa1c11
Merge remote-tracking branch 'origin/development' into mobileImprovem…
IEduStu Sep 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Stremio Web dev container",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/git-lfs:1": {}
},
"forwardPorts": [8080],
"portsAttributes": {
"8080": {
"label": "Web Server (don't forget to manually change this port to public in the Ports tab in VS Code to access it externally)",
"onAutoForward": "notify",
"protocol": "https"
}
},
"postCreateCommand": "npm install",
"customizations": {
"vscode": {
"settings": {
"window.menuBarVisibility": "visible",
"files.autoSave" : "afterDelay",
"window.commandCenter": true
}
}
}
}
23 changes: 16 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@ name: Build
on:
push:
branches:
- development
tags-ignore:
- '**'
pull_request:
branches:
- development
- '**'
# Allow manual dispatch in GH
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -36,7 +34,7 @@ jobs:
# Create recursivelly the destiantion dir with
# "--parrents where no error if existing, make parent directories as needed."
- run: mkdir -p ./build/${{ github.head_ref || github.ref_name }}
- name: Deploy to GitHub Pages
- name: Deploy to GitHub Pages (multi-branch)
if: github.repository == 'Stremio/stremio-web' && github.actor != 'dependabot[bot]'
uses: peaceiris/actions-gh-pages@v4
with:
Expand All @@ -46,3 +44,14 @@ jobs:
# so we need a recursive creation of the destination dir
destination_dir: ${{ github.head_ref || github.ref_name }}
allow_empty_commit: true
- name: Upload build to GitHub Pages
Copy link
Contributor

Choose a reason for hiding this comment

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

@IEduStu Could you create one more branch out of mobileImprovements branch in your fork, for me to see how the new CD pipeline will behave?

Copy link
Author

Choose a reason for hiding this comment

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

Done.
You can see the CI of a commit on the forked branch here.
I've make this change to the CI to make it deploy the build to GitHub Pages, since the existing action for this didn't work.

This new code uses GitHub Action's official actions to deploy to GitHub Pages.
To make it work for any fork, you just have to enable GitHub Actions on the fork and enable GitHub Pages in the repo settings and it would work without configuring any environment variable or something like that.

Copy link
Contributor

Choose a reason for hiding this comment

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

The expected result is a new directory in the gh-pages branch, with the name of the new branch so that we can access it at https://stremio.github.io/stremio-web/<new-branch-name>/

The goal is to have all branches deployed to gh pages simultaniously

Copy link
Author

@IEduStu IEduStu Apr 22, 2024

Choose a reason for hiding this comment

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

I originally made this change because I thought the deployment didn't work, but it seems that it did just in a different manner than I anticipated.
This is really cool :)

I see how useful it is to have it for a repo with multiple developers working on it, but I think it may lead other forks the same path that I went - thinking the deployment didn't work.
So I made another change for the CI to use the previous action when an environment variable named GITHUB_PAGES_MULTI_BRANCH is set to true, and otherwise use the simpler deploy action.

This way you can set GITHUB_PAGES_MULTI_BRANCH to true in this repo settings and preserve the current behavior, and forks that people create won't inherit this environment variable and thus will have the simpler deploy action.
The idea of this is to remove friction in developing this repo on forks, while preserving the current CI behavior.

Let me know if you think it's a good idea or whether should I just revert this whole CI change.

if: github.event_name == 'push' && github.repository != 'Stremio/stremio-web'
uses: actions/upload-pages-artifact@v3
with:
name: stremio-web
path: build
- name: Deploy build to GitHub Pages (single branch)
if: github.event_name == 'push' && github.repository != 'Stremio/stremio-web'
uses: actions/deploy-pages@v4
with:
artifact_name: stremio-web
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"react-i18next": "^12.1.1",
"react-is": "18.2.0",
"spatial-navigation-polyfill": "github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
"stremio-translations": "github:Stremio/stremio-translations#b13b3e2653bd0dcf644d2a20ffa32074fe6532dd",
"stremio-translations": "github:Stremio/stremio-translations#4182ec9bf732e1cda0e2e6c714fd235077eb6ae1",
"url": "0.11.0",
"use-long-press": "^3.1.5"
},
Expand Down
25 changes: 25 additions & 0 deletions src/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ const App = () => {
window.removeEventListener('hashchange', onLocationHashChange);
};
}, []);
React.useEffect(() => {
// on some platforms, like mobile and macOS (with a trackpad), the scrollbars aren't visible when they're not being used,
// here we detect this behavior so we can immitate it with our custom scrollbar styles on those platforms

const testTag = document.createElement('div');
testTag.classList.add('test-overlay-scrollbar');
testTag.style.width = '100px';
testTag.style.height = '100px';
testTag.style.overflow = 'scroll';
testTag.style.position = 'fixed';
testTag.style.top = '-200px';
testTag.style.left = '-200px';
testTag.style.opacity = '0';
testTag.style.pointerEvents = 'none';
testTag.style.scrollbarWidth = 'thin';

document.body.appendChild(testTag);

// checks whether the scrollbar actually takes space inside of the element
const osOverlayScrollbar = testTag.offsetWidth === testTag.clientWidth;

testTag.remove();

document.documentElement.classList.toggle('os-overlay-scrollbar', osOverlayScrollbar);
}, []);
React.useEffect(() => {
const onCoreStateChanged = () => {
setInitialized(
Expand Down
8 changes: 5 additions & 3 deletions src/App/ErrorDialog/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@
border-radius: 3.5rem;
background-color: var(--overlay-color);

&:hover {
outline: var(--focus-outline-size) solid var(--primary-foreground-color);
background-color: transparent;
@media (pointer: fine) {
&:hover {
outline: var(--focus-outline-size) solid var(--primary-foreground-color);
background-color: transparent;
}
}

&:active {
Expand Down
52 changes: 45 additions & 7 deletions src/App/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
--modal-background-color: rgba(15, 13, 32, 1);
--outer-glow: 0px 0px 30px rgba(123, 91, 245, 0.37);
--border-radius: 0.75rem;

background-color: #161523; // copied from WebpackPwaManifest config (see webpack.config.js)
}

* {
Expand All @@ -58,6 +60,16 @@
box-shadow: none;
overflow: hidden;
word-break: break-word;

@supports not selector(::-webkit-scrollbar) {
scrollbar-width: thin;
scrollbar-color: var(--overlay-color) transparent;
}
}

html:global(.os-overlay-scrollbar) {
// this makes the browser ignore the custom scrollbar styles when it bahves as an overlay on this platform
// and fallbacks to using the OS scrollbar with the given properties when it's not an overlay scrollbar
scrollbar-width: thin;
scrollbar-color: var(--overlay-color) transparent;
}
Expand Down Expand Up @@ -85,12 +97,30 @@ svg {
}

html {
width: 100%;
height: 100%;
width: ~"calc(max(100svw, 100dvw))";
height: ~"calc(max(100svh, 100dvh))";
min-width: 640px;
min-height: 480px;
font-family: 'PlusJakartaSans', 'sans-serif';
overflow: auto;
overscroll-behavior: none;
user-select: none;
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;

--safe-area-inset-top: env(safe-area-inset-top, 0px);
--safe-area-inset-right: env(safe-area-inset-right, 0px);
--safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
--safe-area-inset-left: env(safe-area-inset-left, 0px);
--calculated-bottom-safe-inset: var(--safe-area-inset-bottom);

@media (display-mode: standalone) {
width: ~"calc(max(100%, 100lvw))";
height: ~"calc(max(100%, 100lvh))";

// iOS pads the bottom inset more than needed, so we deduce the actual inset size when using the webapp
--calculated-bottom-safe-inset: ~"calc(min(env(safe-area-inset-bottom, 0px), max(16px, calc(100lvh - 100svh - env(safe-area-inset-top, 0px)))))";
}

body {
width: 100%;
Expand All @@ -105,16 +135,19 @@ html {

.toasts-container {
position: absolute;
top: calc(1.2 * var(--horizontal-nav-bar-size));
right: 0;
bottom: calc(1.2 * var(--horizontal-nav-bar-size));
top: calc(1.2 * var(--horizontal-nav-bar-size) + var(--safe-area-inset-top, 0px));
right: var(--safe-area-inset-right, 0px);
bottom: calc(1.2 * var(--horizontal-nav-bar-size) + var(--calculated-bottom-safe-inset, 0px));
left: auto;
z-index: 1;
padding: 0 calc(0.5 * var(--horizontal-nav-bar-size));
overflow-y: auto;
scrollbar-width: none;
pointer-events: none;

@supports not selector(::-webkit-scrollbar) {
scrollbar-width: none;
}

&::-webkit-scrollbar {
display: none;
}
Expand Down Expand Up @@ -183,7 +216,12 @@ html {
body {
:global(#app) {
.toasts-container {
padding: 0 1rem;
padding-top: 3rem;
padding-left: 3rem;
padding-bottom: 3rem;
margin-top: -3rem;
margin-left: -3rem;
margin-bottom: -3rem;
}

.tooltip-container {
Expand Down
16 changes: 10 additions & 6 deletions src/common/AddonDetailsModal/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
background-color: transparent;
opacity: 0.3;

&:hover {
outline: var(--focus-outline-size) solid var(--primary-foreground-color);
opacity: 1;
@media (pointer: fine) {
&:hover {
outline: var(--focus-outline-size) solid var(--primary-foreground-color);
opacity: 1;
}
}

&:focus {
Expand All @@ -34,9 +36,11 @@
.uninstall-button {
background-color: var(--overlay-color);

&:hover {
outline: var(--focus-outline-size) solid var(--overlay-color);
background-color: transparent;
@media (pointer: fine) {
&:hover {
outline: var(--focus-outline-size) solid var(--overlay-color);
background-color: transparent;
}
}

&:focus {
Expand Down
2 changes: 2 additions & 0 deletions src/common/Button/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
outline-color: @color-surface-light5;
outline-offset: calc(-1 * var(--focus-outline-size));
cursor: pointer;
-webkit-touch-callout: none;
touch-callout: none;

&:focus {
outline-style: solid;
Expand Down
8 changes: 5 additions & 3 deletions src/common/Chips/Chip/Chip.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
user-select: none;
overflow: hidden;

&:hover {
background-color: var(--overlay-color);
transition: background-color 0.1s ease-out;
@media (pointer: fine) {
&:hover {
background-color: var(--overlay-color);
transition: background-color 0.1s ease-out;
}
}

&.active {
Expand Down
6 changes: 4 additions & 2 deletions src/common/EventModal/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@
font-weight: 700;
}

&:hover {
background-color: transparent;
@media (pointer: fine) {
&:hover {
background-color: transparent;
}
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/common/MainNavBars/MainNavBars.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const TABS = [
{ id: 'settings', label: 'SETTINGS', icon: 'settings', href: '#/settings' },
];

const MainNavBars = React.memo(({ className, route, query, children }) => {
const MainNavBars = React.memo(({ className, route, query, noOverflow, children }) => {
return (
<div className={classnames(className, styles['main-nav-bars-container'])}>
<HorizontalNavBar
Expand All @@ -32,7 +32,7 @@ const MainNavBars = React.memo(({ className, route, query, children }) => {
selected={route}
tabs={TABS}
/>
<div className={styles['nav-content-container']}>{children}</div>
<div className={classnames(styles['nav-content-container'], {[styles['no-overflow']]: noOverflow})}>{children}</div>
</div>
);
});
Expand All @@ -43,7 +43,8 @@ MainNavBars.propTypes = {
className: PropTypes.string,
route: PropTypes.string,
query: PropTypes.string,
children: PropTypes.node
noOverflow: PropTypes.bool,
children: PropTypes.node,
};

module.exports = MainNavBars;
Loading