Pulling feat/editor-safety into develop#1032
Conversation
…navigation This adds a new hook that prevents the user from accidentally navigating away from the page. This can be useful for preventing data loss or other unexpected behavior.
…te content page This change adds a confirmation dialog when a user tries to navigate away from the create content page. This prevents accidental loss of unsaved changes. The `useConfirmNavigation` hook is used to achieve this functionality. The `useEffect` hook in `CreateContentForm` was removed and replaced with `useConfirmNavigation` hook in `CreateContentView` to handle the confirmation dialog.
…ation This change implements the `useConfirmNavigation` hook in both the `EditView.tsx` component of the `dicty-frontpage` app and the `EditView.tsx` component of the `stock-center` app. This hook prevents accidental navigation away from the edit view by displaying a confirmation dialog when the user attempts to leave the page with unsaved changes. This improves the user experience by preventing data loss.
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Adds documentation to the `useConfirmNavigation` hook to explain its purpose and functionality.
Codecov Report✅ All modified and coverable lines are covered by tests. Please upload reports for the commit 34ff1c3 to get more accurate results. Additional details and impacted files@@ Coverage Diff @@
## develop #1032 +/- ##
========================================
Coverage 90.92% 90.92%
========================================
Files 373 373
Lines 21195 21195
Branches 985 980 -5
========================================
Hits 19271 19271
+ Misses 1923 1921 -2
- Partials 1 3 +2 🚀 New features to boost your workflow:
|
This commit introduces a new package, `@dictybase/draft-plugin`. This plugin provides functionality for automatically persisting drafts in the browser's local storage using the Lexical editor. It includes components for saving and retrieving drafts, utilizing `localforage` for storage management. The package also includes testing setup with `vitest` and necessary dependencies.
No description provided.