Commit Graph

300 Commits

Author SHA1 Message Date
akumatus 6ff19ca307 feat(core): hybird search for docs, tags and collections (#11008)
Close [BS-2466](https://linear.app/affine-design/issue/BS-2466).

![截屏2025-03-19 18.25.38.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/15ba2b7d-2d91-408a-8e7d-93f845017bcb.png)
2025-03-20 08:21:25 +00:00
zzj3720 c355644d47 fix(editor): some bugs of attachment column (#11031)
fix: BS-2838, BS-2837, BS-2836
2025-03-20 07:48:26 +00:00
JimmFly d47bb64597 feat(core): add no access to share menu (#10927) 2025-03-20 07:31:11 +00:00
akumatus bd5d930490 feat(core): document search shows up to three results (#11002)
Close [BS-2828](https://linear.app/affine-design/issue/BS-2828).

![截屏2025-03-19 17.49.11.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/9548afcc-5707-435f-93b2-25e42fddc97f.png)
2025-03-20 06:55:56 +00:00
yoyoyohamapi 8cfdc48b57 refactor(core): ai message style (#10950)
### TL;DR
Refactor style of AI chat message

> CLOSE AF-2338, AF-2328, AF-2327

### What Changed
* Adjust style of chat action message
* Adjust style of chat error message
* Refactor style of chat message box
2025-03-20 06:39:27 +00:00
yoyoyohamapi 99491eb3c5 refactor(core): reorganize chat-panel components (#10935)
### TL;DR
Split complex chat message component into smaller, reusable units with ​finer granularity

> CLOSE AF-2323 AF-2326

### What Changed
* Split messages into components:
  * `<chat-message-assistant />`
  * `<chat-message-user />`
  * `<chat-message-action />`
* Split message content into types:
  * `<chat-content-images />`
  * `<chat-content-rich-text />`
  * `<chat-content-pure-text />`
2025-03-20 06:39:27 +00:00
yoyoyohamapi 5aa36efab0 refactor(core): simplify chat panel user message rendering (#10910)
### TL;DR
Refactor style of  user chat message

> CLOSE AF-2323 AF-2324 AF-2325

### What Changed
* Refactor style of user message.
* Refactor style of image message.
2025-03-20 04:59:10 +00:00
fundon 8b995ea420 chore(editor): remove edgeless element toolbar (#10900) 2025-03-20 02:08:21 +00:00
fundon 831f290f84 refactor(editor): edgeless toolbar chevron down icon (#10898) 2025-03-20 02:08:20 +00:00
fundon ccc210f88a refactor(core): edgeless toolbar ai action config extension (#10884) 2025-03-20 02:08:19 +00:00
fundon ac705c724e refactor(editor): edgeless toolbar linked doc custom config extension (#10883) 2025-03-20 02:08:19 +00:00
fundon 07a64eb004 refactor(editor): edgeless toolbar lock and unlock actions (#10878) 2025-03-20 02:08:16 +00:00
akumatus ee337a16af feat(core): support collection search for ai chat (#10987)
Close [BS-2787](https://linear.app/affine-design/issue/BS-2787).
Close [BS-2788](https://linear.app/affine-design/issue/BS-2788).

![截屏2025-03-19 14.15.54.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/573450f9-791b-4cd9-9c75-df93bf9966b4.png)
2025-03-20 00:34:12 +00:00
Saul-Mirone 1c6a876e6a refactor(editor): improve config extension (#11006) 2025-03-19 13:38:10 +00:00
Saul-Mirone c1e16aeaa7 refactor(editor): remove paragraph service (#11003) 2025-03-19 13:38:09 +00:00
fundon e686a6aecc refactor(editor): edgeless internal embed card toolbar config extension (#10717) 2025-03-19 12:34:17 +00:00
yoyoyohamapi afc4158f47 refactor(core): separate rendering logic for user and assistant messages (#10909)
### TL;DR

Separate rendering logic for user and assistant messages.

> CLOSE AF-2323

### What Changed
- Rendering user message with `<chat-panel-message-user />` component.
- Rendering assistant message with `<chat-panel-message-assistant />` Component
2025-03-19 10:28:56 +00:00
akumatus 47206b8d47 feat(core): support tag search for ai chat (#10965)
Close [BS-2785](https://linear.app/affine-design/issue/BS-2785).
Close [BS-2786](https://linear.app/affine-design/issue/BS-2786).

![截屏2025-03-18 21.22.34.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/fae7216a-0402-4f14-a63c-b89f5223fc72.png)
2025-03-19 04:22:11 +00:00
akumatus b470eafd55 feat(core): add keyboard event listener to ai popover (#10952)
Close [BS-2827](https://linear.app/affine-design/issue/BS-2827).
2025-03-19 04:22:10 +00:00
akumatus efe7e1d527 feat(core): add tags and collections menu item (#10951)
Close [BS-2827](https://linear.app/affine-design/issue/BS-2827).

![截屏2025-03-18 15.22.02.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/18a3cdc1-e0dd-46e6-a113-e9e1ae27c98d.png)
2025-03-19 04:22:09 +00:00
fundon 7f4b56e05c refactor(editor): edgeless external embed card toolbar config extension (#10712) 2025-03-19 04:05:36 +00:00
pengx17 a118cbd036 fix(editor): chat panel text render link preview base url (#10791)
fix AF-2322
2025-03-19 03:19:09 +00:00
fundon d8567e669a refactor(editor): edgeless bookmark toolbar config extension (#10711) 2025-03-19 02:24:26 +00:00
fundon 3cce147c60 refactor(editor): improve query methods in toolbar context (#10714) 2025-03-19 00:52:22 +00:00
fundon cb37d25d7b refactor(editor): edgeless element toolbar with new pattern (#10511) 2025-03-18 15:36:25 +00:00
zzj3720 3939cc1c52 feat(editor): support file column and member column for database block (#10932)
close: BS-2630, BS-2631, BS-2629, BS-2632, BS-2635
2025-03-18 14:51:45 +00:00
Saul-Mirone 321e3449ec fix(editor): block can be null in widget (#10959)
Closes: [BS-2826](https://linear.app/affine-design/issue/BS-2826/typeerror-thisblock-is-null)
2025-03-18 10:58:19 +00:00
pengx17 a016630a82 feat(electron): create recording through tray (#10526)
- added tray menu for controlling recording status
- recording watcher for monitoring system audio input events
2025-03-18 04:12:30 +00:00
akumatus 05329e96c7 fix(core): add timeout params to graphql request options (#10919)
Close [BS-2813](https://linear.app/affine-design/issue/BS-2813).
2025-03-18 03:53:47 +00:00
Saul-Mirone 3de7d85eea feat(editor): improve api for store, and add docs (#10941) 2025-03-17 16:30:59 +00:00
akumatus 363c9799f3 fix(core): chat-panel ui (#10928)
Close [AF-2332](https://linear.app/affine-design/issue/AF-2332).
Close [AF-2333](https://linear.app/affine-design/issue/AF-2333).
2025-03-17 10:53:55 +00:00
EYHN b401012d85 feat(core): user service loading state (#10922) 2025-03-17 09:28:25 +00:00
Saul-Mirone 8bd4125c96 feat(editor): enable block meta for code, image, list block (#10905) 2025-03-17 03:29:51 +00:00
L-Sun c1301be1f5 fix(editor): repeat instantiation of std (#10896) 2025-03-17 01:04:51 +00:00
Saul-Mirone 26285f7dcb feat(editor): unify block props api (#10888)
Closes: [BS-2707](https://linear.app/affine-design/issue/BS-2707/统一使用props获取和更新block-prop)
2025-03-16 05:48:34 +00:00
L-Sun 3b4453d2b8 chore(editor): update default width of page block (#10873)
Close [BS-2498](https://linear.app/affine-design/issue/BS-2498/page-block首次切换时默认宽度为800px)
2025-03-14 12:59:17 +00:00
akumatus a648edafc0 feat(core): display embedding progress (#10871)
Close [BS-2791](https://linear.app/affine-design/issue/BS-2791).
2025-03-14 11:58:29 +00:00
yoyoyohamapi 4a1a557a9e refactor(web): save as doc & save as block action (#10833)
### TL;DR

Added "Save as doc" option to Edgeless editor actions.

### What changed?

- Renamed `SAVE_CHAT_TO_BLOCK_ACTION` to `SAVE_AS_BLOCK` and updated its title from "Save chat to block" to "Save as block"
- Renamed `CREATE_AS_DOC` to `SAVE_AS_DOC` and updated its title from "Create as a doc" to "Save as doc"
- Added `SAVE_AS_DOC` to the `EdgelessEditorActions` array, making this option available in the Edgeless editor
2025-03-14 09:01:31 +00:00
yoyoyohamapi 1258f47d70 refactor(web): insert blew action (#10722)
### TL;DR
Refactor the insert below functionality to work with page mode and edgeless mode
* Page Mode
  - Insert content below the current selection
  - If nothing selected, insert content below the last block
* EdgeLess Mode
  - If no note block is currently selected, create the content as a new note block.
  - Otherwise, insert content into the selected note

Close BS-2760

### What changed?
- Created separate insert handlers for page and edgeless modes with context-aware behavior
  - Added support for inserting content when nothing is selected by targeting the last content block
  - Added special handling for edgeless mode to support inserting below selected note blocks
- Removed the "Replace selection" action and consolidated insert functionality
- Optimized the clickable area of the action button
2025-03-14 09:01:31 +00:00
akumatus 1546b76337 feat(core): poll context docs and files embedding status (#10843)
Close [BS-2791](https://linear.app/affine-design/issue/BS-2791).

### What Changed?
- Add status filed to `CopilotContextDoc` to querying document embedding processing progress.
- Change `ChipState` from `success` to `finished` to better align with backend server status.
- Add `pollContextDocsAndFiles` API for embedding status polling.

### About Polling
- Set the minimum interval to 1 second and the maximum interval to 30 seconds
- Use exponential backoff and increase the interval by 50% after each poll
- Make sure the interval does not exceed the maximum
2025-03-14 08:44:55 +00:00
darkskygit c31d01b2c2 chore(server): merge duplicate queries (#10857) 2025-03-14 08:02:12 +00:00
Saul-Mirone b8452f56a8 feat(editor): block painter extension (#10847) 2025-03-14 05:26:58 +00:00
doodlewind be9f44fc4f fix(editor): worker loading in webpack env (#10832)
### TL;DR

Created dedicated worker entry points to avoid dynamic imports.

### What changed?

- Painters are provided during worker initialization
- Removed `ParagraphPaintConfigExtension` and the associated configuration system
- Created dedicated worker entry points in both the integration test and frontend packages
- Modified `ViewportLayoutPainter` to accept painters in its constructor
- Updated the `TurboRendererConfig` interface to require a `painterWorkerEntry` function

### Why make this change?

Webpack support. Extension objects in main thread are not available to be passed into workers. Dynamic painter path import is hard to support in webpack environment. With the [webpack-ignore](https://webpack.js.org/api/module-methods/#webpackignore) rule, there are still build errors in webpack.
2025-03-14 05:26:57 +00:00
akumatus daccb2c865 feat(core): add ai file context api (#10842)
Close [BS-2349](https://linear.app/affine-design/issue/BS-2349).

### What Changed?
- Add file context graphql apis
- Pass matched file chunks to LLM

[录屏2025-02-19 23.27.47.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/8e8a98ca-6959-4bb6-9759-b51d97cede49.mov" />](https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/8e8a98ca-6959-4bb6-9759-b51d97cede49.mov)
2025-03-14 04:29:54 +00:00
darkskygit d8373f66e7 feat(server): context awareness for copilot (#9611)
fix PD-2167
fix PD-2169
fix PD-2190
2025-03-13 11:44:55 +00:00
Saul-Mirone 05f3069efd feat(editor): add i18n support for block meta display (#10831) 2025-03-13 11:28:56 +00:00
L-Sun 7ba1c1b271 chore(editor): use at menu to insert linked doc (#10808)
Close [BS-2799](https://linear.app/affine-design/issue/BS-2799/区分linked-doc入口)

This PR removes the patch for `Linked Doc` action in the slash menu via the `QuickSearch`, reverting it to use the at menu for inserting.
2025-03-13 08:01:59 +00:00
Saul-Mirone 7f45993fdb feat(editor): add ui for display block meta in toolbar (#10817) 2025-03-13 07:06:27 +00:00
doodlewind c023b724d0 refactor(editor): generic layout type support for turbo renderer (#10766)
This PR refactored the turbo renderer architecture to support multiple block layout types.

- New base class `BlockLayoutPainter` and `BlockLayoutProvider` are introduced for writing extendable per-block layout querying and painting logic.
- Paragraph-specific lines are all moved into dedicated classes (`ParagraphLayoutProvider` and `ParagraphLayoutPainter`) under the `/variants/paragraph` dir.
- The `renderer-utils.ts` doesn't contain paragraph-specific logic now.
- The `text-utils.ts` is also now scoped for paragraph only.
- Worker messages are now strongly typed.

Upcoming PR should further implement the block registration system using extension API. The `variants` dir could still exist, since there will be similar rendering logic that can be reused among block types (i.e., between paragraph block and list block).
2025-03-13 05:18:12 +00:00
akumatus 21d850deeb feat(core): add tag-chip and collection-chip lit components (#10795)
Close [BS-2790](https://linear.app/affine-design/issue/BS-2790).

![截屏2025-03-12 19.45.48.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/d95834a1-e7e4-4655-8bf6-2ee50b4d3701.png)
2025-03-13 04:26:58 +00:00