-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add server-side storage support for todo widget #838
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
base: dev
Are you sure you want to change the base?
Conversation
|
amazing work |
# Conflicts: # go.mod # go.sum
|
Response to @tinyoverflow's Review
Thank you again for the valuable feedback! These suggestions helped me build a much cleaner and more extensible architecture. |
tinyoverflow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for all the effort you put into this PR! I really like your ideas!
After reviewing this more carefully, I've found a few more spots about which I'd like to give you my 2 cents and hear your opinion about.
…update todo widget initialization
|
Thank you for the detailed feedback! I've addressed all your concerns: ✅ Fixed Promise Return Issues ✅ Added Error Handling ✅ Enhanced Error Messages ✅ Fixed Widget ID Issue ✅ Updated Documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you so much!
@svilenmarkov what do you think about this one?
Overview
This PR enhances the todo widget functionality by adding support for server-side storage, allowing todo tasks to be persisted and synced across different devices and browsers.
Changes
Core Functionality
storage-typeconfiguration option for todo widget with two modes:browser(default): Tasks stored in browser's localStorageserver: Tasks stored on server in JSON filesaferofilesystem abstractionGET /api/widgets/todo/{id}- Retrieve todo dataPUT /api/widgets/todo/{id}- Save todo dataConfiguration
data-pathserver configuration option (default:./data)todosdata directory on startupCode Quality
Todo()function to async for better data loadingloadFromStorage()andsaveToStorage()helper functionsDocumentation
docs/configuration.mdwith:data-pathproperty in Server sectionstorage-typeproperty in Todo widget sectionFiles Changed
.gitignore- Added data directorygo.mod&go.sum- Added afero dependencyinternal/glance/config.go- Added DataPath fieldinternal/glance/glance.go- Implemented data path initialization and API routesinternal/glance/static/js/todo.js- Refactored with storage abstractioninternal/glance/templates/todo.html- Added storage-type data attributeinternal/glance/widget-todo.go- Implemented server-side storage logicdocs/configuration.md- Updated documentationTesting
Breaking Changes
None. This is a backward-compatible enhancement. Existing todo widgets will continue to use browser storage by default.
Example Configuration