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(platform): Saving WIP edited graph in local storage #8844

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

Abhi1992002
Copy link
Contributor

Changes

  • I am using local storage.
  • I am saving the latest data in local storage when:
    • The user goes offline or reload the page.
    • The user changes the tab or window.
    • Force save after 30 seconds.

When the user returns online or refreshes the page, the following steps are taken:

  1. Retrieve data from the backend.
  2. Check if localStorage contains data and perform a deep comparison with the retrieved data.

If there’s a change, a modal is opened, and the user is prompted to recover unsaved changes from the previous session. If the user agrees, the changes are temporarily recovered (not permanently saved to the database; the user needs to explicitly save them).

User must permanently save changes after recovering temporary ones.

Untitled.video.-.Made.with.Clipchamp.3.mp4

@Abhi1992002 Abhi1992002 requested a review from a team as a code owner November 30, 2024 14:49
@Abhi1992002 Abhi1992002 requested review from Torantulino and aarushik93 and removed request for a team November 30, 2024 14:49
@Abhi1992002 Abhi1992002 marked this pull request as draft November 30, 2024 14:49
@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end labels Nov 30, 2024
Copy link

netlify bot commented Nov 30, 2024

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
🔨 Latest commit fcd98b2
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/675b6410d7b0750008bac540

Copy link

netlify bot commented Nov 30, 2024

Deploy Preview for auto-gpt-docs ready!

Name Link
🔨 Latest commit fcd98b2
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/675b6410133bd400082871b3
😎 Deploy Preview https://deploy-preview-8844--auto-gpt-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Abhi1992002 Abhi1992002 changed the title saving graph data in local storage feat(platform) : saving graph data in local storage Dec 1, 2024
Abhi1992002 and others added 4 commits December 1, 2024 11:10
- Added state management for local changes with `localChangesPresent`.
- Updated save logic to prevent unnecessary saves when there are no local changes.
- Adjusted loading behavior to set local changes state and clear store appropriately.
@Abhi1992002 Abhi1992002 marked this pull request as ready for review December 1, 2024 05:49
@Pwuts Pwuts changed the title feat(platform) : saving graph data in local storage feat(platform): Saving WIP edited graph in local storage Dec 2, 2024
@CLAassistant
Copy link

CLAassistant commented Dec 6, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ ntindle
✅ Abhi1992002
❌ Abhi


Abhi seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Dec 6, 2024
Copy link
Contributor

github-actions bot commented Dec 6, 2024

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@github-actions github-actions bot added size/xl and removed size/l labels Dec 6, 2024
@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Dec 6, 2024
Copy link
Contributor

github-actions bot commented Dec 6, 2024

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the size/xl label Dec 6, 2024
@github-actions github-actions bot added the size/l label Dec 6, 2024
Copy link
Contributor

github-actions bot commented Dec 6, 2024

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@github-actions github-actions bot added conflicts Automatically applied to PRs with merge conflicts size/xl and removed size/l labels Dec 6, 2024
@Abhi1992002
Copy link
Contributor Author

Abhi1992002 commented Dec 6, 2024

I have used new package named Dexie-js for handling IndexedDB

@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Dec 6, 2024
Copy link
Contributor

github-actions bot commented Dec 6, 2024

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@github-actions github-actions bot added size/l and removed size/xl labels Dec 6, 2024
@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Dec 9, 2024
Copy link
Contributor

github-actions bot commented Dec 9, 2024

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@aarushik93
Copy link
Contributor

@Abhi1992002 please fix the conflicts 👍🏽

@Bentlybro
Copy link
Member

I been testing this and I really like it, its super useful and it works very well, cant wait to see this be added! once the conflict is resolved and the CLA is signed from the other account this should be good to go 😄

@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Dec 10, 2024
Copy link
Contributor

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@Torantulino
Copy link
Member

This is a great contribution @Abhi1992002!

The CLA bot is broken here as it looks like a GitHub commit was signed Abhi rather than your actual GitHub username.

Once tests are passing we can force this through the CLA bot.

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Dec 13, 2024
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end size/l
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

6 participants