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: File Browser Update (urls, examples, etc) #308

Merged
merged 123 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
a50326d
open file from url
davidkircos Feb 23, 2023
2967aab
file menu updates
jimniels Mar 1, 2023
a4f1001
scaffolding UI
jimniels Mar 3, 2023
06fd849
more tweaks
jimniels Mar 3, 2023
b77af0f
more tweaks
jimniels Mar 3, 2023
a44cad2
more tweaks
jimniels Mar 3, 2023
3256779
merge latest from main
jimniels Mar 3, 2023
1305b78
update topbar menu lost in merge
jimniels Mar 3, 2023
a494ff8
more tweaks
jimniels Mar 4, 2023
3ca1481
initial refactor
davidfig Mar 4, 2023
b1d67ef
file loads
davidfig Mar 4, 2023
c20d18f
Merge branch 'main' into load-from-url-david
davidfig Mar 4, 2023
431ce44
prettier
davidfig Mar 4, 2023
abfa922
working through useLocalFiles changes
davidfig Mar 4, 2023
cc9c445
sample load and save works
davidfig Mar 5, 2023
6deba9b
prettier
davidfig Mar 5, 2023
262262e
added query string for loading files
davidfig Mar 5, 2023
7c94f3b
name untitled files
davidfig Mar 5, 2023
b4a7b48
rename file functionality (no UI)
davidfig Mar 5, 2023
23c735f
import file (WIP)
davidfig Mar 5, 2023
1cf0652
importLocalFile
davidfig Mar 5, 2023
b70ed93
prettier
davidfig Mar 5, 2023
b550e63
import file from URL
davidfig Mar 5, 2023
41f0740
cleaning up files
davidfig Mar 5, 2023
b47800c
default open file dialog unless first time or query string
davidfig Mar 5, 2023
fb79b6d
Merge branch 'main' into load-from-url-david
davidfig Mar 5, 2023
969afde
merge latest from main
jimniels Mar 6, 2023
5cdb4dd
merge latest from load-from-url
jimniels Mar 6, 2023
752beb4
Merge pull request #340 from quadratichq/load-from-url-david
jimniels Mar 6, 2023
15759b5
fix: don't wrap tab panel in typography
jimniels Mar 6, 2023
17a3ba3
fix: sentence case
jimniels Mar 6, 2023
eb6759e
fix: tweak language
jimniels Mar 6, 2023
a8943e9
Update TopBar.tsx
jimniels Mar 6, 2023
1fe0434
Update TopBar.tsx
jimniels Mar 6, 2023
6edef8e
default currentFilename to empty string
jimniels Mar 7, 2023
882487e
Update useLocalFiles.ts
jimniels Mar 7, 2023
cbff6e8
tweaks
jimniels Mar 7, 2023
2e318e7
remove console
jimniels Mar 7, 2023
433f2fa
Update useLocalFiles.ts
jimniels Mar 7, 2023
e2ca8fb
Update useLocalFiles.ts
jimniels Mar 7, 2023
3582a12
Update useLocalFiles.ts
jimniels Mar 7, 2023
5142234
use favicon
jimniels Mar 7, 2023
e6a7c3e
Merge pull request #342 from quadratichq/load-from-url-filename
jimniels Mar 7, 2023
44343b0
feat: add indicator when file is open
jimniels Mar 7, 2023
31a9e85
fix: match sorting
jimniels Mar 7, 2023
417e916
support delete file
jimniels Mar 7, 2023
c30153c
add comment
jimniels Mar 7, 2023
aadda01
update description
jimniels Mar 7, 2023
bd3fc22
fix: make language match
jimniels Mar 7, 2023
80f735a
responsive layout
jimniels Mar 8, 2023
fa73d09
add new, delete
jimniels Mar 8, 2023
d4f6b48
fix: application/json + .grid
jimniels Mar 8, 2023
346960a
bunch 'o stuff
jimniels Mar 8, 2023
c7b8485
fix: file commands
jimniels Mar 8, 2023
d337d6b
fix todos
jimniels Mar 8, 2023
9a30851
fix: file rename and extensions
jimniels Mar 8, 2023
dc6a7a3
fixes
jimniels Mar 8, 2023
5c9a568
rename file
jimniels Mar 9, 2023
e1fd4ab
run reset at the right time
jimniels Mar 9, 2023
1302746
more tweaks
jimniels Mar 9, 2023
fafcc12
remove console
jimniels Mar 9, 2023
19c771a
tweaks
jimniels Mar 10, 2023
68b1030
initial changes
jimniels Mar 10, 2023
147d119
refactor useLocalFiles hook
jimniels Mar 11, 2023
f803734
refactor
jimniels Mar 22, 2023
c4d957f
merge latest changes
jimniels Mar 22, 2023
107116e
Merge branch 'load-from-url' into load-from-url-context
jimniels Mar 22, 2023
12f1c59
tweaks
jimniels Mar 22, 2023
38a1588
Merge pull request #348 from quadratichq/load-from-url-context
jimniels Mar 22, 2023
b7c74ab
more tweaks
jimniels Mar 23, 2023
5d2d8a4
more tweaks/updates
jimniels Mar 23, 2023
d668c65
update examples to be based off main
jimniels Mar 24, 2023
b6a42bb
remove extra app.save()
jimniels Mar 24, 2023
092248e
update to support multiple schemas
jimniels Mar 24, 2023
92515a0
initial run at converting typescript types to zod types
jimniels Mar 28, 2023
f17b91f
add zod to deps
jimniels Mar 28, 2023
e516ab3
rename GridFileSchema type to GridFile
jimniels Mar 28, 2023
65590bf
pull version from the schema
jimniels Mar 28, 2023
b62101b
Update useLocalFiles.ts
jimniels Mar 28, 2023
e12c437
more tweaks
jimniels Mar 28, 2023
cb90c4f
further tweaks
jimniels Mar 28, 2023
37ebb5f
Update useLocalFiles.ts
jimniels Mar 29, 2023
d1dfbcc
refactor: app structure at load time
jimniels Mar 29, 2023
4d88914
feat: add support for downloading any file in memory
jimniels Mar 29, 2023
3265203
Merge branch 'main' into load-from-url
jimniels Mar 29, 2023
1b6b774
revert flags change
jimniels Mar 29, 2023
d4760ea
refactor: sort type keys optionally, then alphabetically
jimniels Mar 29, 2023
793e617
Delete FileLoadingComponent.tsx
jimniels Mar 29, 2023
38e2f53
rename generic "things"
jimniels Mar 29, 2023
d3e0a8d
tweak download icons
jimniels Mar 29, 2023
6c7e278
remove unused code
jimniels Mar 30, 2023
9c41f90
remove unused prop
jimniels Mar 30, 2023
e24812e
Update FileMenu.tsx
jimniels Mar 30, 2023
b9892d3
Update useLocalFiles.ts
jimniels Mar 30, 2023
3639491
more tweaks
jimniels Mar 30, 2023
69f649e
Update useLocalFiles.ts
jimniels Mar 30, 2023
9649b23
don't throw when you can't find the grid
jimniels Mar 30, 2023
346dc59
change error to warning
jimniels Mar 30, 2023
3ac1659
Merge branch 'main' into load-from-url
jimniels Mar 31, 2023
c624aa3
tweaks
jimniels Mar 31, 2023
289025a
Update useLocalFiles.ts
jimniels Mar 31, 2023
34b76ac
Update app.ts
jimniels Mar 31, 2023
91d8280
update typescript
jimniels Mar 31, 2023
b1cd720
Merge branch 'main' into load-from-url
davidkircos Apr 1, 2023
242a019
Update useLocalFiles.ts
jimniels Apr 3, 2023
293f990
Update QuadraticMenu.tsx
jimniels Apr 3, 2023
39754e3
fix logo on mobile
jimniels Apr 3, 2023
1c4504b
fix firefox bg problem
jimniels Apr 3, 2023
25b39ec
refine CMD + O functionality
jimniels Apr 3, 2023
6e6203f
Merge branch 'main' into load-from-url
jimniels Apr 3, 2023
7f03995
Update FileMenu.tsx
jimniels Apr 3, 2023
a157e6a
Merge branch 'load-from-url' of github.com:quadratichq/quadratic into…
jimniels Apr 3, 2023
4849b7f
more tweaks
jimniels Apr 3, 2023
b993540
rename variables
davidkircos Apr 3, 2023
eb5ad2f
Update useLocalFiles.ts
jimniels Apr 3, 2023
94e0e72
rename pixi to pixi-assets
davidkircos Apr 3, 2023
9ab06ba
Merge branch 'load-from-url' of https://github.com/quadratichq/quadra…
davidkircos Apr 3, 2023
151c0b7
Update useLocalFiles.ts
jimniels Apr 3, 2023
f1b9298
Merge branch 'load-from-url' of github.com:quadratichq/quadratic into…
jimniels Apr 3, 2023
91f1b08
fixes a bug deleting the wrong cell when deleting a single cell
davidkircos Apr 3, 2023
674f3e5
Merge branch 'load-from-url' of https://github.com/quadratichq/quadra…
davidkircos Apr 3, 2023
b5c4762
bugfix
jimniels Apr 3, 2023
a85a68f
Merge branch 'load-from-url' of github.com:quadratichq/quadratic into…
jimniels Apr 3, 2023
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"cSpell.words": [
"dgraph",
"Fuzzysort",
"pixi",
"pixiapp",
"subquadrant",
"subquadrants"
Expand Down
67 changes: 56 additions & 11 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@types/react": "^17.0.33",
"@types/react-color": "^3.0.6",
"@types/react-dom": "^17.0.10",
"@types/uuid": "^9.0.1",
"ace-builds": "^1.4.13",
"axios": "^0.24.0",
"color": "^4.2.3",
Expand All @@ -50,7 +51,9 @@
"recoil": "^0.6.0",
"sass": "^1.56.2",
"typescript": "^4.4.4",
"web-vitals": "^1.0.1"
"uuid": "^9.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we need this dependency....

It looks like you can create IDs with crypto.randomUUID() which is a native browser feature. Support appears to be good enough (better than probably other things in our app)

So I'm thinking: maybe we just strip out this dependency and use crypto.randomUUID() instead. Objections?

cc @davidfig @davidkircos

"web-vitals": "^1.0.1",
"zod": "^3.21.4"
},
"main": "public/electron.js",
"scripts": {
Expand Down
12 changes: 4 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import * as React from 'react';

import './styles.css';

import { LoadingProvider } from './contexts/LoadingContext';

import { QuadraticAuth } from './quadratic/QuadraticAuth';
import { isWASMSupported } from './utils/isWASMSupported';
import { isWebGLSupported } from '@pixi/utils';
import { BrowserNotSupported } from './ui/overlays/BrowserNotSupported';
import * as Sentry from '@sentry/browser';
import { RecoilRoot } from 'recoil';

export default function App() {
// Check if browser supports WebGL and WASM
Expand All @@ -22,9 +19,8 @@ export default function App() {
}

return (
<LoadingProvider>
{/* Provider of QuadraticApp */}
<QuadraticAuth></QuadraticAuth>
</LoadingProvider>
<RecoilRoot>
<QuadraticAuth />
</RecoilRoot>
);
}
2 changes: 2 additions & 0 deletions src/atoms/editorInteractionStateAtom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface EditorInteractionState {
showCodeEditor: boolean;
showCommandPalette: boolean;
showGoToMenu: boolean;
showFileMenu: boolean;
selectedCell: Coordinate;
mode: CellTypes;
}
Expand All @@ -16,6 +17,7 @@ export const editorInteractionStateDefault: EditorInteractionState = {
showCodeEditor: false,
showCommandPalette: false,
showGoToMenu: false,
showFileMenu: false,
selectedCell: { x: 0, y: 0 },
mode: 'TEXT',
};
Expand Down
31 changes: 31 additions & 0 deletions src/constants/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
import { isMobile } from 'react-device-detect';

export const IS_READONLY_MODE = isMobile;
export const DEFAULT_FILE_NAME = 'Untitled';
export const EXAMPLE_FILES = [
{
name: 'Default (example)',
description: 'Quick overview of basic usage of the app.',
file: 'default.grid',
},
{
name: 'Python (example)',
file: 'python.grid',
description: 'Advanced examples of how to use Python in the app.',
},
// Leaving this one out, as it has nothing useful for users
// { name: 'Airports large (example)', file: 'airports_large.grid', description: 'Lorem ipsum santa dolor.' },
{
name: 'Airports distance (example)',
file: 'airports_distance.grid',
description: 'Example of filtering data and calculating values in the app.',
},
{ name: 'Expenses (example)', file: 'expenses.grid', description: 'Example of spreadsheet-style budgeting.' },
{
name: 'Monte Carlo simulation (example)',
file: 'monte_carlo_simulation.grid',
description: 'Example of working with large sets of data.',
},
{
name: 'Startup portfolio (example)',
file: 'startup_portfolio.grid',
description: 'Example with calculations from formulas and Python.',
},
];
1 change: 1 addition & 0 deletions src/constants/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export const API_URL = 'http://localhost:8000';
export const DOCUMENTATION_URL = 'https://docs.quadratichq.com';
export const DOCUMENTATION_PYTHON_URL = `${DOCUMENTATION_URL}/python`;
export const DOCUMENTATION_FORMULAS_URL = `${DOCUMENTATION_URL}/formulas`;
export const DOCUMENTATION_FILES_URL = `${DOCUMENTATION_URL}/files`;
export const BUG_REPORT_URL = 'https://github.com/quadratichq/quadratic/issues';
41 changes: 0 additions & 41 deletions src/contexts/LoadingContext.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions src/grid/actions/gridFile/GridFileSchema.ts

This file was deleted.

Loading