1. 11 Dec, 2025 4 commits
    • Steven's avatar
      fix(backend): implement protocol-agnostic header setting for dual gRPC/Connect-RPC support · 3d893a73
      Steven authored
      Problem:
      The codebase supports both native gRPC and Connect-RPC protocols, but auth
      service was using grpc.SetHeader() which only works for native gRPC. This
      caused "failed to set grpc header" errors when using Connect-RPC clients
      (browsers using nice-grpc-web).
      
      Solution:
      - Created HeaderCarrier pattern for protocol-agnostic header setting
      - HeaderCarrier stores headers in context for Connect-RPC requests
      - Falls back to grpc.SetHeader for native gRPC requests
      - Updated auth service to use SetResponseHeader() instead of grpc.SetHeader()
      - Refactored Connect wrappers to use withHeaderCarrier() helper to eliminate
        code duplication
      
      Additional fixes:
      - Allow public methods when gRPC metadata is missing in ACL interceptor
      - Properly handle ParseSessionCookieValue errors instead of ignoring them
      - Fix buildSessionCookie to gracefully handle missing metadata
      
      Files changed:
      - server/router/api/v1/header_carrier.go: New protocol-agnostic header carrier
      - server/router/api/v1/auth_service.go: Use SetResponseHeader, handle missing metadata
      - server/router/api/v1/connect_services.go: Use withHeaderCarrier helper
      - server/router/api/v1/acl.go: Allow public methods without metadata
      - server/router/api/v1/connect_interceptors.go: Handle ParseSessionCookieValue errors
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude Sonnet 4.5 <noreply@anthropic.com>
      3d893a73
    • Steven's avatar
      fix(web): convert enum values to string names in API resource paths · 8a7e0088
      Steven authored
      Frontend was incorrectly using numeric enum values (e.g., 1, 2, 3) instead
      of string names (e.g., "GENERAL", "STORAGE") when constructing API resource
      paths. This caused the backend to fail with "unsupported instance setting
      key: INSTANCE_SETTING_KEY_UNSPECIFIED" errors during initialization.
      
      Changes:
      - Add helper functions in store/common.ts to convert enum values to names
        - getInstanceSettingKeyName() and buildInstanceSettingName()
        - getUserSettingKeyName() and buildUserSettingName()
      - Update instance store to use string enum names in API calls
      - Update user store to use string enum names in API calls
      - Update all components to use new helper functions for setting names
      
      Fixes enum string conversion for:
      - InstanceSetting_Key (6 locations)
      - UserSetting_Key (2 locations)
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude Sonnet 4.5 <noreply@anthropic.com>
      8a7e0088
    • Johnny's avatar
      refactor: migrate to connect-rpc (#5338) · edd3ced9
      Johnny authored
      edd3ced9
    • Steven's avatar
      fix(web): use AST parsing for task detection to handle code blocks correctly · 8af8b9d2
      Steven authored
      Fixes #5319. Checkboxes inside code blocks were incorrectly counted when
      toggling tasks, causing the wrong checkbox to be checked. Replaced regex-based
      task detection with mdast AST parsing which properly ignores code block content.
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
      8af8b9d2
  2. 10 Dec, 2025 5 commits
  3. 09 Dec, 2025 3 commits
    • Steven's avatar
      fix(web): disable setext header syntax (#5314) · 48ce4ccc
      Steven authored
      Add custom remark plugin to prevent setext headers (headers using === or --- underlines) from being recognized by the markdown parser. The plugin disables the setextUnderline construct at the micromark parser level.
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude Sonnet 4.5 <noreply@anthropic.com>
      48ce4ccc
    • Steven's avatar
      refactor: migrate binary file serving from gRPC to dedicated HTTP fileserver · 1cf04770
      Steven authored
      Migrates attachment and avatar binary serving from gRPC endpoints to a new dedicated HTTP fileserver package, fixing Safari video playback issues and improving architectural separation.
      
      Key changes:
      - Created server/router/fileserver package for all binary file serving
      - Removed GetAttachmentBinary and GetUserAvatar gRPC endpoints from proto
      - Implemented native HTTP handlers with full range request support
      - Added authentication support (session cookies + JWT) to fileserver
      - New avatar endpoint supports lookup by user ID or username
      - Eliminated duplicate auth constants (imports from api/v1)
      
      HTTP endpoints:
      - Attachments: /file/attachments/:uid/:filename (unchanged URL)
      - Avatars: /file/users/:identifier/avatar (new URL format)
      
      This fixes Safari video/audio playback by using http.ServeContent() which properly handles HTTP 206 Partial Content responses and range request headers.
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude Sonnet 4.5 <noreply@anthropic.com>
      1cf04770
    • spaghetti-coder's avatar
      9ea27ee6
  4. 08 Dec, 2025 2 commits
  5. 02 Dec, 2025 5 commits
    • Steven's avatar
      refactor(web): improve MemoContent security and maintainability · 4668c471
      Steven authored
      Security improvements:
      - Add rehype-sanitize for XSS protection in markdown content
      - Remove DOMPurify and deprecated __html code block feature
      - Extract sanitize schema to constants with comprehensive documentation
      
      Maintainability improvements:
      - Extract SANITIZE_SCHEMA to constants.ts for better organization
      - Create utils.ts with shared code extraction utilities
      - Refactor CodeBlock and MermaidBlock to use shared utilities
      - Rename PreProps to CodeBlockProps for clarity
      - Reduce code duplication across components
      
      Dependency cleanup:
      - Remove explicit katex dependency (now transitive via rehype-katex)
      - Remove @matejmazur/react-katex (unused)
      - Remove dompurify (replaced by rehype-sanitize)
      - Update vite config to remove katex-vendor chunk
      
      Changes: 7 files changed, 84 insertions(+), 100 deletions(-)
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      4668c471
    • Steven's avatar
      feat(web): add LaTeX math rendering support to MemoContent · d9f8bc80
      Steven authored
      Integrates remark-math and rehype-katex plugins to enable LaTeX mathematical expressions in memos. Users can now write inline math ($...$) and display math ($$...$$) using standard LaTeX syntax.
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      d9f8bc80
    • Steven's avatar
      refactor: simplify theme/locale to user preferences and improve initialization · 81da20c9
      Steven authored
      Remove theme and locale from instance settings to eliminate duplication and
      simplify the codebase. These are user-specific preferences and should only
      exist in user settings, not instance-wide settings.
      
      Backend changes:
      - Remove theme from InstanceGeneralSetting proto
      - Remove locale from InstanceCustomProfile proto
      - Update instance service converters to remove theme/locale handling
      - Simplify RSS feed to use static locale
      
      Frontend changes:
      - Remove theme/locale from instanceStore state
      - Create unified initialization flow with clear fallback priority:
        * Theme: user setting → localStorage → system preference
        * Locale: user setting → browser language
      - Add applyUserPreferences() to centralize theme/locale application
      - Simplify App.tsx by removing redundant state synchronization
      - Update all components to use new helper functions:
        * getThemeWithFallback() for theme resolution
        * getLocaleWithFallback() for locale resolution
      - Remove theme/locale selectors from instance profile dialog
      
      Theme utilities refactor:
      - Organize code into clear sections with JSDoc comments
      - Extract localStorage operations into getStoredTheme/setStoredTheme helpers
      - Split DOM manipulation into focused functions
      - Improve type safety with Theme and ResolvedTheme types
      - Reduce code duplication and improve maintainability
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      81da20c9
    • Steven's avatar
      fix(web): allow only one active tag filter at a time · 8154a411
      Steven authored
      Previously, clicking multiple tags would add them all as active filters. Now clicking a new tag automatically clears any existing tag filters before applying the new one, ensuring only one tag can be filtered at a time. Clicking an already-active tag still deselects it.
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      8154a411
    • Johnny's avatar
      a8631542
  6. 01 Dec, 2025 4 commits
    • Steven's avatar
      refactor(store): remove deprecated migration_history table and backward compatibility code · 06102575
      Steven authored
      Complete removal of migration_history system in favor of instance_setting based schema versioning.
      
      Changes:
      - Remove migration_history table creation from all LATEST.sql files
      - Delete all migration_history model and implementation files (~300 lines)
      - Remove FindMigrationHistoryList and UpsertMigrationHistory from Driver interface
      - Replace complex backward compatibility functions with simple version check
      - Update health check to use instance_setting instead of migration_history
      - Simplify checkMinimumUpgradeVersion to detect pre-v0.22 installations
      
      Breaking change:
      Users on versions < v0.22.0 (May 2024) must upgrade to v0.25.x first before upgrading to this version.
      Clear error message with upgrade instructions will be shown for old installations.
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      06102575
    • Steven's avatar
      fix(web): fix infinite loop in MemoEditor and improve React/MobX integration · fae5eac3
      Steven authored
      - Wrap all setter functions in useMemoEditorState with useCallback to ensure stable references
        This prevents infinite loops when setters are used in useEffect dependencies (fixes "Maximum update depth exceeded" error)
      - Extract MobX observable values in useMemoFilters and useMemoSorting before using them in useMemo dependencies
        This prevents React from tracking MobX observables directly, improving reliability
      - Add comprehensive documentation explaining the design decisions for future maintainability
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      fae5eac3
    • Steven's avatar
      fix(store): filter inbox notifications by message type at database level · d1492007
      Steven authored
      Add MessageType filter to FindInbox to exclude legacy VERSION_UPDATE
      notifications from inbox queries. This resolves the issue where users
      saw notification counts but no items displayed, as VERSION_UPDATE
      entries cannot be rendered in the new UserNotification API.
      
      Changes:
      - Add MessageType field to FindInbox struct for database-level filtering
      - Implement JSON extraction filters in SQLite, MySQL, and PostgreSQL drivers
      - Update ListUserNotifications to filter MEMO_COMMENT type at store level
      
      This approach improves performance by filtering at the database rather
      than in application code, reducing unnecessary data transfer for users
      with many legacy inbox entries.
      
      Fixes #5278
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      d1492007
    • Steven's avatar
      chore: fix linter · 17e116b9
      Steven authored
      17e116b9
  7. 30 Nov, 2025 12 commits
    • Johnny's avatar
      refactor(rss): comprehensive RSS service improvements · 545323d1
      Johnny authored
      Major performance and standards compliance improvements to RSS feed generation:
      
      Performance optimizations:
      - Fix N+1 query problem by batch loading attachments (101 queries → 2-3)
      - Add in-memory caching with 1-hour TTL and LRU eviction
      - Implement ETag-based conditional requests (304 Not Modified)
      - Add database-level pagination with LIMIT clause
      - Clean up expired cache entries to prevent memory leaks
      
      RSS 2.0 compliance:
      - Add item titles extracted from memo content
      - Include both description and content:encoded fields
      - Add author information (name and email)
      - Set proper Last-Modified headers
      - Use specific application/rss+xml content type
      
      Code quality:
      - Fix potential index out of bounds panic in title generation
      - Improve markdown heading stripping with regex (handles # to ######)
      - Add proper HTTP caching headers (Cache-Control, ETag, Last-Modified)
      - Thread-safe cache implementation with RWMutex
      - Better error handling and edge case coverage
      
      The RSS backend now follows industry best practices with optimal
      performance, full standards compliance, and production-ready reliability.
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      545323d1
    • Johnny's avatar
      feat(auth): add PKCE support and enhance OAuth security · 1a9bd32c
      Johnny authored
      Implements critical OAuth 2.0 security improvements to protect against authorization code interception attacks and improve provider compatibility:
      
      - Add PKCE (RFC 7636) support with SHA-256 code challenge/verifier
      - Fix access token extraction to use standard field instead of Extra()
      - Add OAuth error parameter handling (access_denied, invalid_scope, etc.)
      - Maintain backward compatibility for non-PKCE flows
      
      This brings the OAuth implementation up to modern security standards as recommended by Auth0, Okta, and the OAuth 2.0 Security Best Current Practice (RFC 8252).
      
      Backend changes:
      - Add code_verifier parameter to ExchangeToken with PKCE support
      - Use token.AccessToken for better provider compatibility
      - Update proto definition with optional code_verifier field
      
      Frontend changes:
      - Generate cryptographically secure PKCE parameters
      - Include code_challenge in authorization requests
      - Handle and display OAuth provider errors gracefully
      - Pass code_verifier during token exchange
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      1a9bd32c
    • Johnny's avatar
      chore: tweak comments · a6a8997f
      Johnny authored
      a6a8997f
    • Johnny's avatar
      chore: reorganize reaction components · 07072b75
      Johnny authored
      07072b75
    • Johnny's avatar
      chore: enhance MemoView component structure · 6dcf7cc7
      Johnny authored
      6dcf7cc7
    • Johnny's avatar
      7aa8262e
    • Huang Youchuan's avatar
    • Johnny's avatar
      chore: remove goreleaser · ee9d9603
      Johnny authored
      ee9d9603
    • Johnny's avatar
      refactor: clean up MemoView and MemoEditor component architecture · 2516cdf2
      Johnny authored
      This commit refactors MemoView and MemoEditor components for better
      maintainability, introducing React Context, custom hooks, and improved
      folder structure.
      
      MemoView improvements:
      - Introduce MemoViewContext to eliminate prop drilling
      - Reduce MemoHeader props from 18 to 8
      - Reduce MemoBody props from 9 to 4
      - Extract custom hooks: useMemoViewDerivedState, useMemoEditor,
        useMemoHandlers for better separation of concerns
      - Fix React hooks ordering bug in edit mode
      
      MemoEditor improvements:
      - Extract state management into useMemoEditorState hook
      - Extract keyboard handling into useMemoEditorKeyboard hook
      - Extract event handlers into useMemoEditorHandlers hook
      - Extract initialization logic into useMemoEditorInit hook
      - Reduce main component from 461 to 317 lines (31% reduction)
      
      Folder structure cleanup:
      - Move SortableItem to memo-metadata (correct location)
      - Move ErrorBoundary to components folder
      - Flatten Toolbar/InsertMenu structure (remove unnecessary nesting)
      - Consolidate hooks in main hooks folder
      - Consolidate types in main types folder
      
      Benefits:
      - Better separation of concerns
      - Improved testability
      - Easier maintenance
      - Cleaner code organization
      - No functionality changes
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      2516cdf2
    • Johnny's avatar
      refactor: remove enable link preview setting · bb7e0cdb
      Johnny authored
      - Remove enable_link_preview field from proto definitions
      - Remove setting UI from MemoRelatedSettings component
      - Remove translations from all 33 locale files
      - Regenerate proto files
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      bb7e0cdb
    • Johnny's avatar
      refactor: remove legacy disable markdown shortcuts setting · 5fb6f8ec
      Johnny authored
      - Remove disable_markdown_shortcuts field from proto definitions
      - Remove setting UI from MemoRelatedSettings component
      - Enable markdown shortcuts permanently in MemoEditor
      - Remove translations from all 32 locale files
      - Fix TypeScript error in useMemoSave hook by using typed translation function
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
      5fb6f8ec
    • Johnny's avatar
      chore: fix linter · 2b7b70eb
      Johnny authored
      2b7b70eb
  8. 29 Nov, 2025 1 commit
    • Johnny's avatar
      refactor: implement MemoView component with subcomponents and hooks · 1ef11f74
      Johnny authored
      - Added MemoView component to display a single memo card with full functionality including creator info, memo content, attachments, reactions, and comments.
      - Created MemoBody and MemoHeader subcomponents to separate concerns and improve maintainability.
      - Introduced custom hooks for managing memo actions, keyboard shortcuts, NSFW content visibility, and image preview.
      - Implemented reaction handling with new ReactionSelector and ReactionView components.
      - Added TypeScript types for better type safety and clarity.
      - Established constants for memo card styling and keyboard shortcuts.
      - Removed legacy ReactionSelector and ReactionView components from the previous structure.
      1ef11f74
  9. 28 Nov, 2025 1 commit
    • Johnny's avatar
      feat: add LocationDialog and related hooks for location management in MemoEditor · 50199fe9
      Johnny authored
      - Implemented LocationDialog component for selecting and entering location coordinates.
      - Created useLocation hook to manage location state and updates.
      - Added LocationState type for managing location data.
      - Introduced useLinkMemo hook for linking memos with search functionality.
      - Added VisibilitySelector component for selecting memo visibility.
      - Refactored MemoEditor to integrate new hooks and components for improved functionality.
      - Removed obsolete handlers and streamlined memo save logic with useMemoSave hook.
      - Enhanced focus mode functionality with dedicated components for overlay and exit button.
      50199fe9
  10. 27 Nov, 2025 1 commit
  11. 26 Nov, 2025 2 commits