cherry-studio/.yarn/patches
SuYao a6182eaf85
Refactor/inputbar (#10332)
* Refactor inputbar system with configurable scope-based architecture

- **Implement scope-based configuration** for chat, agent sessions, and mini-window with feature toggles
- **Add tool registry system** with dependency injection for modular inputbar tools
- **Create shared state management** via InputbarToolsProvider for consistent state handling
- **Migrate existing tools** to registry-based definitions with proper scope filtering

The changes introduce a flexible inputbar architecture that supports different use cases through scope-based configuration while maintaining feature parity and improving code organization.

* Remove unused import and refactor tool rendering

- Delete obsolete '@renderer/pages/home/Inputbar/tools' import from Inputbar.tsx
- Extract ToolButton component to render tools outside useMemo dependency cycle
- Store tool definitions in config for deferred rendering with current context
- Fix potential stale closure issues in tool rendering by rebuilding context on each render

* Wrap ToolButton in React.memo and optimize quick panel menu updates

- Memoize ToolButton component to prevent unnecessary re-renders when tool key remains unchanged
- Replace direct menu state updates with version-based triggering to batch registry changes
- Add useEffect to consolidate menu updates and reduce redundant flat operations

* chore style

* refactor(InputbarToolsProvider): simplify quick panel menu update logic

* Improve QuickPanel behavior and input handling

- Default select first item when panel symbol changes to enhance user experience
- Add Tab key support for selecting template variables in input field
- Refactor QuickPanel trigger logic with better symbol tracking and boundary checks
- Fix typo in translation key for model selection menu item

* Refactor import statements to use type-only imports

- Convert inline type imports to explicit type imports in Inputbar.tsx and types.ts
- Replace combined type/value imports with separate type imports in InputbarToolsProvider and tools
- Remove unnecessary menu version state and effect in InputbarToolsProvider

* Refactor InputbarTools context to separate state and dispatch concerns

- Split single context into separate state and dispatch contexts to optimize re-renders
- Introduce derived state for `couldMentionNotVisionModel` based on file types
- Encapsulate Quick Panel API in stable object with memoized functions
- Add internal dispatch context for Inputbar-specific state setters

* Refactor Inputbar to use split context hooks and optimize QuickPanel

- Replace monolithic `useInputbarTools` with separate state, dispatch, and internal dispatch hooks
- Move text state from context to local component state in InputbarInner
- Optimize QuickPanel trigger registration to use ref pattern, avoiding frequent re-registrations

* Refactor QuickPanel API to separate concerns between tools and inputbar

- Split QuickPanel API into `toolsRegistry` for tool registration and `triggers` for inputbar triggering
- Remove unused QuickPanel state variables and clean up dependencies
- Update tool context to use new API structure with proper type safety

* Optimize the state management of QuickPanel and Inputbar, add text update functionality, and improve the tool registration logic.

* chore

* Add reusable React hooks and InputbarCore component for chat input

- Create `useInputText`, `useKeyboardHandler`, and `useTextareaResize` hooks for text management, keyboard shortcuts, and auto-resizing
- Implement `InputbarCore` component with modular toolbar sections, drag-drop support, and textarea customization
- Add `useFileDragDrop` and `usePasteHandler` hooks for file uploads and paste handling with type filtering

* Refactor Inputbar to use custom hooks for text and textarea management

- Replace manual text state with useInputText hook for text management and empty state
- Replace textarea resize logic with useTextareaResize hook for automatic height adjustment
- Add comprehensive refactoring documentation with usage examples and guidelines

* Refactor inputbar drag-drop and paste handling into custom hooks

- Extract paste handling logic into usePasteHandler hook
- Extract drag-drop file handling into useFileDragDrop hook
- Remove inline drag-drop state and handlers, use hook interfaces
- Clean up dependencies and callback optimizations

* Refactor Inputbar component to use InputbarCore composition

- Extract complex UI logic into InputbarCore component for better separation of concerns
- Remove intermediate wrapper component and action ref forwarding pattern
- Consolidate focus/blur handlers and simplify component structure

* Refactor Inputbar to expose actions via ref for external control

- Extract action handlers into ProviderActionHandlers interface and expose via ref
- Split component into Inputbar wrapper and InputbarInner implementation
- Update useEffect to sync inner component actions with ref for external access

* feat: inputbar core

* refactor: Update QuickPanel integration across various tools

* refactor: migrate to antd

* chore: format

* fix: clean code

* clean code

* fix i18n

* fix: i18n

* relative path

* model type

* 🤖 Weekly Automated Update: Nov 09, 2025 (#11209)

feat(bot): Weekly automated script run

Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Co-authored-by: SuYao <sy20010504@gmail.com>

* format

* fix

* fix: format

* use ripgrep

* update with input

* add common filters

* fix build issue

* format

* fix error

* smooth change

* adjust

* support listing dir

* keep list files when focus and blur

* support draft save

* Optimize the rendering logic of session messages and input bars, and simplify conditional judgments.

* Upgrade to agentId

* format

* 🐛 fix: force quick triggers for agent sessions

* revert

* fix migrate

* fix: filter

* fix: trigger

* chore packages

* feat: 添加过滤和排序功能,支持自定义函数

* fix cursor bug

* fix format

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: beyondkmp <beyondkmp@gmail.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-11-12 20:04:58 +08:00
..
@ai-sdk-google-npm-2.0.31-b0de047210.patch Refactor/inputbar (#10332) 2025-11-12 20:04:58 +08:00
@ai-sdk-huggingface-npm-0.0.8-d4d0aaac93.patch Chore/aisdk (#11232) 2025-11-11 00:09:26 +08:00
@ai-sdk-openai-npm-2.0.64-48f99f5bf3.patch Chore/aisdk (#11232) 2025-11-11 00:09:26 +08:00
@anthropic-ai-claude-agent-sdk-npm-0.1.30-b50a299674.patch Refactor/inputbar (#10332) 2025-11-12 20:04:58 +08:00
@anthropic-ai-vertex-sdk-npm-0.11.4-c19cb41edb.patch Feat/vertex-claude-support (#7564) 2025-07-24 23:46:32 +08:00
@google-genai-npm-1.0.1-e26f0f9af7.patch style: set eol to lf, code formatting (#7923) 2025-07-08 09:50:33 +08:00
@langchain-core-npm-1.0.2-183ef83fe4.patch Fix/azure embedding (#11044) 2025-11-01 01:52:16 +08:00
@langchain-openai-npm-1.0.0-474d0ad9d4.patch Fix/azure embedding (#11044) 2025-11-01 01:52:16 +08:00
@napi-rs-system-ocr-npm-1.0.2-59e7a78e8b.patch refactor: Improve linux build for system-ocr (#9775) 2025-09-02 12:59:14 +08:00
@tavily-core-npm-0.3.1-fe69bf2bea.patch chore: Update Tavily core package and remove js-tiktoken dependency 2025-02-23 11:01:30 +08:00
@tiptap-extension-drag-handle-npm-3.2.0-5a9ebff7c9.patch feat: add notes module (#8871) 2025-08-30 23:09:13 +08:00
antd-npm-5.27.0-aa91c36546.patch refactor: bump antd to 5.27.0, update Input.Password suffix (#9263) 2025-08-18 13:39:56 +08:00
app-builder-lib-npm-26.0.15-360e5b0476.patch fix: update app-builder-lib patch and adjust minimumSystemVersion handling (#7197) 2025-06-14 19:39:28 +08:00
atomically-npm-1.7.0-e742e5293b.patch chore(deps): update vite to rolldown-vite (#8460) 2025-07-25 00:55:07 +08:00
epub-npm-1.3.0-8325494ffe.patch patch epub: replace zipfile with zipread 2025-03-13 18:01:39 +08:00
file-stream-rotator-npm-0.6.1-eab45fb13d.patch chore(deps): update vite to rolldown-vite (#8460) 2025-07-25 00:55:07 +08:00
libsql-npm-0.4.7-444e260fb1.patch build: Add support for Windows ARM64 platform (#3431) 2025-04-06 09:35:08 +08:00
pdf-parse-npm-1.1.1-04a6109b2a.patch feat: knowledge base 2024-12-19 09:24:20 +08:00
pkce-challenge-npm-4.1.0-fbc51695a3.patch refactor: mcp service 2025-03-28 04:24:10 +08:00
tesseract.js-npm-6.0.1-2562a7e46d.patch feat: Image OCR (#9409) 2025-08-26 00:13:24 +08:00