Commit Graph

23 Commits

Author SHA1 Message Date
YuTengjing
306c50704e 🐛 fix: improve crawler error handling and timeout cancellation (#12487) 2026-02-26 22:59:10 +08:00
Innei
346fc4617e ♻️ refactor: migrate AI Rules to Claude Code Skills (#11737)
♻️ refactor: migrate AI Rules to Claude Code Skills system

Migrate all AI Rules from .cursor/rules/ to .agents/skills/ directory:
- Move 23 skills to .agents/skills/ (main directory)
- Update symlinks: .claude/skills, .cursor/skills, .codex/skills
- Create project-overview skill from project documentation
- Add references/ subdirectories for complex skills
- Remove LobeChat references from skill descriptions
- Delete obsolete .cursor/rules/ and .claude/commands/prompts/ directories

Skills structure enables better portability and maintainability across AI tools.
2026-01-23 22:30:18 +08:00
Innei
ad34072d9c 🐛 fix(pdf): ensure worker config before Document render (#11746)
* 🐛 fix(pdf): ensure worker config before Document render

Fixes "No GlobalWorkerOptions.workerSrc specified" error in TurboPack by:
- Creating unified pdfjs module that ensures worker config at render time
- Wrapping Document component to call ensureWorker() before render
- Removing side-effect imports that may be optimized away by bundler

Closes LOBE-4108

* 📝 docs: clarify Linear issue management trigger conditions
2026-01-23 22:19:03 +08:00
Innei
2b620dfc99 🐛 fix(pdf): upgrade pdfjs-dist and react-pdf to v5.x (#11686)
* 🐛 fix(pdf): upgrade pdfjs-dist and react-pdf to v5.x

Resolves: LOBE-2658

- Upgrade pdfjs-dist from 4.x to 5.4.530
- Upgrade react-pdf from 9.x to 10.3.0
- Fix PDF worker loading using import.meta.url pattern
- Add @napi-rs/canvas dependency for react-pdf renderer
- Fix typo: ResouceManagerMode → ResourceManagerMode
- Clean up meaningless comments in ListItem component
- Simplify next config by removing unused isDesktop logic

* chore: update claude

Signed-off-by: Innei <tukon479@gmail.com>

* 🐛 fix(pdf): update PDF version in snapshots to 5.4.530

- Updated pdfVersion in PDF loader snapshots to reflect the new version 5.4.530.

Signed-off-by: Innei <tukon479@gmail.com>

*  feat(file-loaders): implement lazy loading for file loaders

- Refactored file loader imports to use dynamic loading, improving performance by preventing heavy dependencies from being loaded until needed.
- Introduced `getFileLoader` function to manage loader retrieval based on file type.
- Updated logging and fallback mechanisms for unsupported file types.

This change enhances the efficiency of file loading operations.

Signed-off-by: Innei <tukon479@gmail.com>

*  feat(config): enhance next configuration for improved package handling

- Updated `nextConfig` to include `@napi-rs/canvas` and `pdfjs-dist` in `serverExternalPackages` to address bundling issues with Turbopack.
- Removed unused `isDesktop` logic and simplified the configuration structure.
- Adjusted `transpilePackages` to exclude `pdfjs-dist`, reflecting recent upgrades.

This change optimizes the configuration for better compatibility and performance.

Signed-off-by: Innei <tukon479@gmail.com>

* 🐛 fix: use CDN pdfjs worker

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-23 15:20:34 +08:00
Innei
c9d9dff635 ♻️ refactor(ModelSwitchPanel): migrate from Popover to DropdownMenu with virtual scrolling (#11663)
* ♻️ refactor(ModelSwitchPanel): migrate from Popover to DropdownMenu with virtual scrolling

- Replace Popover with DropdownMenu atom components from @lobehub/ui
- Add react-virtuoso for proper virtual scrolling implementation
- Auto-close submenu when scrolling to prevent position offset issues
- Rename misleading "Virtual*" naming to "List*" for clarity

LOBE-3844

* 🔨 chore: clean up unnecessary comments in ModelSwitchPanel

* 🔨 chore(router): remove unused loader property from route configuration

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-20 23:07:56 +08:00
YuTengjing
d44616354e ♻️ refactor: use fallbackData to prevent useActionSWR auto-fetch (#11514) 2026-01-15 17:34:49 +08:00
YuTengjing
ddca1652bb feat(share): add topic sharing functionality (#11448) 2026-01-13 22:10:48 +08:00
Innei
8be32c2f32 feat: Add browser compatibility detection and fallback page (#11309)
*  feat: Add browser compatibility detection and fallback page

- Add automatic browser compatibility check in app layout
- Create standalone not-compatible.html fallback page with modern responsive design
- Support dark mode via prefers-color-scheme
- Include browser download links (Chrome, Firefox, Edge, Safari, Arc)
- Display minimum browser requirements
- Update feature development documentation

* 📝 docs(CLAUDE): Update PR Linear Issue Association guidelines

- Clarify the requirement to include magic keywords in PR body for Linear issues.
- Add instruction to summarize work done in the Linear issue comment and update the issue status to "In Review".

Signed-off-by: Innei <tukon479@gmail.com>

*  feat: Update browser compatibility page and layout

- Change favicon link to absolute path in not-compatible.html.
- Add Safari browser support with corresponding icon and link.
- Update minimum browser requirements to Chrome 99+, Safari 16.4+, and Edge 99+.
- Fix typo in layout.tsx comments from "serveral" to "several".

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-07 23:00:52 +08:00
Innei
544931a9c6 🐛 fix: add separate border-radius for bottom-right corner on macOS 26 Chrome (#11287)
* 🐛 fix: add separate border-radius for bottom-right corner on macOS 26 Chrome

Fix issue where the main container's bottom-right corner radius was not applied correctly on macOS 26 Chrome.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* 📝 docs(CLAUDE): add PR Linear Issue Association guidelines

Include a new section in CLAUDE.md outlining the requirement to use magic keywords in PR bodies for associating with Linear issues, enhancing clarity on issue tracking.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-06 23:13:30 +08:00
YuTengjing
37e33b8b73 docs: update CLAUDE.md to reflect repository name change and clarify git workflow 2025-12-29 16:59:44 +08:00
Innei
b3520a2205 🐛 fix: Fix desktop test cases and refactor translations (#10955)
* 🐛 fix: fix desktop test cases and refactor translations

- Import translations from default locale instead of hardcoding
- Fix macOS menu test expectations to match actual translations
- Update I18nManager test to match implementation (fallbackLng: 'en')
- Support {{appName}} interpolation in test mocks

* 🐛 fix: add missing buildAndSetAppMenu calls in tests
2025-12-25 12:29:28 +08:00
Arvin Xu
3c4ef8a837 🔨 chore: update agent coding rule (#10856)
update agent coding rule
2025-12-19 23:05:15 +08:00
YuTengjing
458cbf4d5c 🔨 chore: track user last active time (#10733) 2025-12-11 17:14:25 +08:00
Arvin Xu
83fc2e8bc6 🐛 fix(desktop): add token refresh retry mechanism (#10575)
* 🐛 fix(desktop): add token refresh retry mechanism

- Add `async-retry` library for exponential backoff retry
- Implement retry logic in RemoteServerConfigCtr.refreshAccessToken()
  - Retries up to 3 times with exponential backoff (1s, 2s, 4s)
  - Distinguishes between retryable (network) and non-retryable (invalid_grant) errors
- Update AuthCtr to only clear tokens for non-retryable errors
  - Transient errors now preserve tokens for retry on next cycle
- Add isNonRetryableError() helper method

This fixes the issue where temporary network problems would cause
users to be logged out and require re-authorization.

Closes LOBE-1368

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

Co-Authored-By: Claude <noreply@anthropic.com>

* update

* 🐛 fix: treat deterministic failures as non-retryable errors

Add deterministic failures to non-retryable error list:
- 'No refresh token available' - refresh token missing from storage
- 'Remote server is not active or configured' - config invalid/disabled
- 'Missing tokens in refresh response' - server returned incomplete response

These permanent failures now trigger immediate token clearing and
authorizationRequired broadcast instead of infinite retry loop.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* 📝 docs: clarify issue status workflow - use "In Review" after PR creation

- Change workflow to set status to "In Review" when PR is created
- "Done" status should only be set after PR is merged
- Add note about Linear-GitHub integration for auto status update

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

Co-Authored-By: Claude <noreply@anthropic.com>

* 🐛 fix: add grace period for consumed RefreshToken

When rotateRefreshToken is enabled, the old refresh token is consumed
when a new one is issued. If the client fails to receive/save the new
token (network issues, crashes), the login state is lost.

This adds a 3-minute grace period allowing consumed refresh tokens to
be reused, giving clients a chance to retry the refresh operation.

Changes:
- Add REFRESH_TOKEN_GRACE_PERIOD_SECONDS constant (180s)
- Modify find() to allow RefreshToken reuse within grace period
- Add unit tests for grace period behavior

Closes LOBE-1369

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

Co-Authored-By: Claude <noreply@anthropic.com>

* 📝 style: translate adapter test descriptions to English

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-03 15:46:14 +08:00
Arvin Xu
28a56e96ce test(database): improve test coverage for models and repositories (#10518)
* update

*  test(database): add ThreadModel unit tests

Add comprehensive unit tests for ThreadModel covering:
- create: thread creation with various parameters
- query: fetch all threads for user
- queryByTopicId: fetch threads by topic
- findById: retrieve thread by id
- update: update thread properties
- delete: delete single thread
- deleteAll: delete all user threads
- User isolation tests for security

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

Co-Authored-By: Claude <noreply@anthropic.com>

*  test(database): add EmbeddingModel unit tests

Add comprehensive unit tests for EmbeddingModel covering:
- create: create new embedding for a chunk
- bulkCreate: batch create embeddings with conflict handling
- delete: delete embedding by id
- query: fetch all user embeddings
- findById: retrieve embedding by id
- countUsage: count total embeddings for user
- User isolation tests for security

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

Co-Authored-By: Claude <noreply@anthropic.com>

*  test(database): add OAuthHandoffModel unit tests

Add comprehensive unit tests for OAuthHandoffModel covering:
- create: create OAuth handoff with conflict handling
- fetchAndConsume: fetch and delete credentials with TTL check
- cleanupExpired: delete expired records (>5 min old)
- exists: check credential existence without consuming
- Expiration validation for 5-minute TTL

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

Co-Authored-By: Claude <noreply@anthropic.com>

*  test(database): add UserModel unit tests

Add comprehensive unit tests for UserModel covering:
- getUserRegistrationDuration: calculate user registration duration
- getUserState: get user state with settings and decryption
- getUserSSOProviders: get linked SSO providers
- getUserSettings: retrieve user settings
- updateUser: update user properties
- deleteSetting: delete user settings
- updateSetting: create/update user settings (upsert)
- updatePreference: merge and update user preferences
- updateGuide: update user guide preferences

Static methods:
- makeSureUserExist: ensure user exists
- createUser: create new user with duplicate check
- deleteUser: delete user by id
- findById: find user by id
- findByEmail: find user by email
- getUserApiKeys: get decrypted API keys

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

Co-Authored-By: Claude <noreply@anthropic.com>

*  test(database): add missing DocumentModel tests

Add tests for uncovered DocumentModel methods:
- create: create new document
- delete: delete document by id with user isolation
- deleteAll: delete all user documents
- query: query all documents with ordering
- findById: find document by id with user isolation
- update: update document with user isolation

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

Co-Authored-By: Claude <noreply@anthropic.com>

*  test(database): add user isolation tests for AgentModel

Add user isolation security tests to ensure users cannot access or modify
other users' knowledge base and file associations.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* 🐛 fix(database): fix flaky document ordering test

Add 50ms delay before update to ensure timestamp difference for ordering test.

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-01 02:04:14 +08:00
YuTengjing
beb9471e15 feat: support bedrok prompt cache and usage compute (#10337) 2025-11-22 13:09:07 +08:00
YuTengjing
ca033420b9 🐛 fix(desktop): macos26 small icon (#9421)
* 🐛 fix(desktop): macos26 icon small

* Revert "🐛 fix(desktop): macos26 icon small"

This reverts commit 4a4b7b230c.

*  feat(desktop): support Liquid Glass icons for macOS 26

- Add pre-generated Assets.car files for all build variants
- Configure afterPack hook to copy Assets.car during build
- Maintain backward compatibility with .icns fallback for older macOS

Reference: https://github.com/electron-userland/electron-builder/issues/9254

* docs: optimize comments

* fix: update deprecated macos-13 to macos-15-intel

* docs: optimize ai rules
2025-10-08 23:30:35 +08:00
YuTengjing
6325602480 📝 docs(rules): optimize agent rules and documentation structure (#9486) 2025-09-30 16:07:32 +08:00
YuTengjing
58e19f856c feat: add nano banana Chinese prompt notify (#9038) 2025-09-03 16:29:13 +08:00
YuTengjing
2eeab57c1e docs: update bfl doc cover image url (#8951) 2025-08-27 22:20:18 +08:00
YuTengjing
9a6657e52e 📝 docs(workflow): optimize documentation structure and development setup (#8934) 2025-08-26 18:21:22 +08:00
YuTengjing
0efe28d122 feat(image): polish ai image (#8915) 2025-08-25 22:38:41 +08:00
YuTengjing
27d48e89e9 👷 build: optimize claude action workflow and add vscode settings (#8796) 2025-08-14 20:14:54 +08:00