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: add auto-save and restoration features to the editor #10

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

jboix
Copy link
Contributor

@jboix jboix commented Apr 16, 2024

Description

Resolves #5 by implementing real-time auto-save functionality and session restoration from local storage in the theme editor.

Changes to SCSS files are now saved in real-time to the browser’s local storage. Upon returning to the theme editor, the system automatically restores the integrator's last session from local storage.

Changes Made

  • Adds a global css rule to ensure that all custom elements not yet defined are hidden from view. This prevents unstyled or incomplete components from being visible during page load.

  • Introduced a WorkspaceProvider that manages the persistence and retrieval of the workspace state from local storage.

  • Added a ConfirmationDialog component that prompts users to confirm before resetting the editor settings. This ensures that changes are not lost accidentally.

    image

Checklist

  • I have followed the project's style and contribution guidelines.
  • I have performed a self-review of my own changes.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.

Adds a global css rule to ensure that all custom elements not yet defined are hidden
from view. This prevents unstyled or incomplete components from being visible during
page load.
@jboix jboix requested a review from amtins April 16, 2024 14:18
@jboix jboix self-assigned this Apr 16, 2024
Copy link

github-actions bot commented Apr 16, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-04-18 12:15 UTC

@jboix jboix force-pushed the feat/preserve-progress branch from 9e61ace to ad6bf5b Compare April 16, 2024 14:20
Copy link

github-actions bot commented Apr 16, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 89.78% 976 / 1087
🔵 Statements 89.78% 976 / 1087
🔵 Functions 92.3% 60 / 65
🔵 Branches 89.1% 90 / 101
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/index.js 0% 0% 0% 0% 1-66
src/components/confirmation-dialog.js 100% 92.85% 100% 100%
src/workspace/workspace-provider.js 100% 100% 100% 100%
src/workspace/workspace.js 0% 0% 0% 0% 1-23
Generated in workflow #27

@jboix jboix force-pushed the feat/preserve-progress branch from ad6bf5b to dcaf926 Compare April 17, 2024 15:11
Resolves #5 by implementing real-time auto-save functionality and session restoration from local
storage in the theme editor.

Changes to SCSS files are now saved in real-time to the browser’s local storage. Upon returning to
the theme editor, the system automatically restores the integrator's last session from local
storage.

This commit introduces the following changes:

- Added a `ConfirmationDialog` component that prompts users to confirm before resetting the editor
  settings. This ensures that changes are not lost accidentally.
- Introduced a `WorkspaceProvider` that manages the persistence and retrieval of the workspace state
  from local storage.
@jboix jboix force-pushed the feat/preserve-progress branch from dcaf926 to 099d052 Compare April 18, 2024 07:48
@jboix jboix requested a review from amtins April 18, 2024 08:03
Copy link
Member

@amtins amtins left a comment

Choose a reason for hiding this comment

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

LGTM!

@jboix jboix added this pull request to the merge queue Apr 18, 2024
Merged via the queue into main with commit 2a23c87 Apr 18, 2024
4 checks passed
@jboix jboix deleted the feat/preserve-progress branch April 18, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Preserve progress
2 participants