Commit Graph

277 Commits

Author SHA1 Message Date
Steven 4c1d1c70d1 refactor: rename workspace to instance throughout codebase
Remove work-related terminology by renaming "workspace" to "instance"
across the entire application. This change better reflects that Memos
is a self-hosted tool suitable for personal and non-work use cases.

Breaking Changes:
- API endpoints: /api/v1/workspace/* → /api/v1/instance/*
- gRPC service: WorkspaceService → InstanceService
- Proto types: WorkspaceSetting → InstanceSetting
- Frontend translation keys: workspace-section → instance-section

Backend Changes:
- Renamed proto definitions and regenerated code
- Updated all store layer methods and database drivers
- Renamed service implementations and API handlers
- Updated cache from workspaceSettingCache to instanceSettingCache

Frontend Changes:
- Renamed service client: workspaceServiceClient → instanceServiceClient
- Updated all React components and state management
- Refactored stores: workspace.ts → instance.ts
- Updated all 32 locale translation files

All tests pass and both backend and frontend build successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 23:35:35 +08:00
boojack d98ee36178
chore: standardize and improve API structure (#5224)
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-05 22:36:51 +08:00
Steven bc1550e926 refactor(api): migrate inbox functionality to user notifications
- Remove standalone InboxService and move functionality to UserService
- Rename inbox to user notifications for better API consistency
- Add ListUserNotifications, UpdateUserNotification, DeleteUserNotification methods
- Update frontend components to use new notification endpoints
- Update store layer to support new notification model

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 08:33:09 +08:00
Steven d794c0bf8b feat(web): improve loading performance with skeleton screens and parallel fetches
- Add MemoSkeleton component for smooth initial page load experience
- Integrate skeleton loader into PagedMemoList during initial fetch
- Parallelize user settings and shortcuts API calls (~50% faster session init)
- Batch-fetch memo creators in parallel to eliminate individual loading spinners
- Pass showCreator prop to Explore page for proper skeleton rendering

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 23:53:35 +08:00
Steven 5f7c758f38 fix(web): make layout and direction settings reactive in UI
Fixed issue #5194 where changing the layout (List/Masonry) or sort direction
didn't update the UI until page refresh. The root cause was that ViewState
fields weren't marked as MobX observables, so the UI didn't react to changes
even though values were being persisted to localStorage.

Solution: Added constructor to ViewState that marks orderByTimeAsc and layout
fields as observable, following the same pattern used in other stores like
MemoFilterState.

Fixes #5194

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 07:58:15 +08:00
Claude 739fd2cde6 refactor: update markdown parser
- Removed the `nodes` field from the `Memo` interface in `memo_service.ts`.
- Updated the `createBaseMemo` function and the `Memo` message functions to reflect the removal of `nodes`.
- Cleaned up the serialization and deserialization logic accordingly.

chore: remove code-inspector-plugin from Vite configuration

- Deleted the `codeInspectorPlugin` from the Vite configuration in `vite.config.mts`.
- Simplified the plugins array to include only `react` and `tailwindcss`.
2025-10-26 11:28:40 +08:00
Steven bfad0708e2 fix(web): make memoFilterStore reactive by marking fields as observable
Fixes the root cause of non-reactive filtering. The MemoFilterState class
was not marking its fields as observable in MobX, so changes to the filters
array were not being tracked.

Added makeObservable configuration to mark:
- filters and shortcut as observable
- addFilter, removeFilter, removeFiltersByFactor, clearAllFilters, setShortcut as actions

This ensures that when tags are clicked and filters are added/removed,
MobX observer components will re-render and fetch new data.

Related to #5189

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 07:01:27 +08:00
Claude 686d31b357 feat: enhance attachment store with MobX observables and actions 2025-10-23 19:55:44 +08:00
Steven f5624fa682 refactor: standardize MobX store architecture with base classes and utilities
Refactored all stores to follow consistent patterns and best practices while keeping MobX:

New Infrastructure:
- Created base-store.ts with StandardState base class and factory functions
- Added store-utils.ts with RequestDeduplicator, StoreError, and OptimisticUpdate helpers
- Added config.ts for MobX configuration and strict mode
- Created comprehensive README.md with architecture guide and examples

Server State Stores (API data):
- attachment.ts: Added request deduplication, error handling, computed properties, delete/clear methods
- workspace.ts: Added Theme type validation, computed memoization, improved initialization
- memo.ts: Enhanced with optimistic updates, request deduplication, structured errors
- user.ts: Fixed temporal coupling, added computed memoization, request deduplication

Client State Stores (UI state):
- view.ts: Added helper methods (toggleSortOrder, setLayout, resetToDefaults), input validation
- memoFilter.ts: Added utility methods (hasFilter, clearAllFilters, removeFiltersByFactor)

Improvements:
- Request deduplication prevents duplicate API calls (all server stores)
- Computed property memoization improves performance
- Structured error handling with error codes
- Optimistic updates for better UX (memo updates)
- Comprehensive JSDoc documentation
- Type-safe APIs with proper exports
- Clear separation between server and client state

All stores now follow consistent patterns for better maintainability and easier onboarding.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 19:13:42 +08:00
Steven 9121ddbad9 feat(api): support username lookup in GetUser endpoint
- Update GetUser to accept both numeric IDs and username strings (users/{id} or users/{username})
- Implement CEL filter parsing for username-based lookups
- Update proto documentation to reflect dual lookup capability
- Simplify frontend user store to use GetUser instead of ListUsers filter
- Update ListUsers filter documentation to show current capabilities
2025-10-22 21:48:34 +08:00
Johnny e93f3cbb8b refactor: unify theme and apperance 2025-08-17 11:27:59 +08:00
varsnotwars 9f8921d3b9
fix: preference not being saved (#4980)
Signed-off-by: varsnotwars <varsnotwars@protonmail.com>
Co-authored-by: Johnny <yourselfhosted@gmail.com>
2025-08-08 22:50:46 +08:00
johnnyjoy 506b477d50 fix: get user by username 2025-08-04 19:56:12 +08:00
Colin Holzman 671f4bf88b
fix: shortcuts list (#4936) 2025-07-31 19:52:13 +08:00
Johnny 8f51791da8 chore: update user setting definition 2025-07-29 09:21:51 +08:00
johnnyjoy c5d497a1f0 chore: update user settings 2025-07-27 23:12:42 +08:00
johnnyjoy 3f56ce47d2 chore: update definition of workspace setting 2025-07-27 15:50:09 +08:00
Maximilian Krauß 2c7eb23343
feat(inbox): handles errors while fetching and adds possibility to delete items (#4908) 2025-07-23 14:21:26 +00:00
johnnyjoy ed23cbc011 refactor: memo filter 2025-07-23 22:10:16 +08:00
Steven ac386c218d fix: workspace setting keys 2025-07-22 22:59:54 +08:00
Steven c133f5528a fix: workspace setting keys in frontend 2025-07-22 22:45:47 +08:00
Johnny f907619752 chore: move frontend store 2025-07-07 22:44:08 +08:00
Steven 42d1650c6d chore: tweak auth service 2025-06-24 23:31:37 +08:00
Johnny 741fe35c2a refactor: rename session methods in auth service 2025-06-21 00:00:58 +08:00
Steven 91c2a4cef9 refactor: inbox service 2025-06-18 19:06:09 +08:00
Steven bb5809cae4 refactor: attachment service 2025-06-17 22:15:19 +08:00
Steven 1ea4cc453c refactor: workspace setting service 2025-06-16 22:51:26 +08:00
Steven c9ab03e1a0 refactor: user service 2025-06-16 21:49:38 +08:00
Steven c23aebd648 refactor: memo filter store 2025-05-27 21:14:18 +08:00
Steven 785c250f3c refactor: migrate memo store 2025-05-27 08:26:13 +08:00
Steven dcd68bc5f4 refactor: migrate resource store to v2 2025-05-27 07:55:00 +08:00
Steven 46900f9807 refactor: move store prefixes to common module 2025-05-27 07:49:46 +08:00
Steven 64b27d5a4e refactor: shortcut service 2025-05-26 21:45:14 +08:00
Steven 1a121e350b chore: update gitignore 2025-04-17 23:11:36 +08:00
RichardYe 76ed1b5cc5
feat: set locale based on browser language when user is not logged in (#4635)
* feat: set locale based on browser language when user is not logged in

* docs: comments for locale fallback logic
2025-04-17 20:02:41 +08:00
Amir Ehsandar 32c69bbb52
fix: user stats changes based on selected tab (#4504)
- set partial only the relevant user stats instead of only adding up stats
2025-03-14 13:02:47 +08:00
Johnny fc5962f6a4 feat: show pinned count 2025-03-12 23:33:51 +08:00
Johnny 0dfcb1a7c8 feat: total memo count 2025-03-12 22:15:46 +08:00
Johnny 56ad8ab3bd refactor: view store 2025-03-06 21:38:54 +08:00
Johnny d6be20b917 feat: implement masonry view 2025-03-02 23:27:12 +08:00
Johnny 012405f7fd refactor: user stats state 2025-02-26 22:58:22 +08:00
Johnny bc97b66f36 fix: serial updates 2025-02-20 21:38:36 +08:00
johnnyjoy 7a685d6435 fix: fetch user by username 2025-02-20 20:43:28 +08:00
Johnny 5686fdfb0a chore: handle redirect 2025-02-16 22:17:48 +08:00
Johnny 7a57b5c6e7 refactor: user store 2025-02-11 21:29:16 +08:00
Johnny 11b9c240e9 refactor: workspace setting store 2025-02-11 21:23:46 +08:00
Johnny 9027430646 fix: store reactive 2025-02-10 22:20:07 +08:00
Johnny 983323ceef chore: remove debug code 2025-02-09 11:44:15 +08:00
Johnny 5a2f18da69 refactor(frontend): retire redux 2025-02-09 11:43:55 +08:00
johnnyjoy 2db86f6644 feat: implement shortcut components 2025-02-03 12:26:44 +08:00