Commit Graph

953 Commits

Author SHA1 Message Date
akumatus
862a9d0bc4 feat: use footnote for perplexity search results (#9851)
Support issue [BS-2475](https://linear.app/affine-design/issue/BS-2475).

![截屏2025-01-22 16.49.25.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/49febcdf-e403-4a2e-ba99-da36df34e08c.png)
2025-01-22 10:54:01 +00:00
pengx17
defb0de4dd feat(core): reorg workspace settings (#9718)
fix AF-2118
2025-01-22 03:11:27 +00:00
L-Sun
29995e498a feat(editor): add start-with-ai button for empty doc (#9836)
Close [BS-2391](https://linear.app/affine-design/issue/BS-2391/bs-ai-toolbar-空状态下添加-actions-列表)

https://github.com/user-attachments/assets/cbded517-2d3d-4a75-b144-644e2b03f68a
2025-01-21 16:00:49 +00:00
L-Sun
16d4430ec9 test(editor): move tests of toc to affine (#9833) 2025-01-21 13:34:59 +00:00
pengx17
2d09c7fe0c chore(electron): increase retry times (#9814) 2025-01-21 10:47:22 +00:00
Flrande
b6a8d644f8 test(editor): add tests for heading toggle (#9820) 2025-01-21 09:35:33 +00:00
L-Sun
7400cf225f refactor(editor): highlight selected cards of TOC based on signal (#9807)
Close [BS-2314](https://linear.app/affine-design/issue/BS-2314/添加打开toc时,将note-block-高亮), [BS-1868](https://linear.app/affine-design/issue/BS-1868/toc-里面-note之间顺序可拖动性,在page和edgeless里面是不同的,这个是设计的行为么?)

This PR refactor the highlight logic of note cards of TOC panel:
- notes block selected in edgeless note
- notes block covered by text or block selection in page mode
- note cards selected in TOC for dragging

Other changes:
- remove not used codes
- add tests for highlight note cards
2025-01-21 07:50:57 +00:00
donteatfriedrice
f995f216bd fix(editor): inline latex editor should not be shown when doc is readonly (#9794)
[BS-2442](https://linear.app/affine-design/issue/BS-2442/只读时-inline-latex-node-点击不应该弹出-modal)
2025-01-20 15:44:07 +00:00
forehalo
cb53baca89 fix(electron): export and import (#9767) 2025-01-20 08:48:03 +00:00
zzj3720
2e18ae59e3 refactor(editor): do not create a tag column by default anymore (#9789)
close: BS-2423
2025-01-20 06:59:10 +00:00
L-Sun
6ba802fb17 feat(editor): append note to page button (#9762)
Close [BS-2310](https://linear.app/affine-design/issue/BS-2310/note-display-in-page-%E7%9A%84%E8%A1%8C%E4%B8%BA), [BS-2312](https://linear.app/affine-design/issue/BS-2312/edgeless-note-%E7%9A%84-element-toolbar-%E6%B7%BB%E5%8A%A0display-in-page%E6%8C%89%E9%92%AE) and [BS-2313](https://linear.app/affine-design/issue/BS-2313/添加display-in-page的toast提示,以及打开toc的按钮)
2025-01-19 08:35:02 +00:00
CatsJuice
f8abe997f5 fix(core): open template doc on sidebar template entrance (#9766)
close AF-2135, AF-2136, AF-2138, AF-2133
2025-01-18 16:44:05 +00:00
fundon
7436c139ab fix(core): improve doc title and icon display (#9755)
Closes: [AF-2132](https://linear.app/affine-design/issue/AF-2132/优化-emoji-title-和-icon-显示)
2025-01-18 17:29:15 +08:00
akumatus
d048ac6c91 feat(core): support chat panel chips and suggest current doc for embedding (#9747)
Support issue [BS-2347](https://linear.app/affine-design/issue/BS-2347).

## What Changed?
- Add chat panel components
  - `chat-panel-chips`
  - `chat-panel-doc-chip`
  - `chat-panel-file-chip`
  - `chat-panel-chip`
- Add `chips` and `docs` field in `ChatContextValue`
- Add `extractMarkdownFromDoc` function to extract markdown content of a doc
- Add e2e test

Click a candidate card to add it into AI chat context:
<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/4e6b11ef-f993-4e6a-9f40-b2826af1990c.mov">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/4e6b11ef-f993-4e6a-9f40-b2826af1990c.mov">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/4e6b11ef-f993-4e6a-9f40-b2826af1990c.mov">录屏2025-01-17 01.02.04.mov</video>
2025-01-18 08:35:19 +00:00
L-Sun
d8727c2001 fix(editor): close embed edit modal on editor unmount (#9765)
Close [BS-2436](https://linear.app/affine-design/issue/BS-2436/should-close-embed-card-edit-modal-after-editor-unmount)

### What Changes:
- fix(editor): close embed edit modal on editor unmount
- test(editor): add test to embed edit modal when switching mode
2025-01-17 11:53:09 +00:00
EYHN
a2ffdb4047 feat(core): new worker workspace engine (#9257) 2025-01-16 16:22:18 +00:00
pengx17
7dc470e7ea feat(core): add new bs dnd adapter (#9717) 2025-01-16 13:54:50 +00:00
doouding
99717196c5 refactor: rewrite blocksuite dnd (#9595)
### Changed

- Refactored BlockSuite drag-and-drop using @atlaskit/pragmatic-drag-and-drop/element/adapter.
- Updated block dragging to use the new drag-and-drop infrastructure.

### BlockSuite DND API

Access the BlockSuite drag-and-drop API via `std.dnd`. This is a lightweight wrapper around pragmatic-drag-and-drop, offering convenient generic types and more intuitive option names.

#### Drag payload structure
There's some constrain about drag payload. The whole drag payload looks like this:

```typescript
type DragPayload = {
  entity: {
    type: string
  },
  from: {
    at: 'blocksuite',
    docId: string
  }
}
```
- The `from` field is auto-generated—no need for manual handling.
- The `entity` field is customizable, but it must include a `type`.

All drag-and-drop methods accept a generic type for entity, ensuring more accurate payloads in event handlers.

```typescript
type BlockEntity = {
  type: 'blocks',
  blockIds: string[]
}

dnd.draggable<BlockEntity>({
  element: someElement,
  setDragData: () => {
    // the return type must satisfy the generic type
    // in this case, it's BlockEntity
    return {
      type: 'blocks',
      blockIds: []
    }
  }
});

dnd.monitor<BlockEntity>({
  // the arguments is same for other event handler
  onDrag({ source }) {
    // the type of this is BlockEntity
    source.data.entity
  }
})
```

#### Drop payload
When hover on droppable target. You can set drop payload as well. All drag-and-drop methods accept a second generic type for drop payload.

The drop payload is customizable. Additionally, the DND system will add an `edge` field to the final payload object, indicating the nearest edge of the drop target relative to the current drag position.

```typescript
type DropPayload = {
  blockId: string;
}

dnd.dropTarget<BlockEntity, DropPayload>({
  getData() {
    // the type should be DropPayload
    return {
      blockId: 'someId'
    }
  }
});

dnd.monitor<BlockEntity, DropPayload>({
  // drag over on drop target
  onDrag({ location }) {
    const target = location.current.dropTargets[0];

    // the type is DropPayload
    target.data;
    // retrieve the nearest edge of the drop target relative to the current drop position.
    target.data.edge;
  }
})
```
2025-01-16 12:36:58 +00:00
L-Sun
969ac30874 fix(editor): reactive heading icon (#9729)
Close [BS-2407](https://linear.app/affine-design/issue/BS-2407/[bug]-edgeless-里选中-title-后更改,hint-没有改变)
2025-01-16 08:32:15 +00:00
CatsJuice
ad86292f45 test(core): add basic tests for template doc setting (#9702)
close AF-2112, AF-2114, AF-2115
2025-01-16 02:28:29 +00:00
pengx17
b1896746f9 refactor(core): move setting dialog to workspace scope (#9706) 2025-01-15 13:00:06 +00:00
L-Sun
94c9717a35 feat(editor): edgeless page block toolbar (#9707)
Close [BS-2315](https://linear.app/affine-design/issue/BS-2315/page-block-header)

### What Changes
- Add header toolbar to page block (the first note in canvas)
- Add e2e tests
- Add some edgeless e2e test utils.  **The package `@blocksuite/affine` was added to `"@affine-test/kit"`**
2025-01-15 12:04:44 +00:00
fundon
0b2d11e6b1 fix(editor): text highlighting (#9708) 2025-01-15 10:57:27 +00:00
pengx17
0bce5c6730 feat(core): remove workspace selectors in settings (#9705)
fix AF-2119
2025-01-15 07:37:25 +00:00
akumatus
c8e550138d fix(core): add ai send button test (#9685) 2025-01-14 10:06:31 +00:00
forehalo
e418465c0c test: playwright cloud import prisma (#9677) 2025-01-14 09:31:23 +00:00
CatsJuice
10196f6785 feat(core): new template doc property (#9538)
close AF-2045, AF-2047, AF-2065
2025-01-14 02:10:33 +00:00
zzj3720
c016f8e37e feat(editor): support linked-doc in rich-text column (#9634)
close: BS-2345
2025-01-10 14:43:40 +00:00
akumatus
2f49c064eb feat(editor): remove chat-cards and Open AI Chat menu item (#9626)
Support issue [BS-2353](https://linear.app/affine-design/issue/BS-2353).

### What changed?
- Remove `Open AI Chat` menu item.
- Remove `chat-cards` web component.
- Add `extractAll` function for page and edgeless doc full content extract.
2025-01-10 03:53:11 +00:00
zzj3720
8e8058a44c feat(editor): support pasting Excel data into database block (#9618)
close: BS-2338
2025-01-09 14:35:19 +00:00
Saul-Mirone
126ab18967 feat(editor): selection as store extension (#9605) 2025-01-09 11:49:23 +00:00
pengx17
c0ed78dc66 fix(core): split view should only be dragged by the handle (#9610)
fix BS-2354
also fix AF-2096
2025-01-09 10:40:25 +00:00
pengx17
f78857bb11 feat(editor): add more open doc options to editor toolbar (#9588)
fix AF-2036, AF-2092
2025-01-09 08:04:21 +00:00
akumatus
58ce86533e feat(core): support ai network search (#9357)
### What Changed?
- Add `PerplexityProvider` in backend.
- Update session prompt name if user toggle network search mode in chat panel.
- Add experimental flag for AI network search feature.
- Add unit tests and e2e tests.

Search results are streamed and appear word for word:

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/56f6ec7b-4b21-405f-9612-43e083f6fb84.mov">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/56f6ec7b-4b21-405f-9612-43e083f6fb84.mov">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/56f6ec7b-4b21-405f-9612-43e083f6fb84.mov">录屏2024-12-27 18.58.40.mov</video>

Click the little globe icon to manually turn on/off Internet search:
<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/778f1406-bf29-498e-a90d-7dad813392d1.mov">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/778f1406-bf29-498e-a90d-7dad813392d1.mov">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/778f1406-bf29-498e-a90d-7dad813392d1.mov">录屏2024-12-27 19.01.16.mov</video>

When there is an image, it will automatically switch to the openai model:

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/56431d8e-75e1-4d84-ab4a-b6636042cc6a.mov">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/56431d8e-75e1-4d84-ab4a-b6636042cc6a.mov">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/56431d8e-75e1-4d84-ab4a-b6636042cc6a.mov">录屏2024-12-27 19.02.13.mov</video>
2025-01-09 04:00:59 +00:00
pengx17
a4841bbfa3 feat(core): drop doc onto split view (#9487)
fix AF-2068, AF-2069, AF-1175, AF-2061, AF-2079, AF-2034, AF-2080, AF-1960, AF-2081

1. replace `dnd-kit` with `@atlaskit/pragmatic-drag-and-drop`
2. allow creating split views by drag & drop the following
   a. WorkbenchLinks (route links), like journals, trash, all docs
   b. doc refs
   c. tags/collection
3. style adjustments to split view
4. remove split view's feature flag and make it GA for electron

https://github.com/user-attachments/assets/6a3e4a25-faa2-4215-8eb0-983f44db6e8c
2025-01-08 05:05:33 +00:00
forehalo
c0ed74dfed chore: standardize tsconfig (#9568) 2025-01-08 04:07:56 +00:00
fundon
69e73af2a8 refactor(editor): add native clipboard extension (#9502)
Closes: [BS-2239](https://linear.app/affine-design/issue/BS-2239/不应该通过window注入affine的api)
2025-01-06 15:36:43 +00:00
donteatfriedrice
09c7a597be fix(core): should focus when clicking sidebar button (#9339) 2025-01-06 04:09:01 +00:00
Saul-Mirone
8b6c81f76d refactor(editor): reduce dependency to doc collection (#9492) 2025-01-03 01:59:25 +00:00
liuyi
43adb85e7d fix(core): wrong fetch injected to snapshot downloader (#9460) 2024-12-31 08:51:19 +00:00
fundon
569e63377d fix(core): should sync name after renaming in pdf embed view (#9398)
https://github.com/user-attachments/assets/f6a3d7b8-9ae3-4d8f-833f-d7aca1e0fffa
2024-12-30 09:56:02 +00:00
forehalo
12542f51f9 chore: bump base version to 0.19.0 2024-12-28 00:27:50 +08:00
fundon
6fcdd015aa fix(component): lit portal not re-rendering in inline links case (#9321)
* uses `portal.key` in templates
* updates `portal.id`  for use in queries
2024-12-27 15:43:13 +08:00
forehalo
8de0679d70 Revert "fix(core): make all docs journal judgement reactive (#9290)"
This reverts commit 727f21d78f.
2024-12-27 14:21:59 +08:00
liuyi
0af46c966d chore(tools): add package selector to dev command (#9328) 2024-12-26 12:34:17 +00:00
CatsJuice
727f21d78f fix(core): make all docs journal judgement reactive (#9290) 2024-12-25 01:41:16 +00:00
liuyi
2443935830 chore: add monorepo tools (#9196) 2024-12-24 15:29:48 +08:00
darkskygit
475e3d80b2 fix(server): vague initial chat content in test (#9267) 2024-12-24 04:26:52 +00:00
CatsJuice
3a8d90d861 feat(mobile): use native select for mobile setting (#9236)
![CleanShot 2024-12-21 at 12.01.32.gif](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/LakojjjzZNf6ogjOVwKE/8f29afcc-3541-4081-9f8f-f74e3ba08c4d.gif)
2024-12-24 03:24:51 +00:00
Saul-Mirone
e13f9d3885 feat: enable new dnd flag (#9194) 2024-12-18 05:53:08 +00:00