toeverything / AFFiNE

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
https://affine.pro
Other
40.04k stars 2.58k forks source link

​Enhancing Performance and User Experience through Optimized Rendering in the Editor and Canvas Modes #7597

Open Neurocylcq opened 1 month ago

Neurocylcq commented 1 month ago

Description

Current Issue:

Full Rendering in Editor Mode: In the editor, blocks are processed and rendered in their entirety, regardless of whether they are visible or within the current user's focus. This approach mirrors traditional rendering methods but falls short of the more efficient, on-demand rendering strategies employed by modern IDEs like VSCode. Non-Optimized Canvas Rendering: Similarly, in the canvas mode, all elements are rendered without any form of optimization or viewport-based clipping. This results in unnecessary computational overhead, particularly for large projects with numerous elements, causing long load times and reduced interactivity.

Using the canvas function is not smooth and sometimes experiences significant lag.

improvements:

Viewport-Based Rendering in Editor Mode: Implement a viewport-aware rendering system in the editor, where only blocks within the current viewport or user's focus are fully rendered. Blocks outside this area can be rendered at a lower fidelity or not rendered at all, with placeholders used to indicate their presence. This approach will significantly reduce the computational load, leading to faster response times and improved user experience. Optimized Canvas Rendering with Element Clipping: Introduce element clipping in the canvas mode, ensuring that only elements within the current viewport are fully rendered. Elements outside the viewport can be either partially rendered with reduced detail or not rendered at all, with the canvas dynamically updating as the user scrolls or pans. Additionally, implement lazy loading for elements that are not immediately visible, further reducing initial load times and enhancing performance.

Use case

No response

Anything else?

image image image

Are you willing to submit a PR?

affine-issue-bot[bot] commented 1 month ago

Issue Status: 🆕 *Untriaged

*🆕 Untriaged**

The team has not yet reviewed the issue. We usually do it within one business day. Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.