Commit graph

154 commits

Author SHA1 Message Date
Johnny
c8162ff3cc feat(web): add Focus Mode for distraction-free writing
Add keyboard-activated Focus Mode to provide an immersive writing experience:

Features:
- Toggle with Cmd/Ctrl+Shift+F (matches GitHub, Google Docs)
- Exit with Escape, toggle shortcut, button click, or backdrop click
- Expands editor to ~80-90% of viewport with centered layout
- Semi-transparent backdrop with blur effect
- Maintains all editor functionality (attachments, shortcuts, etc.)
- Smooth 300ms transitions

Responsive Design:
- Mobile (< 640px): 8px margins, 50vh min-height
- Tablet (640-768px): 16px margins
- Desktop (> 768px): 32px margins, 60vh min-height, 1024px max-width

Implementation:
- Centralized constants for easy maintenance (FOCUS_MODE_STYLES)
- Extracted keyboard shortcuts and heights to named constants
- JSDoc documentation for all new functions and interfaces
- TypeScript type safety with 'as const'
- Explicit positioning (top/left/right/bottom) to avoid width overflow

Files Modified:
- web/src/components/MemoEditor/index.tsx - Main Focus Mode logic
- web/src/components/MemoEditor/Editor/index.tsx - Height adjustments
- web/src/locales/en.json - Translation keys

Design follows industry standards (GitHub Focus Mode, Notion, Obsidian)
and maintains code quality with single source of truth pattern.
2025-11-16 23:15:36 +08:00
Steven
156908c77f chore(web): migrate from ESLint+Prettier to Biome
- Install @biomejs/biome@2.3.5 as unified linter and formatter
- Remove ESLint, Prettier and all related plugins (221 packages removed)
- Migrate linting rules from ESLint to Biome configuration
- Migrate formatting rules from Prettier to Biome configuration
- Exclude auto-generated proto files from linting (src/types/proto/**)
- Exclude CSS files from Biome (Tailwind syntax not yet supported)
- Update package.json scripts:
  - lint: tsc + biome check
  - lint:fix: biome check --write
  - format: biome format --write
- Auto-fix import organization across 60+ files
- Fix duplicate key in Russian locale (ru.json)
- Update CLAUDE.md documentation to reflect Biome usage

Benefits:
- 10-100x faster linting performance
- Simplified toolchain with single configuration file
- 221 fewer npm dependencies
- Unified linting, formatting, and import organization
2025-11-14 23:58:07 +08:00
Johnny
fc43f86571
chore(web): unify Location/Attachments/Relations components (#5241)
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-09 07:23:31 +08:00
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
Steven
1d7efb1580 refactor(web): unify memo stats/filters with context-aware MainLayout
Create unified architecture for memo statistics, filters, and sorting
across all pages (Home, Explore, Archived, Profile) with proper
visibility filtering and consistent data flow.

Key changes:
- Rename HomeLayout → MainLayout to reflect broader usage
- Create useFilteredMemoStats hook for unified stats computation
- Create useMemoFilters/useMemoSorting hooks to eliminate duplication
- Refactor all pages to use unified hooks (~147 lines removed)
- Move Explore route under MainLayout (was sibling before)
- Fix masonry column calculation threshold (1024px → 688px+)

Architecture improvements:
- MainLayout computes filter/stats per route context
- Stats/tags based on same filter as memo list (consistency)
- Proper visibility filtering (PUBLIC/PROTECTED) on Explore
- MemoExplorer/StatisticsView accept stats as required props
- Eliminated optional fallbacks and redundant data fetching

Benefits:
- Single source of truth for stats computation
- Stats remain static (don't change with user filters)
- Reduced code duplication across 4 pages
- Better maintainability and type safety
- Proper security (no private memo leakage on Explore)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 08:46:52 +08:00
Steven
93964827ad refactor: redesign memo editor action bar UI
- Replace multiple action buttons with unified InsertMenu dropdown
- Consolidate upload, link memo, and location into single + button
- Redesign VisibilitySelector with text-based dropdown UI
- Unify badge styling for location, attachments, and links
  - Consistent height (h-7), padding, gaps, and border styles
  - Secondary foreground text color with hover states
  - Max width with truncation for long content
- Add image thumbnails in attachment badges
- Simplify button hierarchy with ghost variant for save/cancel
- Remove obsolete components (TagSelector, MarkdownMenu, etc.)
- Extract LocationView to separate component for better organization

Fixes #5196
2025-10-31 21:29:58 +08:00
Steven
f65633e8a9 chore: fix linter issues in backend and frontend
- Remove extra blank line in memo_service.go (goimports)
- Remove invalid fields from CreateMemoRequest call (validateOnly, requestId)
- Clean up unnecessary comments

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 23:41:20 +08:00
Steven
4d4325eba5 chore: update component styles for consistency 2025-10-22 20:21:58 +08:00
boojack
13957472eb
chore: merge visibility selector into save button
Signed-off-by: boojack <stevenlgtm@gmail.com>
2025-08-06 00:03:59 +08:00
johnnyjoy
c5d497a1f0 chore: update user settings 2025-07-27 23:12:42 +08:00
Steven
c5d2d15278 chore: fix eslint 2025-07-23 23:41:59 +08:00
Steven
c1708df7a2 chore: use select/dropdown instead of popover 2025-07-08 20:25:56 +08:00
Johnny
f907619752 chore: move frontend store 2025-07-07 22:44:08 +08:00
Johnny
db4b1f5fde chore: tweak styles 2025-07-05 11:26:59 +08:00
Johnny
91be2f68d1
feat: variant colors (#4816) 2025-07-04 23:03:13 +08:00
Johnny
493832aeb4 refactor: unify components 2025-07-01 19:29:48 +08:00
Steven
9972a77d9e refactor: memo service 2025-06-18 19:58:38 +08:00
Steven
a4920d464b refactor: attachment service part2 2025-06-18 00:09:19 +08:00
Steven
bb5809cae4 refactor: attachment service 2025-06-17 22:15:19 +08:00
Steven
330282d8b2 chore: tweak styles 2025-06-16 20:48:08 +08:00
XIN_____
d386b83b7b
chore: update i18n text for zh (#4771)
* feat: add i18n text

* feat: add i18n text for zh
2025-06-12 23:09:04 +08:00
johnnyjoy
94d1e20570 chore: update date time format 2025-06-03 21:22:14 +08:00
Johnny
3343dc73f7 chore: update navigator 2025-06-02 09:39:50 +08:00
Johnny
fd99e10962 chore: tweak sidebar 2025-06-01 09:13:44 +08:00
Johnny
2595e32f83 chore: simplify date editor 2025-05-31 11:14:47 +08:00
Johnny
376b25a69c
chore: fix visibility selector style (#4733) 2025-05-31 09:15:28 +08:00
Johnny
ea4e7a1606
refactor: memo editor (#4730) 2025-05-29 07:46:40 +08:00
Maximilian Krauß
77d3853f73
fix: inherits memo visibility for default comment visibility (#4728) 2025-05-28 22:18:41 +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
72babbb393 fix: dark mode of highlight.js 2025-05-20 23:58:22 +08:00
johnnyjoy
ee99afd7a4 chore: enable location by default 2025-05-19 21:25:51 +08:00
Steven
606924b4c9 chore: unify form styles 2025-05-15 22:15:01 +08:00
Simon
bb892be5b3
feat: improve visual feedback in MemoEditor for drag/drop file uploads (#4634)
* improve drag/drop file upload UI

* fix eslint errors

* use tailwind for cursor styles

* fix eslint issues
2025-04-18 23:49:59 +08:00
Johnny
3401def442 chore: simplify memo filters 2025-03-06 23:10:20 +08:00
Johnny
8acded1f23 chore: fix linter 2025-03-02 15:40:16 +08:00
Johnny
47b41bce85 refactor: move memo relation definition 2025-02-27 15:28:36 +08:00
Johnny
5686fdfb0a chore: handle redirect 2025-02-16 22:17:48 +08:00
Johnny
11b9c240e9 refactor: workspace setting store 2025-02-11 21:23:46 +08:00
Johnny
5a2f18da69 refactor(frontend): retire redux 2025-02-09 11:43:55 +08:00
johnnyjoy
97d12db3d5 refactor: renovate create memo 2025-02-01 11:48:22 +08:00
RoccoSmit
2f4c5d7bc2
fix: cancel out of no changes save (#4335)
Cancel out of trying to save
2025-02-01 08:30:04 +08:00
Steven
147458347b chore: tweak user stats in frontend 2025-01-16 09:12:47 +08:00
RoccoSmit
3081015692
feat: date picker navigation (#4286)
Added month and year dropdowns
2025-01-10 22:46:08 +08:00
johnnyjoy
1caaef1c5b chore: fix memo compact mode 2025-01-10 21:47:00 +08:00
Steven
4b28dfddb6 fix: visibility selector overflow 2024-11-02 13:39:08 +08:00
Steven
f373d8e88c chore: update checkbox source 2024-10-27 10:19:06 +08:00
Steven
963706aebd refactor: update button source 2024-10-26 21:36:05 +08:00
Steven
f9fec56560 chore: fix date picker position 2024-10-20 17:08:01 +08:00
johnnyjoy
cf1be81de2 feat: use date-picker instead of raw datetime input 2024-10-19 21:30:02 +08:00