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: create workspace from loading existing exported file #2122

Merged
merged 64 commits into from
May 9, 2023

Conversation

pengx17
Copy link
Collaborator

@pengx17 pengx17 commented Apr 25, 2023

This pull request adds the feature to export and import workspaces as SQLite files, refactors the IPC communication between the main and renderer processes in the Electron app, and fixes some bugs.

Data flow design

image

How does adding workspace work behind the scene

image

How does main registers handlers?

image

New workspace:

new-w.mp4

Add workspace (import from existing db file):

add-w.mp4

New workspace general setting
a8305f57-684b-4cb8-9a0c-ebc5262e466c

@vercel
Copy link

vercel bot commented Apr 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
affine-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2023 7:37am
affine-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2023 7:37am

@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:27 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:27 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:27 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:27 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:27 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:27 — with GitHub Actions Inactive
@github-actions github-actions bot added the app:electron Related to electron app label Apr 25, 2023
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:30 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Patch coverage: 40.00% and project coverage change: -3.37 ⚠️

Comparison is base (5432aae) 71.59% compared to head (dadf299) 68.23%.

❗ Current head dadf299 differs from pull request most recent head e058478. Consider uploading reports for the commit e058478 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2122      +/-   ##
==========================================
- Coverage   71.59%   68.23%   -3.37%     
==========================================
  Files         298      279      -19     
  Lines        6644     6230     -414     
  Branches     1078      912     -166     
==========================================
- Hits         4757     4251     -506     
- Misses       1688     1758      +70     
- Partials      199      221      +22     
Flag Coverage Δ
e2etest 67.90% <40.27%> (-1.12%) ⬇️
server-test 73.14% <ø> (ø)
storybook-test 55.21% <0.00%> (ø)
unittest ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nts/affine/tmp-disable-affine-cloud-modal/style.ts 58.33% <ø> (ø)
...mponents/affine/workspace-setting-detail/index.tsx 80.48% <ø> (ø)
...ne/workspace-setting-detail/panel/export/index.tsx 14.28% <0.00%> (-10.72%) ⬇️
...ne/workspace-setting-detail/panel/general/style.ts 62.50% <ø> (-26.39%) ⬇️
apps/web/src/components/root-app-sidebar/index.tsx 75.00% <0.00%> (ø)
apps/web/src/hooks/use-workspaces.ts 72.22% <0.00%> (-2.07%) ⬇️
apps/web/src/providers/theme-provider.tsx 63.63% <0.00%> (ø)
...omponent/src/components/app-sidebar/index.jotai.ts 69.23% <0.00%> (ø)
...ges/component/src/components/app-sidebar/index.tsx 72.41% <0.00%> (ø)
packages/component/src/ui/button/styles.ts 77.50% <ø> (+1.89%) ⬆️
... and 17 more

... and 99 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vercel vercel bot temporarily deployed to Preview – affine-preview April 25, 2023 08:31 Inactive
@perfsee
Copy link

perfsee bot commented Apr 25, 2023

affine-toeverything

Bundle main

diff ------------------- Bundle Size Diff -------------------------

@@                       EntryPoint: main                        @@
##                     master …-from-db-file                 +/- ##
===================================================================
< Bundle              3.11 MB        3.15 MB    +41.5 kB(+1.33%)   
< Initial JS          1.86 MB        1.87 MB     +9.9 kB(+0.53%)   
< Initial CSS         16.8 kB        20.9 kB   +4.13 kB(+24.66%)   
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
< Assets                   41             48                  +7   
< Chunks                   39             43                  +4   
< Packages                132            134                  +2   
= Duplicates                3              3                       
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Warnings ~~~~~~~~~~~~~~~~~~~~~~~~~~~#
! Separate mixed content assets files                              
! Avoid non-minified assets                                        
! Avoid cache wasting                                              

@@                    EntryPoint: pages/_app                     @@
##                     master …-from-db-file                 +/- ##
===================================================================
< Bundle                 3 MB        3.03 MB      +32 kB(+1.07%)   
< Initial JS          1.75 MB        1.75 MB      +459 B(+0.03%)   
< Initial CSS         16.8 kB        20.9 kB   +4.13 kB(+24.66%)   
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
< Assets                   39             46                  +7   
< Chunks                   37             41                  +4   
< Packages                132            134                  +2   
= Duplicates                3              3                       
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Warnings ~~~~~~~~~~~~~~~~~~~~~~~~~~~#
! Separate mixed content assets files                              
! Avoid non-minified assets                                        
! Avoid cache wasting                                              

@@                   EntryPoint: pages/_error                    @@
##                     master …-from-db-file                 +/- ##
===================================================================
= Bundle              16.6 kB        16.6 kB                       
= Initial JS          16.6 kB        16.6 kB                       
= Initial CSS             0 B            0 B                       
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
= Assets                    2              2                       
= Chunks                    2              2                       
= Packages                  5              5                       
= Duplicates                0              0                       

...and more

@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:34 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:34 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:34 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:34 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:34 — with GitHub Actions Inactive
@vercel vercel bot temporarily deployed to Preview – affine-storybook April 25, 2023 08:34 Inactive
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Apr 25, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: e058478
Status:⚡️  Build in progress...

View logs

@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:48 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:48 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:48 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:48 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:48 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:48 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development April 25, 2023 08:50 — with GitHub Actions Inactive
@himself65 himself65 temporarily deployed to development May 9, 2023 07:24 — with GitHub Actions Inactive
@himself65 himself65 temporarily deployed to development May 9, 2023 07:24 — with GitHub Actions Inactive
@himself65 himself65 temporarily deployed to development May 9, 2023 07:24 — with GitHub Actions Inactive
@himself65 himself65 temporarily deployed to development May 9, 2023 07:24 — with GitHub Actions Inactive
@himself65 himself65 temporarily deployed to development May 9, 2023 07:24 — with GitHub Actions Inactive
@himself65 himself65 temporarily deployed to development May 9, 2023 07:24 — with GitHub Actions Inactive
@vercel vercel bot temporarily deployed to Preview – affine-preview May 9, 2023 07:25 Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:26 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:26 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:26 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:26 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:27 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:27 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:29 — with GitHub Actions Inactive
@himself65 himself65 merged commit 7c2574b into master May 9, 2023
@himself65 himself65 deleted the 0425/feat/create-workspace-from-db-file branch May 9, 2023 07:30
@vercel vercel bot temporarily deployed to Preview – affine-storybook May 9, 2023 07:33 Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:33 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:33 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:33 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:33 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:33 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:33 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:33 — with GitHub Actions Inactive
@pengx17 pengx17 temporarily deployed to development May 9, 2023 07:33 — with GitHub Actions Inactive
@vercel vercel bot temporarily deployed to Preview – affine-preview May 9, 2023 07:37 Inactive
@xell xell added this to the AFFiNE 0.6 milestone May 10, 2023
@xell xell added the beta Issues should be fixed for current Beta release. label May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:electron Related to electron app app:web beta Issues should be fixed for current Beta release. mod:component mod:hooks mod:i18n Related to i18n mod:store mod:workspace Related to workspace
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants