mirror of
https://github.com/lobehub/lobehub.git
synced 2026-09-20 04:56:13 +08:00
fix/topic-switch-message-refresh
75 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ab5ec4c81d |
♻️ refactor(agent-share): move the share surface out of the open-source tree (#19467)
* ♻️ refactor(agent-share): move the share surface out of the open-source tree Agent sharing runs a visitor's conversation on the creator's account and bills it to them. `ENABLE_BUSINESS_FEATURES` is `false` here, so every entry point already failed closed and the ~6k lines of surface were unreachable — while the spend cap that makes sharing safe is enforced only where that accounting lives. Its siblings `pageShare` and `artifactShare` already ship that way. Removed: the visitor and creator-settings features, their skeletons, and the `/a/*` route registrations on desktop and mobile. Kept: the table, models, tRPC procedures, runtime authorization, and the locale keys. Only the UI layer moves. Added two slots so the remaining open-source surfaces keep compiling and stay honest about the capability: - `useAgentShareSupported` reports "not supported", which hides the profile tab, the header action, and the settings page. - `AgentShareSettingsPage` renders nothing for the route those entries reach. `SharedAgentData` also gains the fields the moved profile reads — creator, tags, opening questions, reach counts, terms and granted tool identifiers — since the procedure serving them stays here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ✅ test(spa): stop asserting the share path as a standalone route `/a/*` is no longer defined here, so it resolves through the main layout's catch-all instead of as a standalone route. The deployment that registers the share surface asserts its own scope. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * 🔥 test(e2e): drop the agent-share keyboard scenario with its surface The `@ROUTES-003` scenario tabs to the share visitor top bar's "Go to my LobeHub" link, which left this tree along with the rest of the visitor UI. Its intent — a share link never dead-ends a visitor — is covered in the cloud repo, where the bar now lives. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
ffaa7d2a1c |
🐛 fix(nav-panel): keep the Home sidebar scroll offset across route round trips (#19441)
* 🐛 fix(nav-panel): keep the Home sidebar scroll offset across route round trips Claude-Session: https://claude.ai/code/session_01974sCT5qKNQpP7mMiT5mn6 * ✅ test: scope sidebar e2e locators to visible elements and drop flaky parse timing assertion Claude-Session: https://claude.ai/code/session_01ARGf412bndxNwVrxYxQBEa * ✅ test(e2e): wait for a visible search control before typing in the sidebar Claude-Session: https://claude.ai/code/session_01ARGf412bndxNwVrxYxQBEa * 👷 ci(size-gate): record resolved dependency versions and report drift against the baseline Claude-Session: https://claude.ai/code/session_01ARGf412bndxNwVrxYxQBEa |
||
|
|
0382b49ea2 |
🐛 fix(conversation): restore the slide when a sent message pins to the top (#19264)
The send scroll fires before the spacer row exists, so virtua clamps it and the visible slide is the settle re-pin after mount. Since #17930 made every settle re-pin instant, that re-pin aborted the animation and the user turn jumped to the top. Keep re-pins smooth for a short window after send; later settles (workflow collapse at turn completion) stay instant. Add an e2e scroll-trace probe (per-frame scrollTop sampler + slide/jump classifier) and a CI scenario that fails on the jump. Claude-Session: https://claude.ai/code/session_01SYxzWZKa6Xjf5qcunKJyPL |
||
|
|
36ca481bf0 |
✨ feat(agent-share): share settings tabs, /a/:slug visitor page with product bar and editor (#19180)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
183e5dd547 | ✅ test(e2e): stabilize Home layout rail scenario by asserting scroll restore (#18444) | ||
|
|
93fd6f854f |
🐛 fix(home): scroll the dashboard as one page, and persist the recents cache (#17836)
* 🐛 fix(home): persist recent-topics cache and align its loading skeleton The Home recents list was memory-only: `CACHE_TIERS.local` listed `recent:list`, and the provider matches patterns as substrings, so the sibling key `recent:topicList` was never covered. Every cold boot refetched and flashed a skeleton for data we already had. Give it its own tier entry. The skeleton it flashed was also wrong on two counts. It painted a real leading icon, so the loading state showed concrete content that was then swapped for an avatar. And its bars (14px/11px, spaced by a flex gap) did not match the row's 22px/20px line boxes, so the list jumped when data landed. Replace it with a placeholder that mirrors the row exactly: shared box metrics, a skeleton avatar in the lead slot, bars centred in the real line boxes, and the trailing timestamp the recents rows actually have. Also fix the zh-CN copy: topic is 话题 everywhere else in the product. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * 💄 style(home): scroll the dashboard as one page Each column owned a scroll viewport, so the page scrolled in pieces: the topic list travelled under a pinned greeting while the rail sat still, and no gesture moved the dashboard as a whole. Wrap the grid in a single scroll viewport instead and let row 2 size to its content, so the greeting, the composer, the topic list and the rail travel together. The two column scrollbars collapse into one page scrollbar, which rides in the gutter the rail already reserved for its own. The row hover bleed keeps its lane as inline padding on the scroll content — without it the viewport's overflow clip would shear the bleed off at the column edge. Verified against a running dev server: greeting and main column both shift by exactly the scroll delta, the main column has no scrollbar of its own, and the collapsed-rail state (content widened by 140px) adds no horizontal overflow. The E2E layout scenario measured the two per-column scrollbars, so it is rewritten around the new invariant: the columns have no scrollbars, one gesture moves both, and the page scrollbar stays clear of the rail card. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * 💄 style(home): scroll at the pane, not in a viewport widget Wrapping the dashboard in a ScrollArea fixed the piecewise scrolling but introduced two problems of its own. The widget sat inside the centred 1240px column, so its scrollbar floated in the margin beside the content instead of against the app frame. And its viewport is a focusable scroll region, so Tab landed on it and drew a focus ring around the entire dashboard. Scroll at the route's full-width wrapper with a plain `overflow-y: auto` instead — the idiom AgentTasksPage and AgentViewAllPage already use. A native overflow container puts the bar on the pane edge and takes no tab stop, and the row hover bleed now paints into the route's existing 24px inline padding rather than needing a lane of its own. Verified against a running dev server: the scroller's right edge is the pane edge (1271) and sits outside the centred column (1247); its tabIndex is -1 and six Tab presses never focus an ancestor of the dashboard; scrolling still moves the greeting and the main column by the same delta with no horizontal overflow. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * 📝 docs(acceptance): record the cold-SWR-cache probe trap Clearing the SWR cache tier then reloading does not produce a cold cache: the provider flushes on `pagehide`, so the outgoing page writes its in-memory cache straight back and the next document hydrates from a repopulated tier. Verifying the Home recents skeleton hit this and it read as a product bug for a while. Record the working recipe (clear at document start in the new document, paired with a warm control run) and correct the decision-table row that recommended the broken sequence. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * 🐛 fix(e2e): don't declare a named function inside page.evaluate The Home layout scenario died with `ReferenceError: __name is not defined`, taking the Test Web App job down (1 of 84 scenarios). The steps are transpiled by `tsx/cjs`, i.e. esbuild with keepNames, which rewrites `const scrolls = (node) => …` into `__name((node) => …, 'scrolls')`. `__name` is a module-scope helper esbuild emits for the Node bundle; Playwright serializes only the callback body into the page, so the browser evaluates a reference to a helper it was never given. Inline arrows passed straight to `.map` / `.filter` / `.some` are left untouched — which is why the sibling step using the same DOM query passed. Inline the predicate so the callback is self-contained, and note the constraint where the next person will hit it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
7ec38525a3 |
✨ feat(home): give the portrait a speech bubble (#17781)
* ✨ feat(home): give the portrait a speech bubble The promo used to be a chip in the header toolbar and the daily brief was glued onto the greeting. Both now come out of the portrait's mouth, so the agent has one voice instead of two, and the headline is just a greeting. - `useHomePromoLine()` replaces the `HomePromoBanner` stub: returning a node rather than rendering one lets the caller tell whether a promo is live, hold the brief back while it speaks, and hand the brief back on dismiss. Cloud owns the policy — how long a promo keeps the mouth is decided there by returning `undefined`. - The headline takes a fixed 440px measure. It used to wrap against the column, which changes width on collapse, so a brief of the wrong length re-wrapped and pushed the composer and the whole task list down a line. - The rail toggle moves from the composer's edge to a fixed top-right slot in an absolutely positioned nav header, replacing both the edge control and its mobile twin. - Collapsed, the content reclaims 140px of the vacated rail track, and the portrait slides over to lean on the composer instead of leaving with the cards. The bubble rides the same 220ms curve, so it never lags behind him. * 📝 docs(acceptance): record ingest, verifier and portal-router pitfalls * 🐛 fix(e2e): settle the rail transition before measuring the layout * 🐛 fix(home): derive the bubble's clearance from the container width The greeting's 440px measure only cleared the bubble at the container's 1240px maximum — the width I happened to verify. The bubble tracks the container's trailing edge while the greeting starts at its leading one, so every narrower container closed the gap: a 1280–1440px window with the nav panel expanded left a ~944px container, where the two overlapped by 296px. The measure now comes from the container width (`100cqw - GREETING_LANE`), handed to the headline through a CSS variable. Breakpoints move from the viewport to a `home` container query for the same reason: the nav panel takes 240–400px that a viewport media query cannot see. Below 1080px of container the three cannot share a line at all, so the bubble drops under the greeting and loses its tail. |
||
|
|
d5eeb8e5f0 |
✨ feat(home): refine dashboard layout and rail (#17756)
* ✨ feat(home): refine dashboard layout and rail * 💬 chore(home): clarify task mode description * ✅ test: align local storage mocks with sync reader * 🐛 fix(home): restore main scrollbar gutter * 💄 style(home): refine activity rail control |
||
|
|
3c331ec4e4 |
🐛 fix(home): restore layout and refine tab and topic semantics (#17735)
* 🐛 fix(home): restore rail gutter and new chat tab * ✨ feat(home): group running topics * ✅ test(home): ensure rail overflow in e2e |
||
|
|
3739f13a84 | 🐛 fix(auth): preserve OIDC consent form values (#17233) | ||
|
|
53d6925329 | ✅ test(e2e): cover OIDC device flow (#17188) | ||
|
|
2a55646c69 |
🧪 test(e2e): stabilize virtualized chat scroll assertions (#17111)
🧪 test(e2e): fix agent-scroll assertions measuring the wrong thing The @AGENT-SCROLL scenarios failed for two reasons, both in the test itself — the scroll behavior under test is correct. The pin assertions anchored to the message id captured right after sending, which is the optimistic `tmp_` id. The row is re-keyed to the persisted `msg_` id a moment later, so the locator pointed at a node that no longer existed and reported "the pin never landed" regardless of where the viewport actually was. Wait for the persisted id instead, and measure against it. The slowed mock also streamed the 3280-char article at 8 chars / 60ms — ~25s of real SSE now that the mock streams token by token — against a 30s wait step. Give the head delay the slack the assertions need and keep the stream brisk, so a full turn settles well inside the timeout. Kept entirely within the test: no product markup added. The viewport is resolved as the nearest scrollable ancestor and messages via the `data-message-id` that the chat list already renders. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
1c896571dc |
✨ feat: show 404 fallback when public agent or file turns private (#17110)
* ✨ feat: show 404 fallback when public agent or file turns private * 🐛 fix: guard RAG reference chunks with file visibility * ✅ test: adapt stale not-found and topic-delete assertions * 🐛 fix: guard queryByIds RAG chunks with file visibility * 🐛 fix: drop inaccessible attachments from reuse paths and stale agent cache on not-found * 🐛 fix: guard mobile agent route and hide tombstoned files from shared consumers |
||
|
|
5befbdd968 |
♻️ refactor(ui): migrate @lobehub/ui components to base-ui (#16909)
* ⚡️ perf: migrate createStyles to createStaticStyles in verify/task-callback UI Converts 9 components from the runtime `createStyles` hook to the zero-runtime `createStaticStyles`/`cssVar` API and prunes their now-resolved `no-restricted-imports` (antd-style/createStyles) suppressions from eslint-suppressions.json. * ♻️ refactor: migrate deprecated Tabs/Select imports to @lobehub/ui/base-ui Moves the last Tabs call site and all 20 remaining Select call sites off the deprecated antd-based @lobehub/ui wrappers onto @lobehub/ui/base-ui, and prunes their resolved no-restricted-imports suppressions. The two ModelSelect pickers (video + image) relied on a disabled option's custom onClick to jump to provider settings when no models are configured — base-ui's Select doesn't read that field. Reworked so the sentinel option's value reaches onChange instead, which base-ui does support, preserving the navigation behavior (and improving keyboard reachability, since the option is no longer marked disabled). * 🔥 chore: remove dead video/image ConfigPanel ModelSelect wrappers Both components were superseded by the shared @/features/ModelSwitchPanel picker and had no remaining import sites (only their VideoModelItem/ ImageModelItem sub-renderers are still reused there). Confirmed unreachable during agent-testing verification of the base-ui Select migration. * ♻️ refactor: migrate Button from @lobehub/ui to @lobehub/ui/base-ui Moves all 265 remaining Button call sites off the deprecated antd-based @lobehub/ui wrapper onto @lobehub/ui/base-ui, and prunes their resolved no-restricted-imports suppressions (289 -> 3 remaining, all namespace-import edge cases in test files unrelated to Button). Bumps @lobehub/ui to ^5.19.2, which now lets Button's `icon` prop accept a bare Lucide icon component reference (lobehub/lobe-ui#558) — the dominant call-site pattern carried over from the antd-based Button — so the import swap itself is mechanical for the vast majority of sites. The remaining call sites needed manual adjustment because base-ui's Button doesn't support antd 5's newer `color`+`variant` styling API (only the legacy `type`+`danger`+`ghost`+`fill`), nor `shadow`/`iconProps`, nor the antd v6 `iconPlacement` rename (base-ui kept `iconPosition`): - `color="default" variant="filled"` -> `type="fill"` (base-ui added this type specifically to cover the antd 5 neutral-filled pattern) - `variant="text"` / `variant="outlined"` alone -> `type="text"` / removed (outlined is base-ui's default look) - `shadow` has no base-ui equivalent -> dropped (minor cosmetic regression on a handful of primary action buttons) - `iconProps` -> inline-rendered the icon as an element instead (`icon={<Icon icon={X} size={12} />}`) to preserve custom sizing - two files had custom CSS targeting the antd-only `.ant-btn` class hook, which never matches base-ui's Button — flattened those selectors so the styles still apply * ✅ test: fix base-ui migration ci * ✅ test: fix remaining base-ui migration mocks * ♻️ refactor: migrate Switch to base-ui * ♻️ refactor: finish base-ui import migration * ✅ test: support base-ui style mock * 🔧 chore: regenerate eslint suppressions after canary merge * 🐛 fix: mock base-ui Button in StatusGuide test after migration * 🐛 fix: mock base-ui Switch in ProxyForm test after migration * 🐛 fix(e2e): match Delete Topic confirm button and wait out slowed SSE stream |
||
|
|
9e4d7cb8db | 🐛 fix(e2e): stream valid SSE responses from LLM mock (#17094) | ||
|
|
36e88ca350 |
🧪 test(e2e): stabilize agent-scroll pin assertion with polling (#16653)
`AGENT-SCROLL-004/005` sampled the pinned user-message position once, a fixed 1200ms after send. But the pin scrolls smoothly (`align:'start', smooth:true`) and re-fires on every layout bump while the reply streams — so the anchored position is reached repeatedly, not at one fixed instant. A single sample can land mid-animation (observed ~260px vs the ≤150px slack) → occasional CI flake. Poll for a settled frame within the slack instead of sampling once. If the pin genuinely never lands, the loop exhausts and the final assertion still fails with the real delta, so a true regression is not masked. Also extracts the shared `measurePinDelta` helper (was duplicated across both pin assertions). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
ccc22e5b8b |
♻️ refactor(modal): migrate legacy modals to base-ui (#16596)
* ♻️ refactor(modal): migrate legacy modals to base-ui * 💄 style(modal): align default footer actions * ♻️ refactor(modal): prefer imperative plugin dialogs * 🔨 chore(desktop): add electron runtime repair script * ✅ test(modal): align market claim modal mock * ✅ test(modal): align create modal mocks * ✅ test(e2e): stabilize home sidebar item lookup |
||
|
|
3e133cbbd8 |
✅ test(e2e): parallelize semantic e2e validation (#16452)
* ✅ test(e2e): speed up semantic agent smoke path * ✅ test(e2e): run semantic suite in parallel |
||
|
|
2c66867f65 |
🐛 fix(edit-lock): allow same-user generic updates (#15969)
* 🐛 fix(edit-lock): allow same-user generic updates * 🧪 fix(e2e): mock community marketplace APIs * 💬 docs(e2e): explain community marketplace mocks * 🧪 fix(e2e): preserve mixed community trpc batches * 🧪 fix(e2e): unwrap single batched community input |
||
|
|
b4b1205ee9 |
♻️ refactor(modal): migrate confirm modals to @lobehub/ui/base-ui (Phase 1) (#15259)
* ♻️ refactor(modal): migrate confirm modals to @lobehub/ui/base-ui Replace all `App.useApp().modal.confirm`, `Modal.confirm` and `AntModal.confirm` call sites with the headless `confirmModal` from `@lobehub/ui/base-ui`, dropping antd-only props (`centered`, `type`, `width`, `okButtonProps.type='primary'`, `okButtonProps.loading`, `classNames.root`) that the base-ui imperative API does not accept. - 82 files touched; `modal.confirm`/`Modal.confirm` call sites now zero - `PageEditor/store/action.ts`: drop `modal` arg from `handleDelete` - `ResourceManager/useUploadFolder`: replace dynamic `import('antd').Modal` - `Eval/DatasetsTab`: migrate `modal.success` to `confirmModal` Part of LOBE-9645 Phase 1. * ♻️ refactor(ui): migrate select/modal call sites to @lobehub/ui/base-ui - Convert imperative-modal factories (createXxxModal + Content split) for apikey, creds (Create/Edit/View), provider (CreateNewProvider), and messenger LinkModal. - Switch Select usages to base-ui Select (Messenger AgentSelect, provider sdkType). - Restructure CreateNewProvider form to vertical layout with manual section titles for tighter spacing; drop FormModal/Form group nesting. - Standardize small ActionIcon sizing via DESKTOP_HEADER_ICON_SMALL_SIZE (WideScreenButton, ToggleRightPanelButton, ContextDropdown, AddNewProvider). - Fix missing title on ResourceManager delete confirm modal so the header (title + close X) renders. - Update react skill and AGENTS.md to require base-ui priority over root @lobehub/ui / antd; expand component table and Common Mistakes with explicit base-ui rules. * ♻️ refactor(ui): swap antd Select to base-ui Select and migrate createStyles to createStaticStyles * ✅ test: update test mocks for base-ui confirmModal migration * ✅ test(e2e): switch delete confirm selector to base-ui dialog role |
||
|
|
5b7611615e |
🐛 fix: system bot error (#14784)
* chore: add start link short cut * chore: update qq zh files * fix: add messenger block message alert * chore: update i18n files * fix: messenger router bridge * fix: dm thread create problem * chore: remove lab prefer for messenger * chore: update i18n files * fix: e2e test |
||
|
|
84c89f9c03 |
🐛 fix(conversation): prevent synthetic scroll from shrinking spacer (#14584)
🐛 fix: prevent synthetic scroll from shrinking spacer
|
||
|
|
22c880763d | ⏪️ revert: remove e2e topic group expansion workaround (#14480) | ||
|
|
65ba4ad435 |
🐛 fix(e2e): expand visible topic groups in E2E steps (#14472)
🧪 Expand visible topic groups in E2E steps
|
||
|
|
f017dcd0ea | ✅ test: fix home cold route CI coverage | ||
|
|
3b1eef72d8 |
🐛 fix(chat): preserve topics across cold route sends (#14284)
**Hotfix Scope:** Topic preservation across cold chat-entry routes > Keeps newly created Topics visible when a first message is sent before the destination chat route has fully hydrated. - **Page Agent empty-session regression** — Sending the first message in an empty Page Agent panel no longer clears the newly created Topic and returns the panel to an empty state. (Resolves LOBE-8351) - **Home cold-route send regression** — Sending from the Home default Chat Input now routes to the newly created Inbox Topic even when `/agent/:aid` has never been opened and the route chunk has no warm cache. - **Page-scoped Copilot consistency** — Page Copilot and File Copilot share the same provider-level topic reset behavior, so stale Topics are cleared only when entering or switching the scoped Agent. - **Regression coverage** — Added focused unit coverage for Home default sends, route parity coverage remains intact, and added an E2E scenario for the no-cache Home send path. - `bunx vitest run --silent='passed-only' 'src/routes/(main)/home/features/InputArea/useSend.test.ts' 'src/spa/router/desktopRouter.sync.test.tsx' 'src/routes/(main)/agent/features/Conversation/ChatHydration/index.test.tsx' 'src/routes/(main)/agent/_layout/AgentIdSync.test.tsx'` - `BASE_URL=http://localhost:3007 DATABASE_URL=postgresql://postgres:postgres@localhost:5433/postgres bun run test -- --tags '@HOME-CHAT-COLD-001'` from `e2e/` - Self-hosted: pull the new image and restart. No schema or environment changes. - Cloud: ships through the normal hotfix deployment after merge. @Innei Fixes LOBE-8351 |
||
|
|
b9034ce9c1 |
🐛 fix: e2e page related tests (#14309)
* chore: add default home locales * fix: e2e tests * fix: LobeAI locales * fix: Lobe AI locales * fix: test case errors * chore: update i18n files |
||
|
|
5a46c5a971 |
✨ feat: refactor home (#14266)
* feat: refactor home * feat: add home agent id switch * fix: useSend ensure agent map init * feat: add custom image/video generation menu item * chore: remove agent list ,group list and modetag * fix: default home agent fallback * fix: built in agent builder creation * feat: add deepseek pro v4 hot picks * chore: support agent select scrolling * feat: add bot integration banner * fix: lint error * chore: update home page styles * chore: adjust padding * test: add image item to sidebar items test fixtures Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test: remove obsolete home starter e2e tests The mode-tag buttons (Create Agent / Create Group / Write) no longer exist after the Home refactor, so these scenarios cannot run. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
fa508f4259 | ✨feat: add agent-specific topic grouping mode and improve empty state… (#14225) | ||
|
|
043d2a81fb |
✨ feat(agent): add floating chat panel and workspace improvements (#13887)
* ✨ feat(FloatingChatPanel): add single-instance mount guard * ✨ feat(FloatingChatPanel): add inner ChatBody layout * ✨ feat(FloatingChatPanel): add reusable floating conversation panel * ✅ test(FloatingChatPanel): add props wiring smoke tests * Refactor agent topic and page routes * Restore topic page routing for floating chat panel * ✨ feat(FloatingChatPanel): enhance ChatBody and TopicItem for improved routing and styling - Updated ChatBody to maintain scroll ownership while hiding overflow. - Refactored TopicItem to correctly highlight active topics based on routing context. - Added tests for TopicItem to ensure correct active state behavior. - Introduced static styles for FloatingChatPanel to manage layout overflow. Signed-off-by: Innei <tukon479@gmail.com> * chore: help to merge & rebase * chore: align merge with canary — drop pkg.pr.new ui, adopt canary useMenu, remove NotebookButton * ✨ feat: add ViewSwitcher component and update localization for chat views - Introduced a new ViewSwitcher component to toggle between chat, page, and task views in the conversation header. - Updated English and Chinese localization files to include new labels for the view switcher options. - Refactored the conversation header to integrate the ViewSwitcher, enhancing the user interface for better navigation. Signed-off-by: Innei <tukon479@gmail.com> * fix: update @lobehub/ui to version 5.9.1 and refactor FloatingChatPanel to use FloatingSheet component - Updated the @lobehub/ui dependency in package.json to version 5.9.1. - Refactored FloatingChatPanel to utilize the new FloatingSheet component, enhancing its layout and state management. - Introduced a new ChatLayout component for better organization of chat-related UI elements. - Adjusted routing configuration to incorporate the new ChatLayout for agent chat pages. Signed-off-by: Innei <tukon479@gmail.com> * feat: add TopicCanvas and TitleSection components for topic management - Introduced TopicCanvas component to serve as a document canvas for topics, integrating an editor and title section. - Added TitleSection component for managing topic titles and emojis, enhancing user interaction with a dedicated UI. - Updated FloatingChatPanel to accommodate the new TopicCanvas, ensuring a cohesive layout in the topic page. - Enhanced tests to verify the integration of TopicCanvas within the topic page route. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(agent-page): bind documentId to URL and introduce HeaderSlot - Add nested /agent/:aid/:topicId/page/:docId route with PageRedirect for bare /page - Introduce useAutoCreateTopicDocument with module-level inflight de-dup - Lift Portal + WorkingSidebar to (chat) layout; keep ChatHeader in left column - Sidebar document clicks on page route navigate to /page/:docId instead of opening Portal - Add HeaderSlot (context + createPortal) as a reusable header injection point - Mount AutoSaveHint via HeaderSlot; register Files hotkey scope in TopicCanvas so Cmd+S triggers manual save - Sync desktopRouter.config.tsx and desktopRouter.config.desktop.tsx - Extend RecentlyViewed plugin to round-trip optional docId segment * Use topic titles for auto-created page documents * Add page-agent init gating and runtime diagnostics * Support current-topic agent documents * Implement Active Topic Document and Disabled Tool Call Filtering - Introduced ActiveTopicDocumentContextInjector to inject context for active topic documents into user messages. - Added DisabledToolCallFilter to remove historical tool calls for disabled tools in the current runtime scope. - Updated MessagesEngine to utilize the new context injectors and filters. - Enhanced tests to verify the correct injection of active topic document context and filtering of disabled tool calls. This update improves the handling of document editing contexts and tool management in the conversation flow. Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance agent document management with LiteXML operations - Updated API names for clarity, changing 'patchDocument' to 'modifyNodes'. - Introduced LiteXML operation schema for document modifications. - Implemented new mutation for modifying document nodes via LiteXML. - Enhanced document retrieval methods to support format options (XML, Markdown, Both). - Added support for editor data snapshots and normalization of diff nodes. - Improved document history management to handle editor data with diff nodes. - Created tests for new features and ensured existing functionality remains intact. Signed-off-by: Innei <tukon479@gmail.com> * 🐛 fix: apply agent document xml edits directly * Refine document cache invalidation and editor hydration * 🐛 fix: stabilize agent topic hydration * fix: update @lobehub/editor dependency version and clean up test mocks Signed-off-by: Innei <tukon479@gmail.com> * Potential fix for pull request finding 'Useless assignment to local variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * 🐛 fix(document): preserve pending diff nodes through save path Skip normalizeEditorDataDiffNodes on every autosave so diff nodes awaiting user review survive persistence. Normalization now runs only on explicit Accept/Reject via DiffAllToolbar. Also flip headless litexml ops to delay:true to match the new review flow. * 🐛 fix(agent): detect agent sub-route from URL params not cached topic isInAgentSubRoute used routeTopicId (with activeTopicId fallback) as its base path. On /agent/:aid/profile with a cached activeTopicId, the base became /agent/:aid/:cachedTopicId which pathname cannot startsWith, so sub-route detection returned false and sidebar topic clicks only called switchTopic without routing back to chat — users stayed stuck on profile. Derive the sub-route base from params.topicId directly so stale store state cannot mask the check. routeTopicId export keeps the fallback for sidebar highlighting. * 🐛 fix(page): repair topic page document recovery * 🐛 fix(page-agent): block tool calls when page editor is not mounted scope is topic-bound not route-bound, so navigating from /agent/.../Page to /agent/... keeps scope==='page' and PageAgentIdentifier stayed in the injected plugin list. The LLM could still call initPage / modifyNodes / etc. against a stale editor reference, returning misleading success (e.g. nodeCount=0). Two layers of guard: - PageAgentExecutor wraps `invoke` and returns a structured PAGE_EDITOR_NOT_MOUNTED / kind: 'replan' result when the runtime editor is not mounted, pointing the LLM at lobe-agent-documents. - streamingExecutor drops PageAgentIdentifier from the tool set via the new `composeEnabledTools` pipeline when scope==='page' and the page-agent runtime is not ready. Also extract the tool-set composition (inject merge + runtime drops) out of the ~320-line internal_createAgentState into `mecha/toolSetComposer`, with unit tests. * 🐛 fix(chat): unify message stream for /agent/:topicId and /page/:docId Before this change a page-scoped conversation (FloatingChatPanel with scope='page' in the /Page route) partitioned the client message store by scope, so /agent/:topicId and /agent/:topicId/page/:docId each built their own messagesMap slot and SWR cache — but the TRPC getMessages endpoint ignores scope and returned the same messages for both, producing duplicate fetches and a visible message-history split between the two surfaces. Fixes by keeping scope='page' as a capability/surfacing marker only: - messageMapKey: collapse 'page' to the default scope early in toMessageMapContext, so threadId/groupId still win and only the main/page pair actually unifies. - useFetchMessages: build the SWR key from identity fields (agentId, groupId, threadId, topicId) instead of the full ConversationContext, so scope no longer partitions the cache. agentConfigResolver/streamingExecutor/composeEnabledTools still read scope='page' from operation.context for PageAgent injection and initialContext.pageEditor wiring — the capability layer is unchanged. Also fix two pre-existing test regressions surfaced by re-running the impacted suites: - streamingExecutor page-editor initialContext test now mocks pageAgentRuntime.isReady() (required since the PageAgent editor-ready guard landed). - FloatingChatPanel default shell props test updated to match the [180,320,520,800] snap points introduced in |
||
|
|
b55cf6b936 |
♻️ refactor(conversation): unify scroll-to-user + spacer hooks (#14132)
* ♻️ refactor(conversation): unify spacer + scroll-to-user hooks Merge `useConversationSpacer` and `useScrollToUserMessage` into a single `useConversationScroll` hook to eliminate the races that caused occasional "send message but viewport doesn't pin to the new user message" regressions. Race fixes: - Single `prevLengthRef` and a single send-detection effect, replacing two hooks with independent length tracking that could disagree across renders. - `virtuaRef` is passed in and dereferenced at call time instead of reading `virtuaRef.current?.scrollToIndex` during render — removes the window where the ref hadn't been attached yet when a send fired. - Pin state is an explicit `{ index, seenActive }` ref with three clear transitions (send / layout-bump / user-scroll-up) instead of several cooperating refs + derived flags. - Retries are layout-driven: each `spacerLayoutVersion` bump re-fires `scrollToIndex` exactly once. The old 0/32/96ms timer fan-out is gone. Also bumps `AT_BOTTOM_THRESHOLD` 100 → 300 so `atBottom` stays stable while the spacer is settling. * ♻️ refactor(conversation): extract sub-hooks from useConversationScroll Split the unified conversation scroll hook into four cooperating sub-hooks in the same file so each layer has one clear concern: - useSpacerLayoutSignal — ResizeObserver on the spacer node → version bumps - useSpacerHeight — natural height / mount lifecycle / shrink state - usePinController — pin state machine + virtua-aware scroll dispatch - useScrollShrink — scrollOffset delta → cancel pin / shrink spacer The main hook now owns just the send-detection effect, the pin re-fire on layout settle, and derived output. Behavior is unchanged — same 15 tests pass — but each piece is now readable in isolation. * ⚡️ perf(conversation): narrow VirtualizedList subscription to a boolean VirtualizedList only needs to know whether the second-to-last message is the user's — the full displayMessages array was never used. Move the derivation into `dataSelectors.isSecondLastMessageFromUser` so the component re-renders on role transitions, not on every assistant token. * ✅ test(e2e): cover conversation scroll behavior across the auto-scroll setting Adds three scenarios under `@AGENT-SCROLL-*` that exercise the merged `useConversationScroll` hook end-to-end through the real chat UI: - AGENT-SCROLL-001 — with auto-scroll ON, the viewport ends up near the bottom once a long response has finished streaming. - AGENT-SCROLL-002 — with auto-scroll OFF, the user's message stays pinned to the top and the viewport does not chase the assistant. - AGENT-SCROLL-003 — with auto-scroll ON, scrolling up mid-stream cancels the pin and the viewport is not yanked back to the bottom afterwards. Also extends the LLM mock with `setConfig` / `resetConfig` so scenario 3 can slow the response down enough for the mid-stream manual scroll, and adds `presetResponses.longScrollArticle` (long enough to overflow the viewport so scroll assertions are meaningful). * ✅ test(e2e): cover send-time pin-to-top as its own scenario AGENT-SCROLL-004 exercises the core pin behavior of `useConversationScroll` independent of the auto-scroll setting: after sending a message, the user's turn must be anchored to the top of the scrollport. Uses the slow-response mock so the assertion runs while the spacer is still mounted. * ✅ test(e2e): tune scroll scenarios after runtime validation Run outcomes against a cold Next dev server (paradedb + next dev -p 3006): - AGENT-SCROLL-001 (enabled → viewport stays near bottom) — passing - AGENT-SCROLL-002 (disabled → user msg pinned to top) — passing - AGENT-SCROLL-004 (send pins user msg to top) — passing - AGENT-SCROLL-003 (mid-stream scroll-up cancels pin) — skipped Scenario 3 is marked `@skip` until the LLM mock supports truly chunked SSE streaming. The current mock fulfils the whole body at once, which collapses the "mid-stream" window to a handful of ms and makes the manual-scroll timing race-prone. The cancel-pin path is already covered at the unit level in `useConversationScroll.test.ts`, so the e2e placeholder just keeps the scenario on the radar. Other tweaks for dev-mode reliability: - Bumped setting-toggle step timeout to 90 s (turbopack cold compile of `/settings/chat-appearance` can exceed the default 30 s on first hit) - Relaxed the inner `networkidle` / `toBeVisible` waits there to match - Added a matching negative-path Then ("not pinned") that would power the skipped scenario once the mock is upgraded * 🐛 fix(conversation): rebind pin tracking on every new turn The message index refs that drive `latestAssistantSignature` and the messages `ResizeObserver` were plain `useRef`s updated inside the send- detection effect. On the render triggered by spacer state updates right after a send, `[dataSource, displayMessages]` could be unchanged, so the signature memo returned its cached value and the observer effect never rebound to the new turn's user/assistant DOM nodes. Under certain commit orderings this left spacer height tracking the previous turn and let the pin-to-user anchor drift. Turn the indices into state, include `assistantMessageIndex` in the signature memo's deps, and forward the state (not a ref) to `useSpacerHeight`. The observer now reliably rebinds to the fresh nodes on the very next render. Adds a unit regression covering the observer-rebind path and an e2e scenario (`AGENT-SCROLL-005`) that sends two consecutive turns and checks that the second user message still pins to the top. |
||
|
|
32e36e330a |
🔨 chore: optimize message tool (#13444)
* chore: adjust electron testing to local testing * chore: comprehence discord docs * chore: add common capture window * chore: default enable message tool in bot conversation * fix: discord readMessages error * chore: optimize readMessages prompt * chore: optimize limit description * chore: optimize limit size * chore: remove limit parameter for discord * chore: add threadRecover Patch * chore: optimize system role and bot context * fix: avoid overide user config message tool * chore: add default timeout |
||
|
|
965fc929e1 |
feat: add unified messaging tool for cross-platform communication (#13296)
* ✨ feat: add cross-platform message tool for AI bot channel operations Implement a unified message tool (`lobe-message`) that provides AI with messaging capabilities across Discord, Telegram, Slack, Google Chat, and IRC through a single interface with platform-specific extensions. Core APIs: sendMessage, readMessages, editMessage, deleteMessage, searchMessages, reactToMessage, getReactions, pin/unpin management, channel/member info, thread operations, and polls. Architecture follows the established builtin-tool pattern: - Package: @lobechat/builtin-tool-message (manifest, types, executor, ExecutionRuntime, client components) - Registry: registered in builtin-tools (renders, inspectors, interventions, streamings) - Server runtime: stub service ready for platform adapter integration https://claude.ai/code/session_011sHc6R7V4cSYKere9RY1QM * feat: implement platform specific message service * chore: add wechat platform * chore: update wechat api service * chore: update protocol implementation * chore: optimize platform api test * fix: lark domain error * feat: support bot message cli * chore: refactor adapter to service * chore: optimize bot status fetch * fix: bot status * fix: channel nav ignore * feat: message tool support bot manage * feat: add lobe-message runtime * feat: support direct message * feat: add history limit * chore: update const limit * feat: optimize server id message history limit * chore: optimize system role & inject platform environment info * chore: update readMessages vibe * fix: form body width 50% * chore: optimize tool prompt * chore: update i18n files * chore: optimize read message system role and update bot message lh * updage readMessage api rate limit * chore: comatible for readMessages * fix: feishu readMessage implementation error * fix: test case * chore: update i18n files * fix: lint error * chore: add timeout for conversaction case * fix: message test case * fix: vite gzip error --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
4a7c89ec25 |
fix: discord not create thread & wechat media and connect optimize (#13228)
* fix: avoid subscribe whole channel * chore: add start message whatever * chore: remove typing interval * feat: support typing keep alive * fix: wechat redis client * feat: add common gateway * chore: use persistent to replace websocket * chore: add wechat tip * fix: add queue Handoff Succeeded stop typing * feat: optimize connect status display and wechat connect infomation * chore: wechat maximum 2048 * feat: support wechat files type * feat: support wechat image upload * feat: support wechat image resolve * fix: lint error * fix: lint error * fix: postProcessUrl test case * chore: moke file service * chore: add page test case timeout |
||
|
|
b4862f2942 |
🐛 fix: manual tool disabled (#13218)
fix: manual tool disabled |
||
|
|
3f9c23e7b4 |
✨ feat: support lark and feishu bot (#12712)
* feat: support lark and feishu * chore: change integration to channel * chore: rename from integration to channel * fix: channel router * feat: add topic list channel provider icon * chore: update webhook url * chore: channel form refact * chore: update i18n keys to channel * chore: update form item description * style: hide required mark * feat: add lark chat adapter * chore: clean speaker tag & add username api adapter * chore: adjust topic channel icon * chore: move developer mode to advanced setting * chore: add lark icon * fix: detail style * fix: token check logic * fix: encrpted risk * fix: vercel function appId * chore: remove webhook mode for discord * chore: add doc link * chore: add channel docs * chore: remove unused import * fix: create bot with wrong platform * chore: update intergration to channel * fix: udpate variable import * fix: tsgo error * chore: optimize webhook url trim * chore: update copy text * fix: telegram webhook not set * chore: add persist logic * docs: update feishu doc * chore: update feishu and lark tenant * chore: update docs * chore: make verfication code required * chore: update feishu docs * chore: update verfication comment * chore: update docs permission list * chore: verificationToken optional * chore: update feishu and lark color * chore: use test id |
||
|
|
43578a9bcc |
📝 docs: Polishing and improving product documentation (#12612)
* 🔖 chore(release): release version v2.1.34 [skip ci] * 📝 docs: Polish documents * 📝 docs: Fix typo * 📝 docs: Update start * 📝 docs: Fix style * 📝 docs: Update start * 📝 docs: Update layout * 📝 docs: Fix typo * 📝 docs: Fix typo --------- Co-authored-by: lobehubbot <i@lobehub.com> |
||
|
|
687b36c81c |
♻️ refactor: migrate frontend from Next.js App Router to Vite SPA (#12404)
* init plan
* 📝 docs: update SPA plan for dev mode Worker cross-origin handling
- Clarified the handling of Worker cross-origin issues in dev mode, emphasizing the need for `workerPatch` to wrap cross-origin URLs as blob URLs.
- Enhanced the explanation of the dev mode's resource URL rewriting process for better understanding.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 refactor: Phase 1 - 环境变量整治
- Fix Pyodide env var mismatch (NEXT_PUBLIC_PYPI_INDEX_URL → pythonEnv.NEXT_PUBLIC_PYODIDE_PIP_INDEX_URL)
- Consolidate python.ts to use pythonEnv instead of direct process.env
- Remove NEXT_PUBLIC_ prefix from server-side MARKET_BASE_URL (5 files)
* 🏗️ chore: Phase 2 - Vite 工程搭建
- Add vite.config.ts with dual build (desktop/mobile via MOBILE env)
- Add index.html SPA template with __SERVER_CONFIG__ placeholder
- Add entry.desktop.tsx and entry.mobile.tsx SPA entry points
- Add dev:spa, dev:spa:mobile, build:spa, build:spa:copy scripts
- Install @vitejs/plugin-react and linkedom
* ♻️ refactor: Phase 3 - 第一方包 Next.js 解耦
- Replace next/link with <a> in builtin-tool-web-browsing (4 files, external links)
- Replace next/image with <img> in builtin-tool-agent-builder/InstallPlugin.tsx
- Add Vite import.meta.env compat for isDesktop in const/version.ts, builtin-tool-gtd, builtin-tool-group-management
* ♻️ refactor: Phase 4a - Auth 页面改用直接 next/navigation 和 next/link
- 9 auth files: @/libs/next/navigation → next/navigation
- 5 auth files: @/libs/next/Link → next/link
- Auth pages remain in Next.js App Router, need direct Next.js imports
* ♻️ refactor: Phase 4b - Next.js 抽象层替换为 react-router-dom/vanilla React
- navigation.ts: useRouter/usePathname/useSearchParams/useParams → react-router-dom
- navigation.ts: redirect/notFound → custom error throws
- navigation.ts: useServerInsertedHTML → no-op for SPA
- Link.tsx: next/link → react-router-dom Link adapter (href→to, external→<a>)
- Image.tsx: next/image → <img> wrapper with fill/style support
- dynamic.tsx: next/dynamic → React.lazy + Suspense wrapper
* ✨ feat: Phase 5 - 新建 SPAGlobalProvider
- Create SPAServerConfig type (analyticsConfig, clientEnv, theme, featureFlags, locale)
- Add window.__SERVER_CONFIG__ and __MOBILE__ to global.d.ts
- Create SPAGlobalProvider (client-only Provider tree mirroring GlobalProvider)
- Includes AuthProvider for user session support
- Update entry.desktop.tsx and entry.mobile.tsx to wrap with SPAGlobalProvider
* ♻️ refactor: add SPA catch-all route handler with Vite dev proxy
- Create (spa)/[[...path]]/route.ts for serving SPA HTML
- Dev mode: proxy Vite dev server, rewrite asset URLs, inject Worker patch
- Prod mode: read pre-built HTML templates
- Build SPAServerConfig with analytics, theme, clientEnv, featureFlags
- Update middleware to pass SPA routes through to catch-all
* ♻️ refactor: skip auth checks for SPA routes in middleware
SPA pages are all public (no sensitive data in HTML).
Auth is handled client-side by SPAGlobalProvider's AuthProvider.
Only Next.js auth routes and API endpoints go through session checks.
* ♻️ refactor: replace Next.js-specific analytics with vanilla JS
- Google.tsx: replace @next/third-parties/google with direct gtag script
- ReactScan.tsx: replace react-scan/monitoring/next with generic script
- Desktop.tsx: replace next/script with native script injection
* ♻️ refactor: migrate @t3-oss/env-nextjs to @t3-oss/env-core
Replace framework-specific env validation with framework-agnostic version.
Add clientPrefix where client schemas exist.
* ♻️ refactor: replace next-mdx-remote/rsc with react-markdown
Use client-side react-markdown for MDX rendering instead of
Next.js RSC-dependent next-mdx-remote.
* 🔧 chore: update build scripts and Dockerfile for SPA integration
- build:docker now includes SPA build + copy steps
- dev defaults to Vite SPA, dev:next for Next.js backend
- Dockerfile copies public/spa/ assets for production
- Add public/spa/ to .gitignore (build artifact)
* 🗑️ chore: remove old Next.js route segment files and serwist PWA
- Delete [variants] page.tsx, error.tsx, not-found.tsx, loading.tsx
- Delete root loading.tsx and empty [[...path]] directory
- Delete unused loaders directory
- Remove @serwist/next PWA wrapper from Next.js config
* plan2
* ✨ feat: add locale detection script to index.html for SPA dev mode
* ♻️ refactor: remove locale and theme from SPAServerConfig
* ✨ feat: add [locale] segment with force-static and SEO meta generation
* ♻️ refactor: remove theme/locale reads from SPAGlobalProvider
* ✨ feat: set vite base to /spa/ for production builds
* ✨ feat: auto-generate spaHtmlTemplates from vite build output
* 🔧 chore: register dev:next task in turbo.json for parallel dev startup
* ♻️ refactor: rename (spa) route group to spa segment, rewrite SPA routes via middleware
* ✨ feat: add Vite-compatible i18n/locale modules with import.meta.glob and resolve aliases
* 🔧 fix: use custom Vite plugin for module redirects instead of resolve.alias
* very important
* build
* 🔧 chore: update build scripts and clean up Vite configuration by removing unused plugin and code
Signed-off-by: Innei <tukon479@gmail.com>
* 🗑️ refactor: remove all electron modifier scripts
Modifiers are no longer needed with Vite SPA renderer build.
* ✨ feat: add Vite renderer entry to electron-vite config
Add renderer build configuration to electron-vite, replacing the old
Next.js shadow workspace build flow. Delete buildNextApp.mts and
moveNextExports.ts, update package.json scripts accordingly.
* ✨ feat: add .desktop suffix files for eager i18n loading
Create 4 .desktop files that use import.meta.glob({ eager: true })
for synchronous locale access in Electron desktop builds, replacing
the async lazy-loading used in web SPA builds.
* 🔧 refactor: adapt Electron main process for Vite renderer
Replace nextExportDir with rendererDir, update protocol from
app://next to app://renderer, simplify file resolution to SPA
fallback pattern, update _next/ asset paths to /assets/.
* 🔧 chore: update electron-builder files config for Vite renderer
Replace dist/next references with dist/renderer, remove Next.js
specific exclusion rules no longer applicable to Vite output.
* 🗑️ chore: remove @ast-grep/napi dependency
No longer needed after removing electron modifier scripts.
* 🔧 refactor: unify isDesktop to __ELECTRON__ compile-time constant
Remove NEXT_PUBLIC_IS_DESKTOP_APP and VITE_IS_DESKTOP_APP env vars.
Unify isDesktop in @lobechat/const using __ELECTRON__ defined by Vite.
Re-export from builtin-tool packages. Scripts use DESKTOP_BUILD.
* update
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 refactor: use electron-vite ELECTRON_RENDERER_URL instead of hardcoded port 3015
Replace hardcoded http://localhost:3015 with process.env.ELECTRON_RENDERER_URL
injected by electron-vite dev server. Clean up stale Next.js references.
* 🐛 fix: use local renderer-entry shim to resolve Vite root path issue
HTML entry ../../src/entry.desktop.tsx resolves to /src/entry.desktop.tsx
in URL space, which Vite cannot find within apps/desktop/ root. Add a
local shim that imports across root via module resolver instead.
* 🔧 refactor: extract shared renderer Vite config into sharedRendererConfig
Deduplicate plugins (nodeModuleStub, platformResolve, tsconfigPaths) and
define (__MOBILE__, __ELECTRON__, process.env) between root vite.config.ts
and electron.vite.config.ts renderer section.
* 🔧 refactor: move all renderer plugins and optimizeDeps into shared config
sharedRendererPlugins now includes react, codeInspectorPlugin alongside
nodeModuleStub, platformResolve, tsconfigPaths. Add sharedOptimizeDeps
for pre-bundling list. Both root and electron configs consume shared only.
* 🐛 fix: set electron renderer root to monorepo root for correct glob resolution
import.meta.glob with absolute paths (e.g. /node_modules/antd/...) resolved
within apps/desktop/ instead of monorepo root. Change renderer root to ROOT_DIR,
add electronDesktopHtmlPlugin middleware to rewrite / to /apps/desktop/index.html,
and remove the now-unnecessary renderer-entry.ts shim.
* desktop vite !!
Signed-off-by: Innei <tukon479@gmail.com>
* sync import !!
Signed-off-by: Innei <tukon479@gmail.com>
* clean ci!!
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 refactor: update SPA path structure and clean up dependencies
- Changed the path in .gitignore and related files from [locale] to [variants] for SPA templates.
- Updated index.html to set body height to 100%.
- Cleaned up package.json by removing unused dependencies and reorganizing devDependencies.
- Refactored RendererUrlManager to use a constant for SPA entry HTML path.
- Removed obsolete route.ts file from the SPA structure.
- Adjusted proxy configuration to reflect the new SPA path structure.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: update build script to include mobile SPA build
- Modified the build script in package.json to add the mobile SPA build step.
- Ensured the build process accommodates both desktop and mobile SPA versions.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: update build scripts and improve file encoding consistency
- Modified the build script in package.json to ensure the SPA copy step runs after the build.
- Updated file encoding in generateSpaTemplates.mts from 'utf-8' to 'utf8' for consistency.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 fix: correct Blob import syntax and update global server config type
- Fixed the Blob import syntax in route.ts to ensure proper module loading.
- Updated the global server configuration type in global.d.ts for improved type safety.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 test: update RendererUrlManager test to reflect new file path
- Modified the mock implementation in RendererUrlManager.test.ts to check for the updated file path '/mock/export/out/apps/desktop/index.html'.
- Adjusted the expected resolved path in the test to match the new structure.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 refactor: remove catch-all example file and update imports
- Deleted the catch-all example file `catch-all.eg.ts` to streamline the codebase.
- Updated import paths in `ClientResponsiveLayout.tsx` and `ClientResponsiveContent/index.tsx` to use the new dynamic import location.
- Added type declarations for HTML templates in `spaHtmlTemplates.d.ts`.
- Adjusted `tsconfig.json` to include the updated file structure.
- Enhanced type definitions in `global.d.ts` and fixed locale loading in `locale.vite.ts`.
Signed-off-by: Innei <tukon479@gmail.com>
* e2e
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: remove unused build script for Vercel deployment
- Deleted the `build:vercel` script from package.json to streamline the build process.
- Ensured the remaining build scripts are organized and relevant.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 config: update Vite build input for mobile support
- Changed the build input path in vite.config.ts to conditionally use 'index.mobile.html' for mobile builds, enhancing support for mobile SPA versions.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 feat: add compatibility checks for import maps and cascade layers
- Implemented functions to check for browser support of import maps and CSS cascade layers.
- Redirected users to a compatibility page if their browser does not support the required features.
- Updated the build script in package.json to use the experimental analyze command for better performance.
Signed-off-by: Innei <tukon479@gmail.com>
* chore: rename
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 feat: refactor authentication layout and introduce global providers
- Created a new `RootLayout` component to streamline the layout structure.
- Removed the old layout file for variants and integrated necessary features into the new layout.
- Added `AuthGlobalProvider` to manage authentication context and server configurations.
- Introduced language and theme selection components for enhanced user experience.
- Updated various components to utilize the new context and improve modularity.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 config: exclude build artifacts from serverless functions
- Updated the `next.config.ts` to exclude SPA, desktop, and mobile build artifacts from serverless functions.
- Added paths for `public/spa/**`, `dist/**`, `apps/desktop/build/**`, and `packages/database/migrations/**` to the exclusion list.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 config: refine exclusion of build artifacts from serverless functions
- Updated `next.config.ts` to specify exclusion paths for desktop and mobile build artifacts.
- Changed exclusions from `dist/**` and `apps/desktop/build/**` to `dist/desktop/**`, `dist/mobile/**`, and `apps/desktop/**` for better clarity and organization.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 fix: update BrowserRouter basename for local development
- Modified the `ClientRouter` component to conditionally set the `basename` of `BrowserRouter` based on the `__DEBUG_PROXY__` variable, improving local development experience.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 feat: implement mobile SPA workflow and S3 asset management
- Added a new workflow for building and uploading mobile SPA assets to S3, including environment variable configurations in `.env.example`.
- Updated `package.json` to include a new script for the mobile SPA workflow.
- Enhanced the Vite configuration to support dynamic CDN base paths.
- Refactored the template generation script to handle mobile HTML templates more effectively.
- Introduced new modules for uploading assets to S3 and generating mobile HTML templates.
Signed-off-by: Innei <tukon479@gmail.com>
* 🐛 fix: extract origin from MOBILE_S3_PUBLIC_DOMAIN to prevent double key prefix
* 🔧 fix: update mobile HTML template to use the latest asset versions
- Modified the mobile HTML template to reference the updated JavaScript asset version for improved functionality.
- Ensured consistency in the template structure while maintaining existing styles and scripts.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: update dependencies and refine service worker integration
- Removed outdated dependencies related to Serwist from package.json and tsconfig.json.
- Added vite-plugin-pwa to enhance PWA capabilities in the Vite configuration.
- Updated service worker registration logic in the PWA installation component.
- Introduced a new local development proxy route for debugging purposes.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: refactor development scripts and remove Turbo configuration
- Updated the `dev` script in `package.json` to use a new startup sequence script for improved development workflow.
- Removed the outdated `turbo.json` configuration file as it is no longer needed.
- Introduced `devStartupSequence.mts` to manage the startup of Next.js and Vite processes concurrently.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 feat: update entry points and introduce debug proxy for local development
- Changed the main entry point in `index.html` from `entry.desktop.tsx` to `entry.web.tsx` for improved web compatibility.
- Added an `initialize.ts` file to enable `immer`'s `enableMapSet` functionality.
- Introduced a new `__DEBUG_PROXY__` variable in global types to support local development proxy features.
- Implemented a debug proxy route to facilitate local development with dynamic HTML injection and script handling.
- Removed outdated mobile routing components to streamline the codebase.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 refactor: replace BrowserRouter with RouterProvider for improved routing
- Updated entry points for desktop, mobile, and web to utilize RouterProvider and createAppRouter for better routing management.
- Removed the deprecated renderRoutes function in favor of a more streamlined router configuration.
- Enhanced router setup to support error boundaries and dynamic routing.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 refactor: remove direct access handling for SPA routes in proxy configuration
- Eliminated the handling of direct access to pre-rendered SPA pages in the proxy configuration.
- Simplified the request processing logic by removing checks for SPA routes, streamlining the middleware response flow.
Signed-off-by: Innei <tukon479@gmail.com>
* update
* 🔧 refactor: enhance Worker instantiation logic in mobile HTML template
* 🐛 fix: remove duplicate waitForPageWorkspaceReady calls in page CRUD e2e steps
* 🔧 refactor: simplify createTracePayload function by using btoa for base64 encoding
* 🔧 refactor: specify locales in import.meta.glob for dayjs and antd
* 🔧 refactor: replace Node.js Buffer with web-compatible btoa for base64 encoding in file upload
* 🐛 fix: disable consistent-type-imports rule for mdx files to prevent eslint crash
* 🔧 refactor: add height style to root div for consistent layout
* 🔧 refactor: replace btoa with Buffer for base64 encoding in trace and file upload handling
* 🔧 refactor: extract nextjsOnlyRoutes to a separate file for better organization
* 🔧 refactor: enable Immer MapSet plugin in tests for better state management
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 refactor: integrate sharedRollupOutput configuration and increase cache size for better performance
Signed-off-by: Innei <tukon479@gmail.com>
* 🗑️ chore: remove obsolete desktop.routes.test.ts file as it is no longer needed
Signed-off-by: Innei <tukon479@gmail.com>
* 🐛 fix: use cross-env for env vars in npm scripts (Windows CI)
Co-authored-by: Cursor <cursoragent@cursor.com>
* 🔧 chore: update Dockerfile for web-only build and adjust npm scripts to use pnpm
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: enhance Dockerfile prebuild process with environment checks and add new dependencies
- Updated Dockerfile to include environment checks before removing desktop-only code.
- Added new dependencies in package.json: @aws-sdk/client-bedrock-runtime, @opentelemetry/auto-instrumentations-node, @opentelemetry/resources, @opentelemetry/sdk-metrics, and ajv.
- Configured Rollup to exclude @aws-sdk/client-bedrock-runtime from the SPA bundle.
- Introduced dockerPrebuild.mts script for environment variable validation and information logging.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: enhance Vite and Electron configurations with environment loading and trace encoding improvements
- Updated Vite and Electron configurations to load environment variables using loadEnv.
- Modified trace encoding in utils to use TextEncoder for better compatibility.
- Adjusted sharedRendererConfig to expose only necessary public environment variables.
Signed-off-by: Innei <tukon479@gmail.com>
* 🗑️ chore: remove plans directory (migrated to discussion)
* ♻️ refactor: inject NEXT_PUBLIC_* env per key in Vite define
Co-authored-by: Cursor <cursoragent@cursor.com>
* ✨ feat: add loading screen with animation to enhance user experience
- Introduced a loading screen with a brand logo and animations for better visual feedback during loading times.
- Implemented CSS styles for the loading screen and animations in index.html.
- Removed the loading screen from the DOM once the layout is ready using useLayoutEffect in SPAGlobalProvider.
Signed-off-by: Innei <tukon479@gmail.com>
* 🗑️ chore: remove unnecessary external dependency from Vite configuration
- Eliminated the external dependency '@aws-sdk/client-bedrock-runtime' from the Vite configuration to streamline the build process for the SPA bundle.
Signed-off-by: Innei <tukon479@gmail.com>
* ✨ feat: add web app manifest link in index.html and enable PWA support in Vite configuration
- Added a link to the web app manifest in index.html to enhance PWA capabilities.
- Enabled manifest support in Vite configuration for improved service worker functionality.
Signed-off-by: Innei <tukon479@gmail.com>
* 🔧 chore: update link rel attributes for improved SEO and consistency
- Modified link rel attributes in multiple components to remove 'noreferrer' and standardize to 'nofollow'.
- Adjusted imports in PageContent components for better organization.
Signed-off-by: Innei <tukon479@gmail.com>
* update provider
* ✨ feat: enhance loading experience and update package dependencies
- Added a loading screen with animations and a brand logo in index.html for improved user feedback during loading times.
- Introduced CSS styles for the loading screen and animations.
- Updated package.json files across multiple packages to include "@lobechat/const" as a dependency.
Signed-off-by: Innei <tukon479@gmail.com>
* fix: update proxy
Signed-off-by: Innei <tukon479@gmail.com>
* 🗑️ chore: remove GlobalLayout and Locale components
- Deleted GlobalLayout and Locale components from the GlobalProvider directory to streamline the codebase.
- This removal is part of a refactor to simplify the layout structure and improve maintainability.
Signed-off-by: Innei <tukon479@gmail.com>
* chore: clean up console logs and improve component structure
- Removed unnecessary console log statements from AgentForkTag components in both agent and community directories to enhance code cleanliness.
- Refactored UserAgentList component for better readability by restructuring the useUserDetailContext hook and adjusting the layout of Flexbox components.
Signed-off-by: Innei <tukon479@gmail.com>
* chore: remove console log from MemoryAnalysis component
* chore: update mobile HTML template with new asset links
- Replaced the previous asset links in the mobile HTML template with updated versions to ensure the latest resources are utilized.
- Adjusted the link rel attributes for module preloading to enhance performance and loading efficiency.
Signed-off-by: Innei <tukon479@gmail.com>
* fix: correct variable assignment in createClientTaskThread integration test
- Updated the assignment of the second parent message in the createClientTaskThread integration test to improve clarity and ensure proper data handling.
- Changed the variable name from 'secondParentMsg' to 'inserted' for better context before extracting the first message from the inserted results.
Signed-off-by: Innei <tukon479@gmail.com>
* refactor: simplify authentication check in define-config
- Removed the dependency on the isDesktop variable in the authentication check to streamline the logic.
- Enhanced the clarity of the redirection process for protected routes by focusing solely on the isLoggedIn status.
Signed-off-by: Innei <tukon479@gmail.com>
* ✨ feat(dev): enhance local development setup with debug proxy instructions
- Added detailed instructions for starting the development environment in CLAUDE.md, including commands for SPA and full-stack modes.
- Updated README.md and README.zh-CN.md to reflect new commands and the debug proxy URL for local development.
- Introduced a Vite plugin to print the debug proxy URL upon server start, facilitating easier local development against the production backend.
- Corrected the debug proxy route in entry.web.tsx and define-config.ts for consistency.
This improves the developer experience by providing clear guidance and tools for local development.
Signed-off-by: Innei <tukon479@gmail.com>
* optimize perf
* optimize perf
* optimize perf
* remove speedy plugin
* add dayjs vendor
* Revert "remove speedy plugin"
This reverts commit
|
||
|
|
b3e87f6cd4 |
♻️ refactor: replace per-item Editing components with singleton EditingPopover (#12327)
* ♻️ refactor: replace per-item Editing components with singleton EditingPopover Eliminate 3 duplicate Editing components (AgentItem, AgentGroupItem, Group) in favor of a single imperative EditingPopover using @lobehub/ui Popover atoms. Anchor elements are passed via React state (useState + callback ref) instead of DOM queries. Removes agentRenamingId/groupRenamingId from homeStore. * fix: edit group agent avaar Signed-off-by: Innei <tukon479@gmail.com> * ✅ test(e2e): update rename popover selectors and allow console in tests Support both antd Popover and @lobehub/ui Popover atoms selectors. Use save button click instead of click-outside for non-Enter rename flow. Disable no-console rule for e2e and test files. * ✅ test(e2e): fix rename popover input detection with data-testid Add data-testid="editing-popover" to PopoverPopup. Simplify inputNewName to use single combined selector instead of sequential try-catch loop that caused 8s+ timeout. Support both @lobehub/ui and antd Popover. --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
d2a042cd95 |
🐛 fix: scroll ChatInput into view when starter mode activates (#12334)
* 🐛 fix: scroll ChatInput into view when starter mode activates When clicking Create Agent/Group/Write, the SuggestQuestions panel renders below the ChatInput and pushes total content beyond the viewport, causing the ChatInput to scroll out of view. This adds scrollIntoView + focus on mode change so the editor stays visible and ready for input. Also improves E2E test to target contenteditable inside ChatInput directly and wait for animation to settle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * update --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
2bf0a08919 |
✨ feat: support model detail dropdown (#12275)
* feat: support model detail dropdown # Conflicts: # src/features/ChatInput/ActionBar/Model/index.tsx * chore: fix test cases * fix: type error * fix: e2e tests |
||
|
|
6c342525e9 |
✨ feat: add write starter and fix e2e tests (#11992)
* feat: add write document and image create starter * chore: update doc starter e2e tests * chore: remove image stater form home input * chore: move model header to actionbar extra place * test: fix e2e test |
||
|
|
338df4baf9 |
📝 docs: Update src directory structure to be more comprehensive (#12016)
* update e2e test * 📝 docs: Update src directory structure to be more comprehensive - Add missing directories: business, const, envs, helpers, tools - Add missing root files: auth.ts, instrumentation.ts, instrumentation.node.ts, proxy.ts - Update descriptions to be more accurate - Sync changes across English and Chinese documentation Fixes #9521 |
||
|
|
42339cd6d0 |
✅ test: fix e2e issue (#11761)
fix selector |
||
|
|
1eff8646f7 | ✨ feat: remove NextAuth (#11732) | ||
|
|
395595a2c8 | ✨ feat: remove Clerk authentication code (#11711) | ||
|
|
d450dd9742 |
🐛 fix: improve e2e server and complete i18n resources (#11678)
- Refactor webServer.ts with better process coordination and lock file mechanism - Add mock S3 env vars to prevent initialization errors - Complete missing i18n translations across all locales |
||
|
|
5074fbef2c |
♻️ refactor: optimize lobehub models and default configuration (#11621)
* ♻️ refactor: use COPYRIGHT constant from branding config * ♻️ refactor: optimize default model configuration - Switch default provider from OpenAI to Anthropic - Add DEFAULT_MINI_MODEL and DEFAULT_MINI_PROVIDER for lightweight tasks - Use mini model for system agent tasks: generationTopic, topic, translation, queryRewrite - Use mini model for memory extraction agents - Reorder provider list: Anthropic/Google first, local solutions last * ♻️ refactor: split lobehub models into organized folder structure - Split large lobehub.ts (1316 lines) into lobehub/ folder - Organize chat models by provider (openai, anthropic, google, etc.) - Separate image models and utils into dedicated files * ♻️ refactor: use SOCIAL_URL constant and fix button alignment in auth-error page * ✨ feat: add MiniMax M2.1 and M2.1 Lightning models * ♻️ refactor: remove 'enabled' property from image model configurations in lobehub * ♻️ refactor: add COPYRIGHT_FULL constant and fix Discord icon visibility * ✅ test: update snapshots for default provider changes * ✅ test: fix snapshot provider values for CI environment * 🐛 fix(e2e): intercept all LLM providers in mock instead of only OpenAI The default provider was changed from openai to anthropic, but the LLM mock only intercepted /webapi/chat/openai requests. Now it intercepts all providers. |
||
|
|
560f5de026 |
✅ test: fix e2e community (#11622)
* fix community * improve * fix pwa entry |
||
|
|
7f004c5baf |
♻️ refactor: change the /community/assistant to /agent routes (#11606)
* refactor: change the /community/assistant to /agent routes * fix: slove the group detail page go back error * fix: update the e2e test |