Skip to content

Universal desktop web codebase#425

Merged
cguedes merged 29 commits into
mainfrom
422-universal-desktop-web-codebase
Aug 30, 2023
Merged

Universal desktop web codebase#425
cguedes merged 29 commits into
mainfrom
422-universal-desktop-web-codebase

Conversation

@cguedes

@cguedes cguedes commented Aug 28, 2023

Copy link
Copy Markdown
Collaborator

This PR closes #422 by removing the if/else conditions using import.meta.env.VITE_IS_WEB to implement a different code path between the desktop and web applications.

Changes:

  • ✅ Updated backend API to return project name
  • ✅ Updated backend API to ensure required files and directories (.staging/references.json and the project folder)
  • ✅ Updated new/open project flow to always use the backend API
  • ✅ Updated backend API to support HEAD /api/fs/... (for file exists)
  • ✅ Update frontend to support the sample project
    • ℹ️ The app ensure we only have a single project for the sample (checking the project name), and also overrides sample text files, but don't override the project files (ex: uploaded references)
  • ✅ Save the project ID in settings instead of the project path
    • ℹ️
  • ✅ Update filesystem to always use the backend API instead of tauri/fs methods
  • ✅ Fix upload & save files for the desktop Tauri (file upload don't work) 🎉
  • ✅ Adopt backend API instead of sidecar
    • ✅ chat
    • ✅ ingestion
    • ✅ rewrite
    • ✅ completion

Follow-up:

 - return project name
 - ensure storage folder (and references.json) exists
 - always create directory for new projects
 - support return project files for desktop
@cguedes cguedes linked an issue Aug 28, 2023 that may be closed by this pull request
@codecov

codecov Bot commented Aug 28, 2023

Copy link
Copy Markdown

Codecov Report

Merging #425 (3bc40e6) into main (a322cd0) will increase coverage by 0.16%.
The diff coverage is 36.57%.

@@            Coverage Diff             @@
##             main     #425      +/-   ##
==========================================
+ Coverage   77.78%   77.94%   +0.16%     
==========================================
  Files         188      186       -2     
  Lines       11527    11206     -321     
  Branches     1116     1061      -55     
==========================================
- Hits         8966     8735     -231     
+ Misses       2546     2456      -90     
  Partials       15       15              
Files Changed Coverage Δ
python/generate_schema.py 0.00% <0.00%> (ø)
src/wrappers/tauri-api-stubs/path.ts 100.00% <ø> (ø)
src/wrappers/tauri-wrapper.ts 100.00% <ø> (+19.67%) ⬆️
src/application/listeners/projectEventListeners.ts 37.50% <9.83%> (-9.44%) ⬇️
src/api/api.ts 19.88% <16.21%> (-6.21%) ⬇️
src/atoms/projectState.ts 41.89% <25.00%> (+8.27%) ⬆️
src/api/projectsAPI.ts 32.62% <29.60%> (+0.91%) ⬆️
python/sidecar/http.py 75.64% <31.25%> (-4.36%) ⬇️
src/api/completion.ts 15.38% <33.33%> (+1.74%) ⬆️
src/AppStartup.tsx 90.62% <60.00%> (-1.32%) ⬇️
... and 12 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

- This will check check if the file exists in the project
- Remove dependency on tauri/fs APIs
- Adopt HEAD in project filesystem to check if file exists
- Add (initial) support to the SAMPLE project
@cguedes cguedes requested a review from sehyod August 29, 2023 15:19
sehyod
sehyod previously requested changes Aug 29, 2023
Comment thread src/api/api.ts Outdated
Comment thread src/api/projectsAPI.ts Outdated
Comment thread src/api/projectsAPI.ts Outdated
Comment thread src/api/projectsAPI.ts Outdated
@cguedes cguedes requested a review from sehyod August 30, 2023 12:33
- set project path for the sample project
@cguedes cguedes changed the title 🚧 Universal desktop web codebase Universal desktop web codebase Aug 30, 2023
@cguedes cguedes marked this pull request as ready for review August 30, 2023 13:31
danvk
danvk previously approved these changes Aug 30, 2023
Comment thread src/io/__tests__/filesystem.test.ts
gjreda
gjreda previously approved these changes Aug 30, 2023
@cguedes cguedes dismissed stale reviews from gjreda and danvk via c7d887e August 30, 2023 20:31
@cguedes cguedes dismissed sehyod’s stale review August 30, 2023 20:43

I've made all the changes. You need to review again.

@cguedes cguedes left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Replied to all comments.

@cguedes cguedes requested a review from danvk August 30, 2023 20:44

@danvk danvk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Very excited to get this in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Universal Desktop + Web codebase

4 participants