Commit Graph

7478 Commits

Author SHA1 Message Date
fullex
eaae04060a refactor(renderer): fix env.d.ts global augmentation and drop dead window.store
The ImportMetaEnv/ImportMeta interfaces were declared at the top level of
this module (the file has top-level imports), so they were module-local
and never augmented the global types. Move ImportMetaEnv into the existing
declare global block so it merges with vite's global interface, and declare
the env vars actually read in the renderer (RENDERER_VITE_AIHUBMIX_SECRET,
RENDERER_VITE_PPIO_APP_SECRET) instead of the unused VITE_RENDERER_INTEGRATED_MODEL.

Drop window.store: v1 Redux residue with zero references after Redux removal.
2026-06-27 02:52:26 -07:00
fullex
fae1e5fe1b refactor(hooks-agent): rename agents/ dir to singular agent/
src/renderer/hooks/agents/ is a feature namespace grouping the agent
feature's hooks, not a collection of agents. Per naming conventions
§4.9 it should be singular, matching sibling namespaces hooks/chat/,
hooks/tab/, hooks/translate/.

- git mv src/renderer/hooks/agents -> src/renderer/hooks/agent
- update 62 import paths across 33 files
- clarify §4.9 so the plural `agents/` example is read by role
  (collection bucket vs feature namespace), not by the word
2026-06-27 02:33:59 -07:00
fullex
c49b19edef refactor(mini-apps): rename pages/mini-apps directory to camelCase miniApps
Subdirectories under the pages/ bucket are domain modules and must be
camelCase per naming-conventions.md section 4.5; the kebab-case
mini-apps was the only divergent one. Rename to pages/miniApps and
update the two route files and the test mock paths that referenced the
old path. Route URLs (/app/mini-app/...) are unchanged.
2026-06-27 02:28:50 -07:00
fullex
1065cd4dfd refactor(renderer-config): dissolve config bucket into owning domains
Reorganize src/renderer/config per renderer-architecture §8 so it holds only
app-global constants (constant.ts, env.ts).

- Delete v1 dead code: provider catalog, model defaults, embeddings/translate/
  webSearch presets, the mini-app catalog, and unused agent configs.
- Relocate live config to its owning domain: PROVIDER_URLS -> ProviderSettings,
  builtin MCP servers -> McpSettings, code providers -> code page, OCR ->
  FileProcessingSettings, message menu bar -> chat message frame.
- Sink model predicates (with modelReconcile/modelSearch) into utils/model with
  a curated named-export index; move tab/agent/sidebar helpers into utils.
- Split the sidebar icon map into the component layer (components/app/
  sidebarIcons) to remove the reverse config->component dependency, and drop
  the sidebar exports orphaned by #16413.
2026-06-27 02:20:44 -07:00
亢奋猫
1e1e6c3938 chore(renderer): remove unused renderer files (#16485)
Co-authored-by: SuYao <sy20010504@gmail.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-27 16:27:09 +08:00
槑囿脑袋
dc6626d064 fix(knowledge): stop the UI freeze when deleting a large folder and reclaim its disk space (#16447)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-06-27 16:24:10 +08:00
亢奋猫
d16e07ec19 fix(tabbar): replace active tab from sidebar navigation (#16413)
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-27 15:45:13 +08:00
槑囿脑袋
2d9bd5620c chore(gitignore): ignore Codex AGENTS.override.md local override file (#16481)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-06-27 14:00:26 +08:00
jd
ef2f3eec4c fix(paintings): improve generated image preview interactions (#16315)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Pleasurecruise <3196812536@qq.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-06-27 13:59:53 +08:00
fullex
32e8ef273c feat(window-manager): add declarative rememberBounds persistence
Migrate window-bounds persistence off the electron-window-state library into
a WindowManager built-in `rememberBounds` capability, backed by the main-process
persist cache (`window.bounds` key — its first real consumer).

- New `windowBoundsTracker` free-function module: validates the stored record
  (including displayBounds), restores onto the display the window was last on
  (clamping into its work area, never resetting to primary), and snapshots at
  teardown via getNormalBounds + isMaximized.
- Singleton-only gate (dev warning for non-singleton types). Runtime toggle
  `wm.setRememberBounds` (orthogonal to the registry flag; OFF drops only that
  type's slot) plus `wm.peekWindowBounds`.
- Persist at three teardown exits: native close (singletons), before
  window.destroy() in destroyWindow (programmatic destroys), and a new onStop
  so shutdown writes land before CacheService flushes its persist map.
- Wire Main + QuickAssistant. Main re-applies maximize consumer-side on its own
  show schedule (tray-on-launch defers to first show); remove electron-window-state
  and its orphaned keepers/constants/comments.

Fullscreen is not persisted and old *-state.json is not migrated (one-time
reset, loseable). Adds tracker/integration/persist tests, extends the main
CacheService mock with persist methods, and documents the capability plus a
breaking-change note.
2026-06-26 22:39:52 -07:00
SuYao
8544ee7fbc fix(file): use path handle for attachment metadata lookup (#16475)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-27 11:56:14 +08:00
亢奋猫
286c294383 Refine home composer layout and styling (#16474)
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-27 11:55:49 +08:00
fullex
eab541d5fc docs(renderer-architecture): clarify feature consumption, promotion, and same-kind rules
State the previously-implicit rules that produced "features is an isolated
island" misreadings, then tighten the result for concision:

- Make explicit that the app layer (windows/routes/pages) is a feature's
  only legal consumer (window/page -> feature are legal downward edges); a
  feature is isolated only horizontally, from sibling features.
- Add the same-kind-peering vs same-slice-isolation distinction
  (component -> component allowed; feature -> feature not) and note that a
  feature-internal piece follows identical type-axis rules as its top-level
  counterpart.
- Add a 4.1 Promotion Rule with an operational trigger and a
  chat -> features/chat worked example; fix the dangling 4.4 references.
- Add the DAG rationale for the two banned edges (shared -> feature,
  feature -> feature).
- Fix small inconsistencies: pages/ may depend on primitives; shared-layer
  order includes workers; disambiguate bare (4.8) -> (Naming Conventions
  4.8); reclassify transport/ as a cross-surface ai runtime (not
  chat-exclusive) bound for the shared services/ bucket.

Also clean up two dead command mocks targeting the non-existent
@renderer/features/command path: fix the stale path in TopicBranchPanel's
test so the mock intercepts the real @renderer/components/command import,
and drop the unused mock in GlobalSearchPanel's test.
2026-06-26 20:50:04 -07:00
fullex
15e569b992 feat(cache): align persist semantics across processes, tune debounce
Make the main-authoritative and renderer persist tiers express presence as
deviation from the schema default rather than backing-store membership, extend
the API symmetrically, and unify the debounced-write cadence.

- hasPersist now reports whether the effective value differs from the schema
  default (main + renderer). loadPersist/loadPersistCache seed every key, so the
  old Map-membership check was always true and carried no information.
- Add deletePersist (reset-to-default) on both tiers; delegates to setPersist so
  it inherits the same-value no-op, subscriber notify, and renderer cross-window
  broadcast.
- Add subscribePersistChange on the main tier for in-main consumers, mirroring
  subscribeChange (main-local, never relayed to renderers). setPersist now
  notifies persist subscribers on actual change.
- Align persist debounce to 350ms (main + renderer) and BootConfig save debounce
  to 350ms for more coalescing of paused/bursty writes; extract the renderer
  magic number into a named constant.
- Normalize CacheService comments to JSDoc on core methods and document the
  default-relative persist semantics; update cache-overview.md.
2026-06-26 19:10:53 -07:00
Kennyzheng
ff1ba44d8a fix(composer): show knowledge bases for empty assistant scope (#16456)
Co-authored-by: cherryai004 <cherryai004@cherryai004deMac-mini.local>
Signed-off-by: cherryai004 <cherryai004@cherryai004deMac-mini.local>
2026-06-27 01:37:54 +08:00
亢奋猫
542cb0244d refactor: improve custom mini app creation and editing (#16089)
Co-authored-by: fullex <0xfullex@gmail.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-27 01:36:52 +08:00
fullex
2dd0d7b8e1 feat(cache): add main-process persist cache tier
Add an independent, main-authoritative persist tier to the main-process
CacheService, stored as a JSON file at {userData}/cache.json. It is inline
(mirroring the renderer persist structure), fixed-keys-only, with no delete
or TTL; values are loseable and fall back to schema defaults on miss.

Writes are debounced (200ms) and flushed atomically (temp file + rename),
with a flush on service stop. Unknown/stale keys in the file are pruned on
load to keep the fixed-keys contract. The renderer persist IPC relay is
untouched: Main cannot read renderer persist and vice versa.

This phase is architecture-only: the schema ships a single scaffold key
(internal.persist_probe) and no business consumer; window-state and other
consumers will follow. Docs under docs/references/data and CLAUDE.md are
updated to distinguish the new Main persist store from the relay.
2026-06-26 09:51:04 -07:00
fullex
8753856223 refactor(renderer-context): dissolve context/ bucket by shape
The context/ directory was a by-kind bucket: React providers are
components, not their own layer. Dissolve it per renderer-architecture
section 8 by splitting each provider into its component (-> components/)
and its context object + accessor hooks (-> hooks/), mirroring the
existing command decomposition.

- ThemeProvider -> components/ThemeProvider.tsx + hooks/useTheme.ts
- CodeStyleProvider -> components/CodeStyleProvider.tsx + hooks/useCodeStyle.ts
- Tab behavior layer -> hooks/tab/ (useTabsContext, useCurrentTab,
  useTabSelfMetadata, useTabs, index); TabsProvider/TabIdProvider ->
  components/layout/
- Extract pure emoji-icon logic to utils/tabIcons.ts
- Remove dead TabsContextValue ops (hibernateTab/wakeTab/setTabs) and a
  stale ThemeProvider comment
- Repoint ~90 import sites and test mocks; migrate provider/hook tests
- Update routes README and renderer-architecture section 8
2026-06-26 09:45:17 -07:00
Gu JiaMing
0d87c5d9eb fix(stream-manager): drop empty text/reasoning parts before persisting (#16455)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-26 23:26:23 +08:00
fullex
43692625ee refactor(config-manager): delete orphaned ConfigManager and v1 residue
PR #16449 removed the last ConfigManager reads (GitBash + diagnose).
This deletes the now fully-orphaned ConfigManager service together with
its dead fallout: stale configManager comments in ipc.ts and
MainWindowService.ts, the obsolete ConfigManager test mock in
AppUpdaterService.test.ts, and the orphaned ZOOM_SHORTCUTS export.

electron-store is now used only by the v2 migration readers
(MigrationContext / MigrationEngine).
2026-06-26 08:25:01 -07:00
SuYao
b24317d2a4 refactor: remove final ConfigManager reads (GitBash + diagnose) and migrate Obsidian IPC to IpcApi (#16449)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-26 23:05:20 +08:00
fullex
4a911acad5 refactor(devtools): demote DevtoolsExtensionService to a core function
DevtoolsExtensionService was a lifecycle service in name only: it owned no long-lived resources and needed no cleanup, only running a one-shot dev-only side effect (installing React DevTools + the bundled DataApi DevTools) in onReady. Per the lifecycle decision guide that does not belong in lifecycle, and as business-agnostic dev tooling it does not belong under services/ either.

Move it to a pure function in core/devtools.ts (alongside core/diagnostics.ts, the existing dev-tooling precedent), gated by isDev, and invoke it from MainWindowService.onReady() before the main window opens. That matches Electron's contract (after app ready, before the first page loads), which the former Background phase did not guarantee.

Also switch the deprecated session.loadExtension to session.extensions.loadExtension, and lazy-import electron-devtools-installer (a devDependency whose module load calls app.getPath()) so it never reaches the production path.
2026-06-26 04:48:19 -07:00
亢奋猫
6799541fb7 feat(data-api): add devtools panel (#16414)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-26 18:50:26 +08:00
槑囿脑袋
af6db4fb25 fix(knowledge): refine data-source list layout and row actions (#16442)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-06-26 18:42:05 +08:00
Konv Suu
703990ba22 fix(obsidian-export): avoid duplicate vault scans (#15871)
Signed-off-by: Konv Suu <hi@kovsu.com>
2026-06-26 18:40:37 +08:00
亢奋猫
9ed91491c1 refactor(styling): remove styled-components usage (#16370)
Co-authored-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-26 18:40:12 +08:00
Gu JiaMing
148872c8ea fix(scheduled-tasks): improve settings panel layout and log navigation (#16403)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-26 18:38:57 +08:00
fullex
a507acfefb chore(deps): remove unused redux packages
The v1 Redux store was deleted, so @reduxjs/toolkit, react-redux, redux,
and redux-persist have no importers anywhere in the codebase. Drop them as
direct dependencies. redux/react-redux remain in the lockfile only as
transitive deps of @hello-pangea/dnd, which uses them internally.
2026-06-26 01:18:50 -07:00
fullex
ecffd880f0 refactor(store): delete the deprecated v1 Redux store
With ImportService migrated to DataApi (#16415), the v1 Redux store at
src/renderer/store/ has zero runtime consumers. Delete the directory (30
files) along with the already-stubbed main-process ReduxService bridge.

Clean up the now-stale residue:
- Remove dead vi.mock('@renderer/store') factories from 14 test files
  whose code under test no longer imports the store.
- Drop Redux from the CLAUDE.md "Removing" enumerations and refresh the
  renderer-architecture / knowledge-service / v2-todo docs.
- Fix dangling store/ references in the MiniAppMigrator and
  builtinMcpServers comments.

The v2 migration's Redux Persist readers (ReduxStateReader etc.) are left
untouched: they read serialized on-disk data, not this store.
2026-06-26 01:08:20 -07:00
亢奋猫
eb2622e9af refactor(ui): remove antd dependency (#16336)
Co-authored-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-26 15:49:22 +08:00
Pleasure1234
00f8bdaa86 refactor(import): migrate ImportService from Redux to DataApi (#16415)
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-06-26 15:34:04 +08:00
SuYao
408f07ff74 fix(code-block-view): lazy-load html artifact popup (#16428)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-26 15:23:56 +08:00
SuYao
2e7628f219 fix(selection-settings): defer user action modal data reads (#16427)
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-26 15:23:14 +08:00
Phantom
80381953da fix(github-actions): log translator parse failures (#16432)
Signed-off-by: icarus <eurfelux@gmail.com>
2026-06-26 15:22:31 +08:00
SuYao
2a8575e8ac fix(composer): use functional file appends (#16426)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-26 15:22:07 +08:00
SuYao
55f057c712 fix(ai-messages): normalize empty assistant turns + capability-gate media before model conversion (#16195) (#16206)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-26 15:21:01 +08:00
beyondkmp
611e21a2cb refactor(settings): move spell check to display & language section (#16433)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: beyondkmp <beyondkmp@gmail.com>
2026-06-26 15:19:50 +08:00
Pleasure1234
b6374b5a16 fix(reconcile): protect user-default models from deletion during pull-reconcile (#16395) 2026-06-26 10:42:33 +08:00
github-actions[bot]
0231645eff 🤖 Daily Auto I18N Sync: Jun 26, 2026 (#16430)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
2026-06-26 10:20:20 +08:00
fullex
7cc42c80a1 refactor(dexie): self-contain migration exporter and drop side-effect imports
Decouple consumers from the deprecated `@renderer/databases` schema module
as a step toward removing `src/renderer/databases`.

- DexieExporter: open the legacy `CherryStudio` IndexedDB in Dexie dynamic
  mode via a self-contained `new Dexie()` guarded by `Dexie.exists`, instead
  of importing the shared `db`. The v2 migration gate (`versionPolicy.ts`)
  only admits users from a final v1 release whose on-disk schema is already
  at its last version, so no Dexie upgrade hooks need to run before export.
- Remove the five bare `import '@renderer/databases'` side-effect imports
  (AppShell, MainApp, SubWindowApp, SubWindowAppShell, settings entryPoint);
  the db singleton is still instantiated by its direct importers.
- Comment out (keep) the disabled Dexie write-back in redux-persist migrator
  '34'; v2 never reads db.topics so the legacy store is no longer mutated.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-25 08:43:11 -07:00
亢奋猫
7609db7223 fix(openclaw): stabilize install and config sync (#16105)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-25 22:37:39 +08:00
亢奋猫
168aaa7216 feat(agents): route Claude Code models through API Gateway (#16399)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-25 22:37:05 +08:00
jd
bb4d3750c9 fix(chat-composer): polish file token previews (#16346)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-06-25 22:36:34 +08:00
Asurada
32393262f0 docs(skill-gh-pr-review): add platform, fork, routing, and cleanup guidance (#16359)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: ousugo <dkzyxh@gmail.com>
2026-06-25 22:35:47 +08:00
fullex
ec9e9bd324 refactor(store): drop the renderer Redux <Provider> mounts
With useCopilot removed in #16412, no renderer component reads the Redux store
via useSelector/useDispatch anymore, so the <Provider store={store}> wrappers in
the three window entry points (main / settings / subWindow) are dead. Remove
them along with their store and react-redux imports.

The store is no longer mounted in React. The only remaining renderer consumer is
ImportService, which dispatches to the store singleton directly (no Provider
needed); it is intentionally left untouched for now.
2026-06-25 06:48:53 -07:00
SuYao
5b6a27e44c refactor(copilot): drop useCopilot redux hook + fix model-list 401 (#16412)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-25 21:31:42 +08:00
SuYao
c13ece1ebb refactor(ai-ipc): migrate AI IPC to IpcApi + expose provider errors (#16369)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-25 21:26:42 +08:00
SuYao
e6f70f556f feat(paintings): rebuild prompt bar on the shared composer (#16326)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Pleasurecruise <3196812536@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-25 19:32:32 +08:00
fullex
02d84093ad refactor(store): isolate the renderer Redux store as a deprecated island
Stop renderer code outside src/renderer/store/ from importing the v1 Redux
store or any Redux tooling, so the store can later be deleted outright.

Migrate live consumers to v2:
- useSettings fields -> usePreference, then delete useSettings
- backup/nutstore sync status -> session-local, non-reactive holders inside
  Backup/NutstoreService; Nutstore config now reads Preference, not Redux

Remove dead consumers:
- useAwsBedrock, useVertexAi (no callers)
- the legacy websearch sync bridge (no Redux reader)
- the always-empty paintings delete guards
- prompt.ts {{model_name}} fallback to llm.defaultModel

Other:
- repoint nanoid imports from @reduxjs/toolkit to the nanoid package
- move the built-in MCP server catalog from store/mcp.ts to
  src/renderer/config (interim home; should move to the data layer in v2)
- drop all store/redux references from tests

The only remaining store consumers are tails marked @deprecated: useCopilot
(copilot auth state) and ImportService, plus the three window <Provider>
mounts they require.

FileAction was orphaned by the file-page rewrite in #15338 and is removed.
2026-06-25 04:20:27 -07:00
Phantom
e2f479d912 feat(files): wire file page to real data (#15338)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: icarus <eurfelux@gmail.com>
2026-06-25 18:09:59 +08:00