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

Mobile: Support building for web #10650

Merged
merged 191 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
3bd28d2
Partially building web support
personalizedrefrigerator Aug 26, 2023
0861b96
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jun 21, 2024
7434ac8
Main screen loads
personalizedrefrigerator Jun 21, 2024
85983db
Working note viewer and editor
personalizedrefrigerator Jun 21, 2024
27e50db
Fix linter errors
personalizedrefrigerator Jun 22, 2024
6260956
Fix Firefox startup
personalizedrefrigerator Jun 22, 2024
e687363
Styling and sync fixes
personalizedrefrigerator Jun 22, 2024
9794871
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jun 22, 2024
5a86531
Fix mobile build
personalizedrefrigerator Jun 22, 2024
3c2f34b
Improve styles
personalizedrefrigerator Jun 22, 2024
3dec27e
Fix installing plugins from file & plugin panels
personalizedrefrigerator Jun 22, 2024
b6ac625
Scrollbar style adjustments
personalizedrefrigerator Jun 22, 2024
8ef0762
Fix JEX import
personalizedrefrigerator Jun 22, 2024
d1d548d
Faster tarExtract
personalizedrefrigerator Jun 22, 2024
78174ee
File system and alert fixes
personalizedrefrigerator Jun 22, 2024
50f5541
WIP: Resource rendering
personalizedrefrigerator Jun 22, 2024
e6177bd
Fix note editor error
personalizedrefrigerator Jun 22, 2024
8ce47d6
Fix Dropbox sync fails to download resources
personalizedrefrigerator Jun 22, 2024
0100450
Fix some UI elements too small
personalizedrefrigerator Jun 22, 2024
fe03161
Fix randomBytes implementation
personalizedrefrigerator Jun 22, 2024
e04935c
GitHub pages deploy
personalizedrefrigerator Jun 22, 2024
bfa6da6
Fix test
personalizedrefrigerator Jun 22, 2024
9dd6e8b
Create release builds in CI
personalizedrefrigerator Jun 22, 2024
fd9512f
pages deploy: Checkout correct branch
personalizedrefrigerator Jun 22, 2024
2552134
Fix test
personalizedrefrigerator Jun 22, 2024
2aa3e98
Try to handle cross origin isolation failure in a better way
personalizedrefrigerator Jun 22, 2024
6456142
Renderer: Asset loading
personalizedrefrigerator Jun 22, 2024
8a48149
Fix Firefox plugin loading; possible Safari startup fix
personalizedrefrigerator Jun 23, 2024
79a7622
Trying to fix CI
personalizedrefrigerator Jun 23, 2024
6c70d1b
Better handling of case where no document is selected
personalizedrefrigerator Jun 23, 2024
eff8a98
Attempt to improve container sizing when loaded in a mobile browser
personalizedrefrigerator Jun 23, 2024
b689f94
PWA support
personalizedrefrigerator Jun 23, 2024
1f3b052
Commenting improvements
personalizedrefrigerator Jun 24, 2024
f9b7372
Fix attaching images
personalizedrefrigerator Jun 24, 2024
91b3e2e
index.html: Add OpenGraph meta tag
personalizedrefrigerator Jun 24, 2024
0257206
Fix mobile runtime error
personalizedrefrigerator Jun 24, 2024
7d0213f
Fix editing existing images
personalizedrefrigerator Jun 24, 2024
12adcd9
WIP: RSA using crypto.subtle
personalizedrefrigerator Jun 24, 2024
45b9420
Revert "WIP: RSA using crypto.subtle"
personalizedrefrigerator Jun 24, 2024
b6d137f
Provide more information about startup errors
personalizedrefrigerator Jun 24, 2024
7a0c432
PWA: Limit which requests are cached
personalizedrefrigerator Jun 24, 2024
0827088
Fix netinfo error when state.details is undefined
personalizedrefrigerator Jun 24, 2024
520ffa6
Fix size of items in sidemenu
personalizedrefrigerator Jun 24, 2024
db17369
PWA manifest: Add screenshots
personalizedrefrigerator Jun 24, 2024
c59dc98
index.html: Attempt to make room for software keyboard.
personalizedrefrigerator Jun 24, 2024
8b5a660
Handle cache.put errors
personalizedrefrigerator Jun 24, 2024
a5115d8
Add og:image meta tag
personalizedrefrigerator Jun 24, 2024
1a1df6e
Fix quotes in more SQL queries
personalizedrefrigerator Jun 24, 2024
8901da5
Trying to fix sync with encryption
personalizedrefrigerator Jun 24, 2024
dcdf0c6
Attempt to work around lack of RSA encryption on web
personalizedrefrigerator Jun 24, 2024
db9dbe8
Request persistent storage
personalizedrefrigerator Jun 24, 2024
0f59007
Possible better virtual keyboard handling
personalizedrefrigerator Jun 25, 2024
498df3d
Android: Better virtual-keyboard-related layout adjustments
personalizedrefrigerator Jun 25, 2024
e1d5597
iOS: Prevent virtual keyboards from covering the markdown toolbar
personalizedrefrigerator Jun 25, 2024
72df71f
Fix JEX import
personalizedrefrigerator Jun 25, 2024
fab2813
Fix JEX export
personalizedrefrigerator Jun 25, 2024
39124c2
Fix internal links
personalizedrefrigerator Jun 25, 2024
f867e44
Plugin config screen: Fix loading bar too tall
personalizedrefrigerator Jun 25, 2024
9cfd235
Fix inserting new drawings
personalizedrefrigerator Jun 25, 2024
bdfe98e
Open PDFs, external links in new tabs
personalizedrefrigerator Jun 25, 2024
7eae6a8
Chrome: Partial support for file system sync
personalizedrefrigerator Jun 25, 2024
33fa25a
Fix file stat objects always have mtime set to 0
personalizedrefrigerator Jun 25, 2024
681cd3b
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jun 25, 2024
573a0c1
Cleanup after merge
personalizedrefrigerator Jun 25, 2024
40c705e
Chrome: Persist access to file system handles
personalizedrefrigerator Jun 25, 2024
a12f18a
Web build: Prefer .ts files to .js files
personalizedrefrigerator Jun 25, 2024
1d0bcd8
Use RN Paper for most alert dialogs
personalizedrefrigerator Jun 25, 2024
c4f6018
Prefer native dialogs on iOS
personalizedrefrigerator Jun 25, 2024
7997d5b
Prevent markdown toolbar buttons from dismissing the keyboard. To-do:…
personalizedrefrigerator Jun 25, 2024
a22e1a9
Attempt to prevent sidebar and keyboard-related scroll issues
personalizedrefrigerator Jun 25, 2024
936e086
Attempting to fix web accessibility issues
personalizedrefrigerator Jun 25, 2024
28cdc10
Web: Hide biometrics and voice typing settings (not supported on web)
personalizedrefrigerator Jun 25, 2024
4714067
Attempting to improve plugin asset loading
personalizedrefrigerator Jun 26, 2024
63729e8
Fix KaTeX font loading
personalizedrefrigerator Jun 26, 2024
94b8393
Improve keyboard focus handling
personalizedrefrigerator Jun 26, 2024
7fcfb9d
Folder list: Open folder edit dialog on right-click
personalizedrefrigerator Jun 26, 2024
b1e6162
Fix dialogs are too small on small screens
personalizedrefrigerator Jun 26, 2024
4f3cb5d
Fix scrolling on the plugin search results screen
personalizedrefrigerator Jun 26, 2024
a87d203
Adjust (temporary) loading indicator style
personalizedrefrigerator Jun 26, 2024
a6f15af
Allow syncing with a dev-mode copy of Joplin Server
personalizedrefrigerator Jun 26, 2024
02dbbf2
Fix linter errors
personalizedrefrigerator Jun 26, 2024
9d2f7c9
Web/pickDocument -- fix multiple document selection
personalizedrefrigerator Jun 26, 2024
b098d29
Camera: On web: Show a file picker
personalizedrefrigerator Jun 27, 2024
aeac6b0
Fix long-press -> open on images
personalizedrefrigerator Jun 27, 2024
dfa56f1
Web: Fix scrolling markdown toolbar buttons activates them
personalizedrefrigerator Jun 27, 2024
d728090
Fix LogScreen not showing logs on web
personalizedrefrigerator Jun 27, 2024
518ccb6
Fix LogScreen share button
personalizedrefrigerator Jun 27, 2024
56f9f9e
LogScreen:Remove unnecessary extraData
personalizedrefrigerator Jun 27, 2024
5f46365
Attempting to fix "InvalidStateError: Context has stopped" on iOS
personalizedrefrigerator Jun 27, 2024
85aad50
Attempting to fix multiple copies of registry.js bundled
personalizedrefrigerator Jun 27, 2024
ab276c1
Retry fs-driver startup on failure
personalizedrefrigerator Jun 27, 2024
f4d7aa0
Web: Set default resource download mode to "auto"
personalizedrefrigerator Jun 27, 2024
ce89729
Remove outdated debug comment
personalizedrefrigerator Jun 27, 2024
05cb0a8
Trying to fix keyboard scroll bug
personalizedrefrigerator Jun 27, 2024
2c3314d
Initial support for single-instance locking
personalizedrefrigerator Jun 27, 2024
fca1e62
Refactor multi-client check and service worker
personalizedrefrigerator Jun 27, 2024
722fdeb
Add the closed.html page
personalizedrefrigerator Jun 27, 2024
c498b84
Fix image resize logic
personalizedrefrigerator Jun 27, 2024
3b37776
Fix service worker doesn't ensure that only one client is running when
personalizedrefrigerator Jun 27, 2024
6a50bbb
iOS+Safari: Fix note editor scrolls partially out of view when editin…
personalizedrefrigerator Jun 27, 2024
c9e36a9
Hide the "share" option on unsupported platforms
personalizedrefrigerator Jun 28, 2024
8d3de99
Fix broken alarm dialog. (Still no support for showing notifications).
personalizedrefrigerator Jun 28, 2024
956e436
Fix downloading plugins on web
personalizedrefrigerator Jun 28, 2024
21ef340
Fix plugin info modal scrolling
personalizedrefrigerator Jun 28, 2024
1b56016
Mark OneDrive as unsupported on web
personalizedrefrigerator Jun 28, 2024
d664a45
Add a Content-Security-Policy header
personalizedrefrigerator Jun 28, 2024
92492ad
Use Alert.alert in fewer places
personalizedrefrigerator Jun 28, 2024
e41e931
ServiceWorker caching: Don't cache responses from other domains
personalizedrefrigerator Jun 28, 2024
cc5bd1f
Web: Fix long press > share
personalizedrefrigerator Jun 28, 2024
ec76829
CSP: Allow data-URL images
personalizedrefrigerator Jun 29, 2024
3c6c35b
Fix wrong number of buttons shown for "uninstall plugin" dialog
personalizedrefrigerator Jun 29, 2024
83a9c80
Fix empty space shown where the OneDrive sync option previously was.
personalizedrefrigerator Jun 29, 2024
16c4068
Fix joplin-noteDidUpdate dispatched before some plugins could finish …
personalizedrefrigerator Jun 29, 2024
cf12b20
Renderer: Attempt to reduce time before initial scroll is applied
personalizedrefrigerator Jun 29, 2024
90dddac
Refactoring & fix plugin assets not loaded
personalizedrefrigerator Jun 29, 2024
a429c50
Hide "copy external link" on web as not supported
personalizedrefrigerator Jun 29, 2024
484c87c
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jun 29, 2024
7ad7196
Fix the rendered note media player.
personalizedrefrigerator Jun 29, 2024
f837506
Code cleanup
personalizedrefrigerator Jun 29, 2024
b0c4146
For now, remove the deploy-github-pages.yml workflow
personalizedrefrigerator Jun 29, 2024
2afbca7
Improve share accept error message
personalizedrefrigerator Jul 1, 2024
fc5b15c
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jul 1, 2024
2919d37
Pin versions
personalizedrefrigerator Jul 1, 2024
001087b
Revert debugging changes
personalizedrefrigerator Jul 1, 2024
73c9c95
Enable dev mode when running on localhost, fix tests
personalizedrefrigerator Jul 1, 2024
5df650e
Revert unnecessary testId in DismissibleDialog
personalizedrefrigerator Jul 1, 2024
ce1a026
Move iframe wrapper styles out of main ExteendedWebView component
personalizedrefrigerator Jul 1, 2024
64345ad
Remove TODO comment
personalizedrefrigerator Jul 1, 2024
97e3672
console.warn -> logger.info
personalizedrefrigerator Jul 1, 2024
61c881d
Clean up webpack.config.js
personalizedrefrigerator Jul 1, 2024
7fc1797
Revert package upgrades that should be made in separate PRs
personalizedrefrigerator Jul 1, 2024
b3d8c2a
For now, disable custom dialogs on Android
personalizedrefrigerator Jul 1, 2024
f4bf7a3
Fix if condition
personalizedrefrigerator Jul 1, 2024
bd5fd75
Increase the log level in fs-driver-rn.web.worker
personalizedrefrigerator Jul 1, 2024
93ec159
Fix file system sync with an empty directory
personalizedrefrigerator Jul 2, 2024
3579a28
Geolocation support
personalizedrefrigerator Jul 2, 2024
9ddcee3
Refactor main stylesheet into a separate file
personalizedrefrigerator Jul 2, 2024
8ffc2b2
Adjust logic for when the screen size can be adjusted to compensate for
personalizedrefrigerator Jul 2, 2024
2c8077c
Adjust status bar theme correctly on iOS; change style of loading ind…
personalizedrefrigerator Jul 2, 2024
842ac01
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jul 5, 2024
9ca3a6b
Update yarn.lock
personalizedrefrigerator Jul 5, 2024
074fdbc
Decrease default log level for fs-driver-rn.web.worker
personalizedrefrigerator Jul 5, 2024
9179c0a
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jul 6, 2024
8691925
Auto-reload dev plugins
personalizedrefrigerator Jul 6, 2024
edc0b2d
Re-decrease log level for fs-driver-rn.worker
personalizedrefrigerator Jul 6, 2024
22727cd
Increase permissions in note viewer/plugin webviews
personalizedrefrigerator Jul 6, 2024
556118c
Fix dev plugins are reloaded too frequently
personalizedrefrigerator Jul 6, 2024
347ba0d
Fix notes with not-downloaded resources fail to render
personalizedrefrigerator Jul 7, 2024
efec878
Improve dev plugin reload condition
personalizedrefrigerator Jul 8, 2024
da7d6ee
Support pasting images
personalizedrefrigerator Jul 11, 2024
60edc10
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jul 11, 2024
bed9540
Fix tests
personalizedrefrigerator Jul 11, 2024
7cfa425
Update yarn.lock;
personalizedrefrigerator Jul 11, 2024
df265aa
Use ExtendedWebView.web as the CI mock for ExtendedWebView & reduce
personalizedrefrigerator Jul 12, 2024
5fd39b2
Fix test warning
personalizedrefrigerator Jul 12, 2024
68cf6c2
Document the build process for the web client
personalizedrefrigerator Jul 15, 2024
5a17e9a
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jul 16, 2024
e5ee2c0
Clean up after merge
personalizedrefrigerator Jul 16, 2024
2bf310d
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jul 22, 2024
75c3147
Post-merge cleanup
personalizedrefrigerator Jul 22, 2024
81aa902
Fix tests
personalizedrefrigerator Jul 22, 2024
884e23c
Revert dev plugin support
personalizedrefrigerator Jul 22, 2024
f5de0fc
Add beta warning
personalizedrefrigerator Jul 22, 2024
ac7ebfe
Use a fallback edit icon on web for drawings -- getImageSourceSync isn't
personalizedrefrigerator Jul 22, 2024
0d901d9
Fix compilation
personalizedrefrigerator Jul 22, 2024
2589469
cache: Use the service worker cache for failed responses, even if not…
personalizedrefrigerator Jul 23, 2024
8323a8e
Android + Chrome: Fix touching buttons in the markdown toolbar dismisses
personalizedrefrigerator Jul 24, 2024
5a08f8e
Accessibility improvements
personalizedrefrigerator Jul 24, 2024
3781af6
Accessibility: Hide views from accessibility that should be hidden,
personalizedrefrigerator Jul 24, 2024
1d7ec28
index.html: Add <meta name="description" ...>
personalizedrefrigerator Jul 24, 2024
e4b4dfc
Update commenting and descriptions
personalizedrefrigerator Jul 24, 2024
17895e6
Fix cross origin isolation failed error message is invisible
personalizedrefrigerator Jul 24, 2024
930c0c2
Fix fallback edit icon slightly off-center
personalizedrefrigerator Jul 24, 2024
bb69c04
Chrome: Fix unnecessary horizontal editor scrollbar
personalizedrefrigerator Jul 24, 2024
297ca7b
Fix shim.Geolocation.currentPosition not working in Chrome
personalizedrefrigerator Jul 24, 2024
e7cba51
Use custom dialogs instead of browser dialogs for shim.showMessageBox
personalizedrefrigerator Jul 18, 2024
832d8a8
Merge remote-tracking branch 'refs/remotes/origin/work/mobile-web' in…
personalizedrefrigerator Jul 25, 2024
df40ad6
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jul 25, 2024
752b627
Hide "enableWebviewDebugging" on web -- unsupported
personalizedrefrigerator Jul 25, 2024
191f349
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jul 26, 2024
5e05141
Remove unnecessary file and apply suggestions from self-review of code
personalizedrefrigerator Jul 26, 2024
da5ad9d
Remove duplicate logger.error
personalizedrefrigerator Jul 26, 2024
ec59114
useRerenderHandler: Remove depenency on FsDriverWeb
personalizedrefrigerator Jul 26, 2024
7a28f58
Make comment about fetch not working in some cases more accurate
personalizedrefrigerator Jul 26, 2024
06bd2d7
Remove now-unnecessary eslint-disable-next-line comment
personalizedrefrigerator Jul 26, 2024
ffa6930
Remove shim-init logic unnecessarily duplicated between web & rn files
personalizedrefrigerator Jul 26, 2024
ea45909
Revert unnecessary new export
personalizedrefrigerator Jul 26, 2024
615017a
Merge remote-tracking branch 'upstream/dev' into work/mobile-web
personalizedrefrigerator Jul 31, 2024
2352eb8
Update yarn.lock
personalizedrefrigerator Jul 31, 2024
8b2f4ff
Remove potentially inaccurate comment
personalizedrefrigerator Jul 31, 2024
5b4eae5
Add technical doc for the web app
personalizedrefrigerator Jul 31, 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
Prev Previous commit
Next Next commit
Geolocation support
  • Loading branch information
personalizedrefrigerator committed Jul 2, 2024
commit 3579a28811b03beeca44bc7354e952ac641cc7c2
7 changes: 6 additions & 1 deletion packages/app-mobile/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,13 @@ async function initialize(dispatch: Dispatch) {
reg.logger().info(`First start: detected locale as ${detectedLocale}`);

if (shim.mobilePlatform() === 'web') {
// Web browsers generally have more limited storage than desktop and mobile apps:
Setting.setValue('sync.resourceDownloadMode', 'auto');
logger.info('First start on web: Set resource download mode to auto.');
// For now, geolocation is disabled by default on web until the web permissions workflow
// is improved. At present, trackLocation=true causes the "allow location access" prompt
// to appear without a clear indicator for why Joplin wants this information.
Setting.setValue('trackLocation', false);
Comment on lines +642 to +645
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently, this is disabled by default because no user-visible reason is shown for why location permission is requested. The "Allow location access" prompt is shown when first creating a new note (after enabling location tracking), but there isn't any context for why Joplin wants to track the user's location.

Currently, however, I don't think the existing mobile app explains why location permissions are being requested. As such, for consistency, it could make sense to remove this different default:

Suggested change
// For now, geolocation is disabled by default on web until the web permissions workflow
// is improved. At present, trackLocation=true causes the "allow location access" prompt
// to appear without a clear indicator for why Joplin wants this information.
Setting.setValue('trackLocation', false);

logger.info('First start on web: Set resource download mode to auto and disabled location tracking.');
}

Setting.skipDefaultMigrations();
Expand Down
15 changes: 15 additions & 0 deletions packages/app-mobile/utils/shim-init-react/index.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ import { FetchBlobOptions } from '@joplin/lib/types';
import JoplinError from '@joplin/lib/JoplinError';

const shimInit = () => {
type GetLocationOptions = { timeout?: number };
shim.Geolocation = {
currentPosition: ({ timeout = 10000 }: GetLocationOptions = {}) => {
return new Promise((resolve, reject) => {
navigator.geolocation?.getCurrentPosition((position) => {
if (!position?.coords) {
resolve(null);
}

resolve(position);
}, (error) => reject(error), { timeout });
});
},
};

let fsDriver_: FsDriverWeb|null = null;

const fsDriver = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Resource from '@joplin/lib/models/Resource';
const shim: typeof ShimType = require('@joplin/lib/shim').default;

const shimInitShared = () => {
shim.Geolocation = null;
shim.sjclModule = require('@joplin/lib/vendor/sjcl-rn.js');

shim.stringByteLength = function(string) {
Expand Down
Loading