Commit Graph

1106 Commits

Author SHA1 Message Date
yoyoyohamapi
149433b8d0 fix(core): cannot focus inside shape in test (#11630) 2025-04-11 05:26:27 +00:00
doouding
714f2e79dc fix: cannot exit editing mode when click frame body (#11603) 2025-04-11 03:23:27 +00:00
Saul-Mirone
a2f879066f ci(editor): enable cross platform test (#11566) 2025-04-10 16:52:15 +00:00
L-Sun
823bf40a57 fix(editor): fix overlay of tool is not shown or repeated when switching tool (#11575)
Close [BS-3029](https://linear.app/affine-design/issue/BS-3029/frame-里面的-shape-没办法进入文本编辑模式)
Close [BS-3082](https://linear.app/affine-design/issue/BS-3082/按s切换至shape工具,在白板上点击会创建两个shape)
Close [BS-3091](https://linear.app/affine-design/issue/BS-3082/按s切换至shape工具,在白板上点击会创建两个shape)

## Fix Shape Tool Issues

This PR addresses several issues with the shape and mindmap tools functionality in the editor:

1. **Fix text editing after mode switching**: Resolves an issue where users couldn't edit text in shapes after switching editor modes. The fix ensures the edgeless block is properly retrieved when double-clicking on a shape.

2. **Improve tool switching behavior**: Fixes issues with tool overlays not showing or being repeated when switching between tools. This includes:
   - Properly handling tool overlay visibility
   - Ensuring only one tool is active at a time when using keyboard shortcuts
   - Adding proper cleanup when switching tools

3. **Add comprehensive tests**: Adds new test cases to verify:
   - Shape creation with keyboard shortcuts
   - Shape text editing after mode switching
   - Tool switching behavior with keyboard shortcuts
2025-04-10 13:39:22 +00:00
yoyoyohamapi
25418b402a fix(core): replace zero-width non-ioiner for editor content​ (#11591) 2025-04-10 11:55:31 +00:00
donteatfriedrice
dbb8451adb test(core): add e2e test for share page copy function (#11555)
related pr https://github.com/toeverything/AFFiNE/pull/11538
To close [BS-1915](https://linear.app/affine-design/issue/BS-1915/public-page-页面应该允许选中和复制内容)
2025-04-10 06:34:15 +00:00
donteatfriedrice
0302bd43cb fix(editor): should preserve indentation when pasting code with spaces into code block (#11587)
Close [BS-3087](https://linear.app/affine-design/issue/BS-3087/粘贴内容到-code-block-缩进会丢)
2025-04-10 04:48:08 +00:00
fundon
bb79781dd8 fix(editor): should clear selection when switching doc mode (#11545)
Closes: [BS-3050](https://linear.app/affine-design/issue/BS-3050/切换模式时,清除选区)
2025-04-10 03:10:50 +00:00
L-Sun
06497773a7 fix(editor): can not move carte at the end of inline element (#11558)
Close [BS-2922](https://linear.app/affine-design/issue/BS-2922/【移动端-ios】文档添加linked-page后,无法删除)
2025-04-09 08:07:02 +00:00
fundon
c57f41805f fix(editor): should auto close dropdown menus on toolbar (#11522)
Closes: [BS-2524](https://linear.app/affine-design/issue/BS-2524/切换-block-后,刷新-toolbar-时,应该自动关闭已经打开的-dropdown)
2025-04-09 01:29:44 +00:00
donteatfriedrice
e4e3d8ef59 fix(editor): paste to code block should delete selected text (#11546)
Close [BS-3064](https://linear.app/affine-design/issue/BS-3064/fix-bug-pasting-in-code-block-does-not-replace-text)
2025-04-08 12:37:36 +00:00
L-Sun
3820186512 fix(editor): incorrect brush bound with rotation and line width (#11524)
This transfered PR from [BS/#9058](https://github.com/toeverything/blocksuite/pull/9058) fixes an issue where the selection rectangle of a brush element was incorrect after resizing and rotating.
2025-04-08 10:48:12 +00:00
Saul-Mirone
780c35eabe fix(editor): prevent Tab key propagation outside editor (#11531)
Closes: BS-2964
2025-04-08 10:03:06 +00:00
donteatfriedrice
b8e7ca3214 test(editor): fix flaky embed iframe e2e test (#11530) 2025-04-08 08:37:12 +00:00
donteatfriedrice
43809838ef test(editor): add embed iframe block e2e tests (#11502)
Close [BS-2669](https://linear.app/affine-design/issue/BS-2669/iframe-embed-block-添加测试)
2025-04-07 09:43:36 +00:00
forehalo
40f218c898 chore: set base version to 0.21 2025-04-07 16:10:32 +08:00
fundon
8a13eca271 fix(editor): should focus on input of popover on toolbar (#11485)
Related to: https://github.com/toeverything/AFFiNE/pull/11429
2025-04-07 03:04:34 +00:00
Saul-Mirone
854569af2d refactor(editor): remove lasso tool (#11481) 2025-04-07 01:12:28 +00:00
CatsJuice
46d8d30e62 feat(editor): disable clickToDrag for edgeless toolbar shape and mindmap (#11310) 2025-04-04 05:10:05 +00:00
yoyoyohamapi
030af6f426 test(core): edgeless shape e2e (#11446)
### TL;DR

Add Edgeless shape ai e2e tests.

### What Changed

- Add Edgeless shape make it real e2e
- Add Edgeless shape generate image e2e
- Fix Edgeless generate headings e2e
2025-04-03 16:53:20 +00:00
akumatus
6cf182190c refactor(core): remove useless chat-input components (#11426)
Close [BS-2583](https://linear.app/affine-design/issue/BS-2583).
2025-04-03 14:53:50 +00:00
fundon
363476a46c fix(editor): add hoverable container for image and surface-ref (#11458)
Closes: [BS-3012](https://linear.app/affine-design/issue/BS-3012/hover-yuan素时冲突)
2025-04-03 13:43:55 +00:00
forehalo
c8d22d97d5 refactor: webpack config (#11421) 2025-04-03 11:55:56 +00:00
fundon
565d7b2b1e fix(editor): should not show inner toolbar of surface-ref in edgeless (#11453)
Closes: [BS-3015](https://linear.app/affine-design/issue/BS-3015/toolbar-有时会出现空状态且被显示) [BS-3023](https://linear.app/affine-design/issue/BS-3023/surface-ref-inner-toolbar-的标题圆角)
2025-04-03 11:13:09 +00:00
Saul-Mirone
773db7860a feat(editor): not sync selection from awareness (#11420) 2025-04-03 09:22:26 +00:00
fundon
a1500e3ee1 fix(editor): textarea not focusing in AI panel (#11429)
Closes: [BS-3006](https://linear.app/affine-design/issue/BS-3006/insider上面,圈选yuan素后,ad-hoc的ai对话框焦点控制有大问题(无法对焦,总是会跳走))
2025-04-03 03:27:26 +00:00
yoyoyohamapi
c61df18ab9 test(core): chat with collection & tags (#11388)
### TL:DR

* AI chat with collection E2E
* AI chat with tag E2E

> Close BS-3007
2025-04-03 02:46:08 +00:00
fundon
03dd073cb4 fix(editor): add recent open doc with mode button (#11419)
Closes: [BS-3013](https://linear.app/affine-design/issue/BS-3013/open-doc-分开两个按钮:一个快捷按钮和一个菜单)

Split into two buttons: `recent open doc with mode button` and `open doc with dropdown menu`.
2025-04-03 02:06:14 +00:00
Flrande
51b3f2b057 fix(editor): do not display format bar with embed node (#11371)
Close [BS-2895: 点击inline名字区域不需要显示format toolbar](https://linear.app/affine-design/issue/BS-2895/点击inline名字区域不需要显示format-toolbar)
2025-04-02 09:21:32 +00:00
doouding
ef76c83184 fix: connector should remain the same when its target or source switch to other
shape type (#11369)

Fixes [BS-1431](https://linear.app/affine-design/issue/BS-1431/改变-shape-形状后,connector-丢失)
2025-04-02 05:10:30 +00:00
fundon
d9fade8045 fix(core): should display date as original title of journal (#11375)
Closes: [BS-2991](https://linear.app/affine-design/issue/BS-2991/linked-journal添加alias后,toolbar上获取不到标题)
2025-04-02 01:24:43 +00:00
fundon
8427293d36 fix(core): fix target block cannot be reached when clicking affine-link multiple times (#10473)
Closes: [BS-2702](https://linear.app/affine-design/issue/BS-2702/超链接无法滚动到指定block)
2025-04-01 14:46:35 +00:00
fundon
f374f2695f fix(core): add shortcuts to open doc dropdown menu (#11358)
Closes: [BS-2992](https://linear.app/affine-design/issue/BS-2992/走查toolbar上的open-in-button)

[Screen Recording 2025-04-01 at 16.37.57.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/8ypiIKZXudF5a0tIgIzf/cf4b1baf-aa2c-4f37-9c62-f7202d0f7c42.mov" />](https://app.graphite.dev/media/video/8ypiIKZXudF5a0tIgIzf/cf4b1baf-aa2c-4f37-9c62-f7202d0f7c42.mov)
2025-04-01 12:39:13 +00:00
L-Sun
cad4dde4b1 fix(editor): missing doc mode extension in frame preview (#11348)
Close [BS-2777](https://linear.app/affine-design/issue/BS-2777/frame-preview里的embed-card展示的doc-mode不对)
2025-04-01 11:57:53 +00:00
fundon
7af5e53838 refactor(editor): image toolbar config extension (#11329)
Closes: [BS-2378](https://linear.app/affine-design/issue/BS-2378/image-toolbar-迁移)
2025-04-01 10:04:28 +00:00
L-Sun
e7f5601303 fix(editor): undo should remove the new frame created by dragging (#11303)
Close [BS-2848](https://linear.app/affine-design/issue/BS-2848/但我发现frame创建后,要撤销两次才能删掉)
2025-04-01 04:41:44 +00:00
renovate
1be83dc330 chore: bump up express version to v5 (#11333)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [express](https://expressjs.com/) ([source](https://redirect.github.com/expressjs/express)) | [`^4.21.2` -> `^5.0.0`](https://renovatebot.com/diffs/npm/express/4.21.2/5.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/express/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/express/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/express/4.21.2/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/express/4.21.2/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [@types/express](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express) ([source](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express)) | [`^4` -> `^5.0.0`](https://renovatebot.com/diffs/npm/@types%2fexpress/4.17.21/5.0.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fexpress/5.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fexpress/5.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fexpress/4.17.21/5.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fexpress/4.17.21/5.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>expressjs/express (express)</summary>

### [`v5.1.0`](https://redirect.github.com/expressjs/express/blob/HEAD/History.md#510--2025-03-31)

[Compare Source](https://redirect.github.com/expressjs/express/compare/5.0.1...v5.1.0)

\========================

-   Add support for `Uint8Array` in `res.send()`
-   Add support for ETag option in `res.sendFile()`
-   Add support for multiple links with the same rel in `res.links()`
-   Add funding field to package.json
-   perf: use loop for acceptParams
-   refactor: prefix built-in node module imports
-   deps: remove `setprototypeof`
-   deps: remove `safe-buffer`
-   deps: remove `utils-merge`
-   deps: remove `methods`
-   deps: remove `depd`
-   deps: `debug@^4.4.0`
-   deps: `body-parser@^2.2.0`
-   deps: `router@^2.2.0`
-   deps: `content-type@^1.0.5`
-   deps: `finalhandler@^2.1.0`
-   deps: `qs@^6.14.0`
-   deps: `server-static@2.2.0`
-   deps: `type-is@2.0.1`

### [`v5.0.1`](https://redirect.github.com/expressjs/express/blob/HEAD/History.md#501--2024-10-08)

[Compare Source](https://redirect.github.com/expressjs/express/compare/v5.0.0...5.0.1)

\==========

-   Update `cookie` semver lock to address [CVE-2024-47764](https://nvd.nist.gov/vuln/detail/CVE-2024-47764)

### [`v5.0.0`](https://redirect.github.com/expressjs/express/blob/HEAD/History.md#500--2024-09-10)

[Compare Source](https://redirect.github.com/expressjs/express/compare/4.21.2...v5.0.0)

\=========================

-   remove:
    -   `path-is-absolute` dependency - use `path.isAbsolute` instead
-   breaking:
    -   `res.status()` accepts only integers, and input must be greater than 99 and less than 1000
        -   will throw a `RangeError: Invalid status code: ${code}. Status code must be greater than 99 and less than 1000.` for inputs outside this range
        -   will throw a `TypeError: Invalid status code: ${code}. Status code must be an integer.` for non integer inputs
    -   deps: send@1.0.0
    -   `res.redirect('back')` and `res.location('back')` is no longer a supported magic string, explicitly use `req.get('Referrer') || '/'`.
-   change:
    -   `res.clearCookie` will ignore user provided `maxAge` and `expires` options
-   deps: cookie-signature@^1.2.1
-   deps: debug@4.3.6
-   deps: merge-descriptors@^2.0.0
-   deps: serve-static@^2.1.0
-   deps: qs@6.13.0
-   deps: accepts@^2.0.0
-   deps: mime-types@^3.0.0
    -   `application/javascript` => `text/javascript`
-   deps: type-is@^2.0.0
-   deps: content-disposition@^1.0.0
-   deps: finalhandler@^2.0.0
-   deps: fresh@^2.0.0
-   deps: body-parser@^2.0.1
-   deps: send@^1.1.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMDcuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIwNy4xIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
2025-04-01 02:24:11 +00:00
fundon
eac8f32f4c refactor(editor): basic styles of font and panel (#11290)
* Updated `border-radius` of panel to `8px`.  [BS-2901](https://linear.app/affine-design/issue/BS-2901/meta-info-ui-issue) [BS-2810](https://linear.app/affine-design/issue/BS-2810/toolbarpicker-圆角更新为-8px)
* Refactored basic styles of font and panel.

<img width="549" alt="Screenshot 2025-03-31 at 12 56 36" src="https://github.com/user-attachments/assets/4a827e1e-f802-4251-a563-4a34b891a5e3" />
2025-04-01 01:35:59 +00:00
Brooooooklyn
d31e0c0e71 ci: run some optimize on CI e2e (#11330) 2025-03-31 15:23:21 +00:00
L-Sun
c9e14ac0db fix(editor): sync gfx block transform update with RAF to prevent stale transform (#11322)
Close [BS-2866](https://linear.app/affine-design/issue/BS-2866/presentation-mode中的note消失)

## Problem
When using RequestAnimationFrame (RAF) for GFX block updates, there was a timing issue where the transform update would lag behind the RAF callback, causing the block to display with the previous frame's transform state.

## Solution
1. Refactored the block state management to use signals for better reactivity
2. Moved block visibility state management from `viewport-element.ts` to `gfx-block-component.ts`
3. Added `transformState$` signal to track block state
4. Synchronized transform updates with RAF using `effect` to ensure updates happen in the correct frame
5. Added test case to verify note visibility in presentation mode
2025-03-31 12:47:01 +00:00
L-Sun
fec698fd8b chore(editor): improve selection of doc in canvas (#11314)
Close [BS-2705](https://linear.app/affine-design/issue/BS-2705/[improvement]-通过-viability-control-选择-hide-in-edgeless)

This PR disabled selecting operation of notes that are only shown in page mode.
2025-03-31 12:35:02 +00:00
fundon
f1882061a2 fix(editor): should exit drawing tools menu when Escape is pressed (#11306)
Closes: [BS-2978](https://linear.app/affine-design/issue/BS-2978/二级菜单的激活状态错误) [BS-2977](https://linear.app/affine-design/issue/BS-2977/pen和highlighter没做esc)
2025-03-31 11:05:01 +00:00
Brooooooklyn
47a8d15878 ci: start devServer before test running to avoid tests timeout (#11297) 2025-03-31 10:39:34 +00:00
EYHN
baf1aad412 fix(core): fix flaky e2e test (#11308) 2025-03-31 09:10:54 +00:00
Fangdun Tsai
6850871bfb fix(editor): fix callout tests (#11301) 2025-03-31 08:37:20 +00:00
doouding
18cb4199fa fix: note should hide collapse button in presentation mode (#11292)
Fixes [BS-1003](https://linear.app/affine-design/issue/BS-1003/ppt-演示状态下-note-会显示折叠箭头)
2025-03-31 16:17:44 +08:00
EYHN
24c382d3aa feat(core): enable callout in canary (#11302) 2025-03-31 08:10:18 +00:00
Mirone
9f939d823e fix(editor): slash menu e2e (#11289) 2025-03-31 11:13:34 +08:00
yoyoyohamapi
317d3e7ea6 test(core): split and enhance copilot e2e tests (#11007)
### TL;DR

Split and enhance copilot e2e tests.

### What Changed

#### Tests Structure

The e2e tests are organized into the following categories:

1. **Basic Tests (`/basic`)**: Tests for verifying core AI capabilities including feature onboarding, authorization workflows, and basic chat interactions.
2. **Chat Interaction Tests (`/chat-with`)**: Tests for verifying the AI's interaction with various ​object types, such as attachments, images, text content, Edgeless elements, etc.
3. **AI Action Tests (`/ai-action`)**: Tests for verifying the AI's actions, such as text translation, gramma correction, etc.
4. **Insertion Tests (`/insertion`)**: Tests for verifying answer insertion functionality.

#### Tests Writing

Writing a copilot test cases is easier and clear

e.g.
```ts
test('support chat with specified doc', async ({ page, utils }) => {
  // Initialize the doc
  await focusDocTitle(page);
  await page.keyboard.insertText('Test Doc');
  await page.keyboard.press('Enter');
  await page.keyboard.insertText('EEee is a cute cat');

  await utils.chatPanel.chatWithDoc(page, 'Test Doc');

  await utils.chatPanel.makeChat(page, 'What is EEee?');
  await utils.chatPanel.waitForHistory(page, [
    {
      role: 'user',
      content: 'What is EEee?',
    },
    {
      role: 'assistant',
      status: 'success',
    },
  ]);

  const { content } = await utils.chatPanel.getLatestAssistantMessage(page);
  expect(content).toMatch(/EEee/);
});
```

#### Summary

||Cases|
|------|----|
|Before|19||
|After|151||

> Close BS-2769
2025-03-29 03:41:09 +00:00
Saul-Mirone
205cd7a86d refactor(editor): rename block-std to std (#11250)
Closes: BS-2946
2025-03-28 07:20:34 +00:00