[SCRUM-20] Add real-time autosave with debouncing for markdown editor#17
Draft
Copilot wants to merge 3 commits into
Draft
[SCRUM-20] Add real-time autosave with debouncing for markdown editor#17Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: dineshh-m <98159300+dineshh-m@users.noreply.github.com>
Co-authored-by: dineshh-m <98159300+dineshh-m@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add real-time autosave for markdown editor
[SCRUM-20] Add real-time autosave with debouncing for markdown editor
Nov 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements debounced autosave to localStorage with error handling for quota limits and visual feedback for save status.
Changes
New autosave utility (
src/utils/autosave.ts)MarkdownEditor integration (
src/components/MarkdownEditor.tsx)useRefto maintain stable function instanceBug fix (
src/components/Sidebar.tsx)filename: anytofilename: string | nullwith null checkScreenshots
Autosave in action:

Persistence after refresh:

Security
CodeQL: 0 alerts. LocalStorage data is unencrypted client-side storage (see SCRUM-20 STRIDE analysis).
Original prompt
This section details on the original issue you should resolve
<issue_title>[SCRUM-20] Add Real-Time Autosave for Markdown Editor</issue_title>
<issue_description>## 🤖 Instructions for @copilot
Development Branch:
jira/scrum-20IMPORTANT: This issue has full project context available. Please:
jira/scrum-20(see Development section →)docs/directory:docs/architecture/overview.md- System architecture and tech stackdocs/api-standards/- API naming conventions and CRUD specificationsdocs/laravel/- Laravel patterns, database access, error handling, testingdocs/react/- React component structure, state management, API consumption, testingjira/scrum-20when ready📋 Requirements
h2. User Story
As a user who is writing or editing markdown documents,
I want my changes to be autosaved in real-time,
so that I don’t lose my work if I accidentally refresh or close the browser.
h2. Acceptance Criteria
The editor must automatically save the markdown content to local storage every 2 seconds of inactivity.
Autosave must not cause noticeable UI lag.
If the user closes the browser or refreshes the page, the content must still be available.
Autosave must not overwrite content if local storage is full or unavailable; show a warning instead.
Manual Save button should still be available as a fallback.
h2. Non-Functional Requirements
✅ Acceptance Criteria
docs/api-standards/docs/laravel/core-patterns.mddocs/react/component-structure.mddocs/laravel/unit-testing-standards.mdordocs/react/testing-library-patterns.mddocs/laravel/error-handling.mdjira/scrum-20🔗 Jira Reference
Jira Issue: SCRUM-20
Priority: Medium
Type: Story
📚 Project Context
This repository follows strict coding standards. All patterns, conventions, and architectural decisions are documented in the
docs/directory of thejira/scrum-20branch.Before implementing, please read:
🌿 Development
Branch:
jira/scrum-20This issue is linked to the
jira/scrum-20branch. All implementation work should be done on this branch, and a PR should be created from this branch to the main branch when ready.This issue was automatically created from Jira with full project context.
</issue_description>
Comments on the Issue (you are @copilot in this section)
@dineshh-m ## 🤖 @copilot - Implementation InstructionsHi @copilot! This issue is linked to the development branch
jira/scrum-20(see Development section above).Please work on this issue following these steps:
1️⃣ Work on the Linked Branch
The branch
jira/scrum-20has been created and linked to this issue.2️⃣ Read Project Documentation
Before implementing, please review the project standards in the
docs/directory:- Fetch the jira issue description/details for the issue 16 to get more context.
Architecture & Standards:
docs/architecture/overview.md- System architecture, tech stack, patternsdocs/api-standards/naming-conventions.md- Naming conventions for APIs, URLs, fieldsdocs/api-standards/crud-api-spec.md- CRUD API specification with examplesLaravel Backend:
docs/laravel/core-patterns.md- MVC patterns, controllers, modelsdocs/laravel/database-access-layer.md- Eloquent ORM, queries, migrationsdocs/laravel/error-handling.md- Error handling patternsdocs/laravel/unit-testing-standards.md- PHPUnit testing patternsReact Frontend:
docs/react/component-structure.md- Component organization and patternsdocs/react/state-management.md- React Query, Context API, state patterns✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.