fundon
8ca675b2ec
fix(editor): improve pdf embed viewer UX ( #11641 )
...
Closes: [BS-3101](https://linear.app/affine-design/issue/BS-3101/pdf-embed-模式的选中框选-和点开看详情有比较大的问题 )
### What's Changed!
* Fixed disable pointer event in native pdf viewer by dragging
* Disable opening peek view with pdf viewer in readonly and sharing modes
2025-04-15 08:51:02 +00:00
L-Sun
6f35021f22
chore(editor): update github block ui ( #11690 )
...
Close [BS-2651](https://linear.app/affine-design/issue/BS-2651/github-embed-block的样式修复 )
2025-04-15 04:15:00 +00:00
Yifeng Wang
760a689c07
Merge branch 'canary' into 0414/vtr_test_layout
2025-04-15 09:20:25 +08:00
doodlewind
b8967a8a7b
test(editor): add tests for turbo renderer state machine ( #11659 )
2025-04-14 15:54:02 +00:00
Yifeng Wang
e9d04de399
test(editor): add tests for turbo renderer layout cache
2025-04-14 17:06:13 +08:00
doodlewind
6457c979f5
test(editor): add tests for turbo renderer state machine ( #11659 )
2025-04-14 17:01:27 +08:00
donteatfriedrice
7aa87de5f7
fix(editor): markdown code preprocessor should handle link correctly ( #11671 )
...
Close [BS-3117](https://linear.app/affine-design/issue/BS-3117/代码粘贴后出现多余的-和-符号 )
2025-04-14 08:28:43 +00:00
L-Sun
e1cb8198f1
fix(editor): android bs keyboard provider error ( #11647 )
...
### What Changes
- fixed keyboard service can not be initialized since a anonymous `BSKeyboardWithActionService` class was provider to di
- fixed tool panel was not closed when focus on other pragraph by clicking
- optimized code structure of fallback `show` and `hide` of keyboard
2025-04-13 09:59:24 +00:00
L-Sun
076c5ba044
fix(editor): repeat trigger keys of at-menu was added ( #11631 )
...
Close [BS-2716](https://linear.app/affine-design/issue/BS-2716/移动端通过toolpanel唤起的at-menu,出现两个 )
2025-04-13 06:46:37 +00:00
L-Sun
26d2ed8afb
chore(editor): hide file and doc import entries for mobile ( #11648 )
...
Close [BS-2926](https://linear.app/affine-design/issue/BS-2926/【移动端-ios】-选择import,无反应 )
Close [BS-2927](https://linear.app/affine-design/issue/BS-2927/【移动端-ios】隐藏toolbar上附件入口 )
2025-04-13 05:32:15 +00:00
L-Sun
f860f77a24
fix(editor): can not query in mobile at menu ( #11649 )
...
This PR addresses an issue where queries cannot be performed in the mobile menu, particularly on Android devices. The root cause was that the `event.key` of keypress returns 'Unidentified' on Android, which prevented proper query handling.
Changes made:
- Replaced the keydown event observer with a beforeinput event listener
- Removed unnecessary keyboard event handling code that was causing issues
2025-04-13 02:39:05 +00:00
doouding
cac817c896
fix: cannot drop image as list child ( #11635 )
...
Fixes [BS-3103](https://linear.app/affine-design/issue/BS-3103/drag-and-drop-bug-白板图片无法拖动到-list-的子项下面 )
2025-04-13 02:21:57 +00:00
donteatfriedrice
4da00eba0d
fix(editor): cut and paste surface-ref to same doc should remain surface-ref ( #11639 )
...
Close [BS-3107](https://linear.app/affine-design/issue/BS-3107/剪切-surface-ref-block-会变成指向当前文档的link-card )
2025-04-12 01:56:24 +00:00
fundon
afdc40b510
feat(editor): add shortcut to highlighter tool ( #11604 )
...
Closes: [BS-3092](https://linear.app/affine-design/issue/BS-3092/highlighter-快捷键 )
### What's Changed!
* Added shortcut `⇧ P` to highlighter tool
[Screen Recording 2025-04-10 at 16.33.30.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/8ypiIKZXudF5a0tIgIzf/38aadc08-ed18-4b48-9d91-b4876d14a2d3.mov " />](https://app.graphite.dev/media/video/8ypiIKZXudF5a0tIgIzf/38aadc08-ed18-4b48-9d91-b4876d14a2d3.mov )
2025-04-11 13:08:59 +00:00
L-Sun
aabb09b31f
fix(editor): ime input error at empty line ( #11636 )
...
Close [BS-3106](https://linear.app/affine-design/issue/BS-3106/mac-chrom在空行使用ime输入,文档卡住 )
2025-04-11 10:39:16 +00:00
doodlewind
e1e5e8fc14
feat(editor): add basic image support in turbo renderer ( #11620 )
...
This PR adds basic support for image block:

2025-04-11 10:16:07 +00:00
forehalo
2f5647ac77
fix(editor): use img tag for link preview icon and banner ( #11637 )
...
close AF-2377
2025-04-11 08:48:04 +00:00
donteatfriedrice
74ebec007d
fix(editor): surface-ref refFlavour should be affine:frame when reference to a frame ( #11632 )
2025-04-11 06:51:31 +00:00
Saul-Mirone
4f9a4e739a
feat(editor): extract linked doc widget package ( #11589 )
...
Close [BS-2738](https://github.com/toeverything/AFFiNE/pull/11589 )
2025-04-11 14:06:16 +08:00
doodlewind
a5ab66d6cd
feat(editor): add basic code support in turbo renderer ( #11619 )
...
This PR adds basic support for code block:
[Screen Recording 2025-04-10 at 8.13.26 PM.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/lEGcysB4lFTEbCwZ8jMv/5d749979-f7f1-4e4d-ba5b-bc4ba29f8b83.mov " />](https://app.graphite.dev/media/video/lEGcysB4lFTEbCwZ8jMv/5d749979-f7f1-4e4d-ba5b-bc4ba29f8b83.mov )
2025-04-11 04:28:51 +00:00
doouding
714f2e79dc
fix: cannot exit editing mode when click frame body ( #11603 )
2025-04-11 03:23:27 +00:00
Kieran Cui
bcd1cd2629
fix(editor): the switch button style set in the TOC does not effect ( #11622 )
...
Co-authored-by: Chen <99816898+donteatfriedrice@users.noreply.github.com >
2025-04-11 11:22:24 +08: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
L-Sun
588659ef67
fix(editor): connector target position NaN ( #11606 )
...
Close [BS-3086](https://linear.app/affine-design/issue/BS-3086/frame里套frame,连一下connector,拖两下,白板损坏 )
### What Changes
- Fixed `bound.toRelative` may be return `NaN` when `bound.w === 0 || bound.h ===0`
- Remove type assertions from `connector-manager.ts` for more type safety
2025-04-10 12:33:24 +00:00
donteatfriedrice
d5aebc1421
fix(editor): enhance markdown latex preprocessing ( #11597 )
...
Close [BS-2440](https://linear.app/affine-design/issue/BS-2440/inline-latex-markdown-adapter-需要更精确的处理 )
2025-04-10 12:15:24 +00:00
doodlewind
dba8e00fb6
feat(editor): add basic note support in turbo renderer ( #11607 )
...
After landing layout tree refactoring, this PR adds basic note support in turbo renderer.
In this demo recording, the code and image block needs to be further supported.
[Screen Recording 2025-04-10 at 5.16.15 PM.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/lEGcysB4lFTEbCwZ8jMv/2e416b41-5609-4e52-a90f-5b7bb77db682.mov " />](https://app.graphite.dev/media/video/lEGcysB4lFTEbCwZ8jMv/2e416b41-5609-4e52-a90f-5b7bb77db682.mov )
2025-04-10 09:52:33 +00:00
doodlewind
69d4620753
refactor(editor): cleanup turbo renderer entry config with doc guide ( #11605 )
2025-04-10 09:52:32 +00:00
doodlewind
f85b35227b
feat(editor): replace flat layout cache with tree in turbo renderer ( #11319 )
...
### TL;DR
Refactored the BlockSuite turbo renderer to use a hierarchical tree structure for layouts instead of a flat list, improving rendering accuracy and performance.
### What changed?
- Redesigned the layout system to use a tree structure (`ViewportLayoutTree`) that better represents the document hierarchy
- Added `blockId` to all layout objects for better tracking and debugging
- Updated the layout query mechanism to work with models directly instead of components
- Enhanced error handling with more descriptive warnings and error messages
- Improved the painting process to traverse the layout tree recursively
- Fixed viewport coordinate calculations for more accurate rendering
- Updated the worker communication to support the new tree-based layout structure
### Why make this change?
The previous flat layout structure didn't properly represent the hierarchical nature of documents, leading to rendering issues with nested blocks. This tree-based approach:
1. Better represents the actual document structure
2. Improves rendering accuracy for nested elements
3. Makes debugging easier with more consistent block identification
4. Provides a more robust foundation for future rendering optimizations
5. Reduces the likelihood of rendering artifacts when scrolling or zooming
2025-04-10 08:49:23 +00:00
liuyi
e376aa57c5
chore: bring treeshake back ( #11577 )
2025-04-10 14:12:36 +08: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
akumatus
c9790ed854
refactor(core): ai session create ( #11539 )
...
Close [BS-3079](https://linear.app/affine-design/issue/BS-3079 ).
- Separate the create session logic from the `createMessage function`.
- Ensure the session is created before executing any chat or actions.
- Convert the `AIActions` into asynchronous functions.
- Transfer the update prompt name logic to the chat action.
- Introduce a networkSearch field in `AITextActionOptions`.
- Eliminate the redundant `LAST_ROOT_SESSION_ID`.
2025-04-09 06:18:57 +00:00
Saul-Mirone
be3024c0c1
chore(editor): remove unused inner modal widget ( #11552 )
2025-04-09 02:55:00 +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
Saul-Mirone
dd1cf14069
refactor(editor): cleanup duplicated code ( #11548 )
2025-04-08 16:35:25 +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
Saul-Mirone
1081d6281f
feat(editor): adjust url input ui ( #11535 )
...
Closes: BS-1074
2025-04-08 11:05:24 +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
L-Sun
7d4bb5150e
chore(editor): improve bookmark UI&UX ( #11525 )
...
Close [BS-2804](https://linear.app/affine-design/issue/BS-2804/[ui-bug]-link-card-view-ui-布局错了,url-应该是-text-secondary-color )
Close [BS-3034](https://linear.app/affine-design/issue/BS-3034/link-card-view-链接需要-fix-在底部 )
### What Changes
- remove url selected color
- improve url click area by moving `@click` callback to inner small url container
- improve layout
2025-04-08 10:34:36 +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
CatsJuice
280227fa5f
feat(editor): change note cursor to crosshair ( #11499 )
2025-04-08 09:49:29 +00:00
Flrande
8c87d2a39e
fix(editor): disable mention node select ( #11512 )
...
Close [BS-3011: inline at 有时候会进入可以选中的状态](https://linear.app/affine-design/issue/BS-3011/inline-at-有时候会进入可以选中的状态 )
2025-04-08 09:31:19 +00:00
Saul-Mirone
238ec59dd2
fix(editor): image icon color ( #11536 )
...
Closes: BS-2166
2025-04-08 09:18:26 +00:00
Saul-Mirone
ca75162fc9
fix(editor): text overflow in journal card ( #11537 )
...
Closes: BS-3000
2025-04-08 09:04:48 +00:00
Saul-Mirone
d1b82f0c58
fix: sentry-6337909140 ( #11534 )
...
Closes: BS-3076
2025-04-08 06:44:37 +00:00
fundon
e927d02c96
fix(editor): improve link popup positioning with autoUpdate ( #11510 )
...
Closes: [BS-3038](https://linear.app/affine-design/issue/BS-3038/遇到一个新bug-抽象的一p )
Maybe the `mock selection widget` is needed.
2025-04-07 13:33:11 +00:00
Saul-Mirone
1f45cc5dec
refactor(editor): unify directories naming ( #11516 )
...
**Directory Structure Changes**
- Renamed multiple block-related directories by removing the "block-" prefix:
- `block-attachment` → `attachment`
- `block-bookmark` → `bookmark`
- `block-callout` → `callout`
- `block-code` → `code`
- `block-data-view` → `data-view`
- `block-database` → `database`
- `block-divider` → `divider`
- `block-edgeless-text` → `edgeless-text`
- `block-embed` → `embed`
2025-04-07 12:34:40 +00:00
forehalo
40f218c898
chore: set base version to 0.21
2025-04-07 16:10:32 +08:00
fundon
6e10fe6205
fix(editor): popover style on link popup ( #11495 )
...
Closes: [BS-3039](https://linear.app/affine-design/issue/BS-3039/这个输入框样式也g了 )
2025-04-07 06:43:37 +00:00
fundon
eb0bcd9b99
fix(editor): improve menu content UX on toolbar ( #11491 )
...
* Added scrollbar style

* Used `padding` instead of `offset`
2025-04-07 06:30:07 +00:00