Block-based text editing with text slice trees
The block-based editor model with CRDT text slices and hierarchical trees addresses data integrity and consistency issues in collaborative editing, ensuring consistent and synchronized changes across users and devices, including offline scenarios.
Patent Information
- Application Number
- US19/547627
- Authority / Receiving Office
- US · United States
- Patent Type
- Patents(United States)
- Current Assignee / Owner
- Priority Date
- 2025-10-01
- Filing Date
- 2026-02-23
- Publication Date
- 2026-12-01
- Estimated Expiration
- 2046-02-23
AI Technical Summary
Existing collaborative editing systems face challenges in maintaining data integrity and consistency across multiple users and devices, particularly in real-time and offline scenarios, leading to conflicts and data loss during concurrent editing operations.
A block-based editor model utilizing conflict-free replicated data type (CRDT) text slices, which are organized into hierarchical text slice trees, ensures robust concurrent editing by managing split and merge actions, updating metadata dynamically, and synchronizing changes across users and devices without compromising data integrity or structure.
The system maintains data consistency and integrity by resolving conflicts automatically, ensuring all replicas converge to the same state, preventing data loss or duplication, even during offline use or merge conflicts, and supports real-time synchronization and offline editing capabilities.
Smart Images

Figure US12818106-D00000_ABST
Abstract
Description
CROSS-REFERENCE TO RELATED APPLICATION
[0001] This application claims the benefit of U.S. Provisional Patent Application No. 63 / 891,935, filed Oct. 1, 2025, entitled “BLOCK-BASED TEXT EDITING WITH CONFLICT-FREE REPLICATED DATA TYPE (CRDT) SLICE TREES,” which is incorporated herein by reference in its entirety.BACKGROUND
[0002] Workspaces (e.g., digital workspaces) refer to environments that assemble tools and platforms that allow users to work, communicate, and produce work products together. Workspaces can be desktop or web-based applications that allow multiple users to share and access the workspaces in a variety of manners. Workspaces can include compilations of electronic documents that can be organized within the workspace.BRIEF DESCRIPTION OF THE DRAWINGS
[0003] Reference will now be made, by way of example, to the accompanying drawings which show example embodiments of the present application, and in which:
[0004] FIG. 1 is a block diagram illustrating a platform, which may be used to implement examples of the present disclosure.
[0005] FIG. 2 is a block diagram illustrating a hierarchical organization of pages in a workspace.
[0006] FIG. 3A illustrates the result of a sequence of edit operations on blocks of a workspace.
[0007] FIG. 3B is a split-first view of text slices grouped by text instance.
[0008] FIG. 3C is a split-first view of text slices superimposed with merges represented as arrows forming text slice trees.
[0009] FIG. 3D is a merge-first view of text slices grouped by text slice trees.
[0010] FIG. 3E is a merge-first view of text slices superimposed with splits represented as dashed lines, forming text instances.
[0011] FIG. 4 illustrates an example of a text conflict-free replicated data type (CRDT) instance with insertions, deletions, and annotations.
[0012] FIG. 5 is a block diagram that illustrates an example of a text CRDT instance split into two slices.
[0013] FIG. 6 illustrates an example of creating a sibling block and then merging sibling blocks.
[0014] FIG. 7 is a block diagram that illustrates an example of applying formatting to a range of text in a block.
[0015] FIG. 8 illustrates an example of moving and merging text CRDT instances.
[0016] FIG. 9 is a flowchart that illustrates a method for merging edits performed asynchronously by multiple users on the same text.
[0017] FIG. 10 is a diagram that illustrates reconstructing text that has undergone text edit operations asynchronously by different users.
[0018] FIG. 11 is a flow diagram that illustrates processes that involve using text slice trees for collaborative editing.
[0019] FIG. 12 is a block diagram that illustrates an example of a computer system in which at least some operations described herein can be implemented.
[0020] The technologies described herein will become more apparent to those skilled in the art by studying the Detailed Description in conjunction with the drawings. Embodiments or implementations describing aspects of the invention are illustrated by way of example, and the same references can indicate similar elements. While the drawings depict various implementations for the purpose of illustration, those skilled in the art will recognize that alternative implementations can be employed without departing from the principles of the present technologies. Accordingly, while specific implementations are shown in the drawings, the technology is amenable to various modifications.DETAILED DESCRIPTION
[0021] The present technology relates to a collaborative workspace composed of including text content that is stored as a tree of conflict-free replicated data type (CRDT) text slices, enabling robust concurrent and independent editing, real-time synchronization, and offline editing capabilities. The system can operate on a block-based editor model, such as Notion, where content is contained in blocks that can represent logical units such as paragraphs, list items, or table rows. The system manages editing operations-including split and merge actions-on these text slices, dynamically updates metadata, and ensures that all changes are integrated and synchronized across multiple users and devices without compromising data integrity or structure.
[0022] Each block is a discrete unit of content, which may include text, media, or embedded objects. Each block is associated with a single text slice tree, which is a hierarchical data structure where each node, or “text slice,” represents a region of the block's text, which could be created by splitting text. Text slices collectively form an ordered representation of the block's renderable content, which can be reconstructed through pre-order tree traversal. Each text slice can also have metadata including format, attribution, originating block information, version information, operational history, and / or a unique CRDT instance identifier.
[0023] A text slice tree of a block organizes the block's content into one or more text slices. Each text slice contains, at minimum, the text that will be rendered for the block. Each slice may contain any combination of characters, words, sentences, paragraphs, or non-semantic text regions, along with its metadata. The text slice tree is stored as a searchable database record linked to the block, and each labeled text slice, along with its metadata and operational history, is recorded in a searchable database table of the database that administers the digital workspace. The complete rendered text for a block is obtained by pre-order traversal of the text slice tree. In one example, a complete rendered text for a block is obtained by performing a pre-order traversal of text slices in the tree, visiting the node, then visiting its left child, and then visiting its right child.
[0024] When a block is created, a new text instance with a unique text instance identifier (ID) is instantiated. The text instance ID uniquely identifies the underlying text CRDT. As used herein, “text instance” is a CRDT instance (also referred to herein as a “text CRDT instance”) that could refer to a type of data instance that encompasses data other than text. All text editing operations (e.g., splitting, merging, or moving slices) are trackable through these identifiers. The text instance could refer to a conceptual instance identified by a text instance ID. A “text slice” is a segment of a text instance corresponding to at least a portion of the text CRDT array. Multiple text slices within the same text instance are non-overlapping, except in the case of a split character, which is duplicated in both resulting slices.
[0025] The system supports collaborative editing by leveraging CRDTs. A CRDT, as referred to herein, is a data structure replicated across nodes in a distributed network. Applications can update a CRDT replica independently and concurrently, without coordination. An algorithm automatically resolves inconsistencies, ensuring that replicas eventually reach the same state. A rich text CRDT is a data structure for collaborative, real-time editing that enables multiple users to modify text and styling (e.g., bold, italics) simultaneously without conflicts. Unlike plain text CRDTs, these algorithms manage the complexity of formatting, ensuring that concurrent edits (e.g., one user bolding while another deletes) result in a consistent, expected final document.
[0026] The disclosed system supports a CRDT for forests of rich text. That is, the system extends rich text CRDT to support operations spanning multiple rich text CRDTs. From a user's perspective, the former only ensures the integrity of edits (text insertion, deletion, formatting changes, etc.) within a paragraph. The latter additionally ensure the integrity of the inline text operations (insertion, deletion, formatting) but spanning more than one discrete block such as, for example, italicizing the final sentence of the paragraph along with the first sentence of the subsequent paragraph, all within a single operation). The text slice trees also ensure the integrity of additional block-level merge and split operations such as, for example, inserting a new line halfway through the paragraph to split into two, or deleting the first word of a paragraph and the last word of the previous paragraph, combining both into one paragraph. Each client's CRDT instance integrates updates from other clients upon receipt, despite delays. The CRDT system is said to be consistent if all clients reach the same final state after integrating all outstanding updates, regardless of the order or timing of their receipt.
[0027] The CRDT tree structure thus enables collaborative editing operations essential for block-based text editors, including splitting, merging, and moving text slices between blocks, not just within a block. Because the text slice tree for each block is stored as a database record, the system preserves user intent and maintains data consistency across collaborative sessions. The CRDT ensures that all replicas eventually converge to the same state, preventing data loss or duplication, even during offline use or merge conflicts.
[0028] By departing from traditional linear string-based text models, the described data architecture supports distributed, concurrent editing across blocks without risk of data loss or conflicts to reliably preserve and integrate contributions and changes made by multiple collaborators. Using a CRDT data structure for distributed and collaborative systems ensures consistency and resolution of conflicts with concurrent changes made by different users across multiple devices. The present technology distributes each slice and associated edits made to the slice to collaborating users, to maintain history and automatically resolve conflicts. Local changes are merged with remote changes without overwriting or losing the work of any contributor.
[0029] Each edit is represented as an operation object referencing a block and a text CRDT instance. Edits include, for example, insertion, deletion, splitting, merging, annotation, or formatting changes to text. A text change is represented by a character node with a unique identifier. In some examples, the unique identifier may be a session or user identifier or is associated with a corresponding timestamp. In other embodiments, a text insertion specifies a parent node of where to insert the text.
[0030] Locally performed operations may be locally applied to a user's copy of the block's slice tree and propagated across the network to harmonize operation with other collaborations on the same block. In some examples, operations are distributed via client-server or client-client synchronization. Each contributor can receive, queue, and apply remote operations against their local data to support both offline and online changes. Per-slice editing allows multiple users to operate concurrently within the same block or adjacent slices without overwriting or interfering with other changes. The CRDT guarantees that operations can be merged in any order, while the tree structure supports updating slices as needed.
[0031] The current version of a block's text can be reconstructed by traversing each block's slice tree. As the system traverses the tree, it collects and renders content and formatting from all slices according to their deterministic order. Merging the operations enables rendering of an integrated block, regardless of edit timing, on-network or off-network action or delays, or operation sequencing.
[0032] In one example, a text CRDT instance includes an array of nodes representing all the characters that have been inserted into a document within a workspace. Each node contains a character identifier that includes a unique session ID and logical timestamp and references the node that the new character should be inserted after. If multiple nodes reference the same node, the nodes can be sorted so that the node with the more recent logical timestamp is first. For example, the session identifier, including the timestamp, can be used as a tiebreaker if it is applicable. Deletion of a node can be performed by updating a node's metadata to reflect a deleted status. The document's visible text for a text CRDT instance can thus be obtained by iterating over its non-deleted nodes.
[0033] Workspace content can be annotated with rich-text formatting (e.g., italics), rather than additional text, by marking the start and end nodes of a range over which the annotation should be applied. If no splits or merges have been performed in text of a block, the text of that block can be represented by a single text CRDT instance. When a user splits the block, a special split character is inserted in the text CRDT instance before the character that should start the new line. The nodes from the first start node through the split character belong to a first slice and can be owned and rendered by the block. The nodes from the split character through the end node belong to a second slice, distinct from the first slice, and can be owned and rendered by a new block. A slice may not include any split characters except at its boundaries. A slice is defined by its boundaries, which may include either a start node and an end node, a start node and a split character, a split character and an end node, or two split characters.
[0034] To handle asynchronous merges to text, the text CRDT slice tree of a first block can be reparented with the last text slice of the text CRDT slice tree of the second block. If multiple slices are reparented to a slice, their order can be based on the order in which corresponding operations are successfully saved. When a user applies a formatting action to a range of text in a block that spans multiple text slices in the text slice tree, separate operations can be issued for each text slice. Separate operations can be grouped together as one transaction.
[0035] The description and associated drawings are illustrative examples and are not to be construed as limiting. This disclosure provides certain details for a thorough understanding and enabling description of these examples. One skilled in the relevant technology will understand, however, that the invention can be practiced without many of these details. Likewise, one skilled in the relevant technology will understand that the invention can include well-known structures or features that are not shown or described in detail, to avoid unnecessarily obscuring the descriptions of examples.Block Data Model
[0036] The disclosed technology includes a block data model (“block model”). The blocks are dynamic units of information that can be transformed into other block types and move across workspaces. The block model allows users to customize how their information is moved, organized, and shared. Hence, blocks contain information but are not siloed.
[0037] Blocks are singular pieces that represent all units of information inside an editor. In one example, text, images, lists, a row in a database, etc., are all blocks in a workspace. The attributes of a block determine how that information is rendered and organized. Every block can have attributes including an identifier (ID), properties, and type. Each block is uniquely identifiable by its ID. The properties can include a data structure containing custom attributes about a specific block. An example of a property is “title,” which stores text content of block types such as paragraphs, lists, and the title of a page. More elaborate block types require additional or different properties, such as a page block in a database with user-defined properties. Every block can have a type, which defines how a block is displayed and how the block's properties are interpreted.
[0038] A block has attributes that define its relationship with other blocks. For example, the attribute “content” is an array (or ordered set) of block IDs representing the content inside a block, such as nested bullet items in a bulleted list or the text inside a toggle. The attribute “parent” is the block ID of a block's parent, which can be used for permissions. Blocks can be combined with other blocks to track progress and hold all project information in one place.
[0039] A block type is what specifies how the block is rendered in a user interface (UI), and the block's properties and content are interpreted differently depending on that type. Changing the type of a block does not change the block's properties or content—it only changes the type attribute. The information is thus rendered differently or even ignored if the property is not used by that block type. Decoupling property storage from block type allows for efficient transformation and changes to rendering logic and is useful for collaboration.
[0040] Blocks can be nested inside of other blocks (e.g., infinitely nested sub-pages inside of pages). The content attribute of a block stores the array of block IDs (or pointers) referencing those nested blocks. Each block defines the position and order in which its content blocks are rendered. This hierarchical relationship between blocks and their render children are referred to herein as a “render tree.” In one example, page blocks display their content in a new page, instead of rendering it indented in the current page. To see this content, a user would need to click into the new page.
[0041] In the block model, indentation is structural (e.g., reflects the structure of the render tree). In other words, when a user indents something, the user is manipulating relationships between blocks and their content, not just adding a style. For example, pressing Indent in a content block can add that block to the content of the nearest sibling block in the content tree.
[0042] Blocks can inherit permissions of blocks in which they are located (which are above them in the tree). Consider a page: to read its contents, a user must be able to read the blocks within that page. However, there are two reasons one cannot use the content array to build the permissions system. First, blocks are allowed to be referenced by multiple content arrays to simplify collaboration and a concurrency model. But because a block can be referenced in multiple places, it is ambiguous which block it would inherit permissions from. The second reason is mechanical. To implement permission checks for a block, one needs to look up the tree, getting that block's ancestors all the way up to the root of the tree (which is the workspace). Trying to find this ancestor path by searching through all blocks' content arrays is inefficient, especially on the client. Instead, the model uses an “upward pointer”—the parent attribute—for the permission system. The upward parent pointers and the downward content pointers mirror each other.
[0043] A block's life starts on the client. When a user takes an action in the interface—typing in the editor, dragging blocks around a page—these changes are expressed as operations that create or update a single record. The “records” refer to persisted data, such as blocks, users, workspaces, etc. Because many actions usually change more than one record, operations are batched into transactions that are committed (or rejected) by the server as a group.
[0044] Creating and updating blocks can be performed by, for example, pressing Enter on a keyboard. First, the client defines all the initial attributes of the block, generating a new unique ID, setting the appropriate block type (to_do), and filling in the block's properties (an empty title, and checked: [[“No”]]). The client builds operations to represent the creation of a new block with those attributes. New blocks are not created in isolation: blocks are also added to their parent's content array, so they are in the correct position in the content tree. As such, the client also generates an operation to do so. All these individual change operations are grouped into a transaction. Then, the client applies the operations in the transaction to its local state. New block objects are created in memory and existing blocks are modified. In native apps, the model caches all records that are accessed locally in an LRU (least recently used) cache on top of SQLite or IndexedDB, referred to as RecordCache. When records are changed on a native app, the model also updates the local copies in RecordCache. The editor re-renders to draw the newly created block onto the display. At the same time, the transaction is saved into TransactionQueue, the part of the client responsible for sending all transactions to the model's servers so that the data is persisted and shared with collaborators. TransactionQueue stores transactions safely in IndexedDB or SQLite (depending on the platform) until they are persisted by the server or rejected.
[0045] A block can be saved on a server to be shared with others. Usually, TransactionQueue sits empty, so the transaction to create the block is sent to the server in an application programming interface (API) request. In one example, the transaction data is serialized to JSON and posted to the / saveTransactions API endpoint. SaveTransactions gets the data into source-of-truth databases, which store all block data as well as other kinds of persisted records. Once the request reaches the API server, all the blocks and parents involved in the transaction are loaded. This gives a “before” picture in memory. The block model duplicates the “before” data that had just been loaded in memory. Next, the block model applies the operations in the transaction to the new copy to create the “after” data. Then the model uses both “before” and “after” data to validate the changes for permissions and data coherency. If everything checks out, all created or changed records are committed to the database-meaning the block has now officially been created. At this point, a “success” HTTP response to the original API request is sent by the client. This confirms that the client knows the transaction was saved successfully and that it can move on to saving the next transaction in the TransactionQueue. In the background, the block model schedules additional work depending on the kind of change made for the transaction. For example, the block model can schedule version history snapshots and indexing block text for a Quick Find function. The block model also notifies MessageStore, which is a real-time updates service, about the changes that were made.
[0046] The block model provides real-time updates to, for example, almost instantaneously show new blocks to members of a teamspace. Every client can have a long-lived WebSocket connection to the MessageStore. When the client renders a block (or page, or any other kind of record), the client subscribes to changes of that record from MessageStore using the WebSocket connection. When a team member opens the same page, the member is subscribed to changes of all those blocks. After changes have been made through the saveTransactions process, the API notifies MessageStore of new recorded versions. MessageStore finds client connections subscribed to those changing records and passes on the new version through their WebSocket connection. When a team member's client receives version update notifications from MessageStore, it verifies that version of the block in its local cache. Because the versions from the notification and the local block are different, the client sends a syncRecordValues API request to the server with the list of outdated client records. The server responds with the new record data. The client uses this response data to update the local cache with the new version of the records, then re-renders the user interface to display the latest block data.
[0047] Blocks can be shared instantaneously with collaborators. In one example, a page is loaded using only local data. On the web, block data is pulled from being in memory. On native apps, loading blocks that are not in memory are loaded from the RecordCache persisted storage. However, if missing block data is needed, the data is requested from an API. The API method for loading the data for a page is referred to herein as loadPageChunk; it descends from a starting point (likely the block ID of a page block) down the content tree and returns the blocks in the content tree plus any dependent records needed to properly render those blocks. Several layers of caching for loadPageChunk are used, but in the worst case, this API might need to make multiple trips to the database as it recursively crawls down the tree to find blocks and their record dependencies. All data loaded by loadPageChunk is put into memory (and saved in the RecordCache if using the app). Once the data is in memory, the page is laid out and rendered using React.Software Platform
[0048] FIG. 1 is a block diagram of an example platform 100. The platform 100 provides users with an all-in-one workspace for data and project management. The platform 100 can include a user application 102, an artificial intelligence (AI) tool 104, and a server 106. The user application 102, the AI tool 104, and the server 106 are in communication with each other via a network.
[0049] In some implementations, the user application 102 is a cross-platform software application configured to work on several computing platforms and web browsers. The user application 102 can include a variety of templates. A template refers to a prebuilt page that a user can add to a workspace within the user application 102. The templates can be directed to a variety of functions. Exemplary templates include a docs template 108, a wikis template 110, a projects template 112, a meeting and calendar template 114, and an email template 132. In some implementations, a user can generate, save, and share customized templates with other users.
[0050] The user application 102 templates can be based on content “blocks.” For example, the templates of the user application 102 include a predefined and / or pre-organized set of blocks that can be customized by the user. Blocks are content containers within a template that can include text, images, objects, tables, maps, emails, and / or other pages (e.g., nested pages or sub-pages). Blocks can be assigned to certain properties. The blocks are defined by boundaries having dimensions. The boundaries can be visible or non-visible for users. For example, a block can be assigned as a text block (e.g., a block including text content), a heading block (e.g., a block including a heading), or a sub-heading block having a specific location and style to assist in organizing a page. A block can be assigned as a list block to include content in a list format. A block can be assigned as an AI prompt block (also referred to as a “prompt block”) that enables a user to provide instructions (e.g., prompts) to the AI tool 104 to perform functions. A block can also be assigned to include audio, video, or image content.
[0051] A user can add, edit, and remove content from the blocks. The user can also organize the content within a page by moving the blocks around. In some implementations, the blocks are shared (e.g., by copying and pasting) between the different templates within a workspace. For example, a block embedded within multiple templates can be configured to show edits synchronously.
[0052] The docs template 108 is a document generation and organization tool that can be used for generating a variety of documents. For example, the docs template 108 can be used to generate pages that are easy to organize, navigate, and format. The wikis template 110 is a knowledge management application having features similar to the pages generated by the docs template 108 but that can additionally be used as a database. The wikis template 110 can include, for example, tags configured to categorize pages by topic and / or include an indication of whether the provided information is verified to indicate its accuracy and reliability. The projects template 112 is a project management and note-taking software tool. The projects template 112 can allow the users, either as individuals or as teams, to plan, manage, and execute projects in a single forum. The meeting and calendar template 114 is a tool for managing tasks and timelines. In addition to traditional calendar features, the meeting and calendar template 114 can include blocks for categorizing and prioritizing scheduled tasks, generating to-do and action item lists, tracking productivity, etc. The various templates of the user application 102 can be included under a single workspace and include synchronized blocks. For example, a user can update a project deadline on the projects template 112, which can be automatically synchronized to the meeting and calendar template 114. The various templates of the user application 102 can be shared within a team, allowing multiple users to modify and update the workspace concurrently.
[0053] The email template 132 allows the users to customize their inbox by representing the inbox as a customizable database where the user can add custom columns and create custom views with layouts. One view can include multiple layouts including a calendar layout, a summary layout, and an urgent information layout. Each view can include a customized structure including custom criteria, custom properties, and custom actions. The custom properties can be specific to a view such as AI-extracted properties and / or heuristic-based properties. The custom actions can trigger automatically when a message enters the view. The custom actions can include deterministic rules like “Archive this,” or assistant workflows like responding to support messages by searching user applications 102 or filing support tickets. In addition, the view can include actions, such as buttons, that are custom to the view and perform operations on the messages in the inbox. Only the customized structure can be shared with other users of the system, or both the customized structure and the messages can be shared.
[0054] The integration of the docs template 108, the wikis template 110, the projects template 112, the meeting and calendar template 114, and the email template 132 enables linking and embedding of templates within other templates. For example, an email sent from an email address within the platform 100 to another email address within the platform 100 can include an embedding of a document within the platform 100, or an embedding of a block within the document. In another example, a wiki can link to a meeting within the calendar.
[0055] The AI tool 104 is an integrated AI assistant that enables AI-based functions for the user application 102. In one example, the AI tool 104 is based on a neural network architecture, such as a transformer of an artificial intelligence (AI) system. The AI tool 104 can interact with blocks embedded within the templates on a workspace of the user application 102. For example, the AI tool 104 can include a writing assistant tool 116, a knowledge management tool 118, a project management tool 120, and a meeting and scheduling tool 122. The different tools of the AI tool 104 can be interconnected and interact with different blocks and templates of the user application 102.
[0056] The writing assistant tool 116 can operate as a generative AI tool for creating content for the blocks in accordance with instructions received from a user. Creating the content can include, for example, summarizing, generating new text, or brainstorming ideas. For example, in response to a prompt received as a user input that instructs the AI to describe what the climate is like in New York, the writing assistant tool 116 can generate a block including text that describes the climate in New York. As another example, in response to a prompt that requests ideas on how to name a pet, the writing assistant tool 116 can generate a block including a list of creative pet names. The writing assistant tool 116 can also operate to modify existing text. For example, the writing assistant can shorten, lengthen, or translate existing text, correct grammar and typographical errors, or modify the style of the text (e.g., a social media style versus a formal style).
[0057] The knowledge management tool 118 can use AI to categorize, organize, and share knowledge included in the workspace. In some implementations, the knowledge management tool 118 can operate as a question-and-answer assistant. For example, a user can provide instructions on a prompt block to ask a question. In response to receiving the question, the knowledge management tool 118 can provide an answer to the question, for example, based on information included in the wikis template 110. The project management tool 120 can provide AI support for the projects template 112. The AI support can include autofilling information based on changes within the workspace or automatically tracking project development. For example, the project management tool 120 can use AI for task automation, data analysis, real-time monitoring of project development, allocation of resources, and / or risk mitigation. The meeting and scheduling tool 122 can use AI to organize meeting notes, unify meeting records, list key information from meeting minutes, and / or connect meeting notes with deliverable deadlines.
[0058] The server 106 can include various units (e.g., including compute and storage units) that enable the operations of the AI tool 104 and workspaces of the user application 102. The server 106 can include an integrations unit 124, an application programming interface (API) 128, databases 126, and an administration (admin) unit 130. The databases 126 are configured to store data associated with the blocks. The data associated with the blocks can include information about the content included in the blocks, the function associated with the blocks, and / or any other information related to the blocks. The API 128 can be configured to communicate the block data between the user application 102, the AI tool 104, and the databases 126. The API 128 can also be configured to communicate with remote server systems, such as AI systems. For example, when a user performs a transaction within a block of a template of the user application 102 (e.g., in a docs template 108), the API 128 processes the transaction and saves the changes associated with the transaction to the database 126. The integrations unit 124 is a tool connecting the platform 100 with external systems and software platforms. Such external systems and platforms can include other databases (e.g., cloud storage spaces), messaging software applications, or audio or video conference applications. The administration unit 130 is configured to manage and maintain the operations and tasks of the server 106. For example, the administration unit 130 can manage user accounts, data storage, security, performance monitoring, etc.Hierarchical Organizational Blocks in a Workspace
[0059] FIG. 2 is a block diagram illustrating a hierarchical organization of pages in a workspace. As described with respect to the block data model of the present technology, a workspace can include multiple pages (e.g., page blocks). The pages (e.g., including parent pages and child or nested pages) can be arranged hierarchically within the workspace or one or more teamspaces, as shown in FIG. 2. The page can include a block such as tabs, lists, images, tables, etc.
[0060] A teamspace can refer to a collaborative space associated with a team or an organization that is hierarchically below a workspace. For example, a workspace can include a teamspace accessible by all users of an organization and multiple teamspaces that are accessible by users of different teams. Accessibility generally refers to creating, editing, and / or viewing content (e.g., pages) included in the workspace or the one or more teamspaces.
[0061] In the hierarchical organization illustrated in FIG. 2, a parent page (e.g., “Parent Page”) is located hierarchically below the workspace or a teamspace. The parent page includes three children pages (e.g., “Page 1,”“Page 2,” and “Page 3”). Each of the child pages can further include subpages (e.g., “Page 2 Child,” which is a grandchild of “Parent Page” and child of “Page 2”). The “Content” arrows in FIG. 2 indicate the relationship between the parents and children while the “Parent” arrows indicate the inheritance of access permissions. The child pages inherit access permission from the (immediate) parent page under which they are located hierarchically (e.g., which is above them in the tree). For example, “Page 2” inherited the access permission of the “Parent Page” as a default when it was created under its parent page. Similarly, “Page 2 Child” inherited the access permission of the parent page as a default when it was created under its parent page. “Parent Page,”“Page 2,” and “Page 2 Child” thereby have the same access permission within the workspace.
[0062] The relationships and organization of the content can be modified by changing the location of the pages. For example, when a child page is moved to be under a different parent, the child page's access permission modifies to correspond to the access permission of the new parent. Also, when the access permission of “Parent Page” is modified, the access permission of “Page 1,”“Page 2,” and “Page 3” can be automatically modified to correspond to the access permission of “Parent Page” based on the inheritance character of access permissions.
[0063] In contrast, however, a user can modify the access permission of the children independently of their parents. For example, the user can modify the access permission of “Page 2 Child” in FIG. 2 so that it is different from the access permission of “Page 2” and “Parent Page.” The access permission of “Page 2 Child” can be modified to be broader or narrower than the access permission of its parents. As an example, “Page 2 Child” can be shared on the internet while “Page 2” is only shared internally to the users associated with the workspace. As another example, “Page 2 Child” can be shared only with an individual user while “Page 2” is shared with a group of users (e.g., a team of the organization associated with the workspace). In some implementations, the hierarchical inheritance of the access permissions described herein can be modified from the previous description. For example, the access permissions of all the pages (parent and children) can be defined as independently changeable.Text Slice Trees
[0064] When a user creates a new block in the workspace, the system automatically initializes a corresponding text slice tree for that block. The text slice tree starts with a single root node containing a text slice that represents the entire content of a new text instance. The text of the block is assigned a text instance ID that is unique among other blocks. At initialization, the root text slice encompasses an entirety of the text (e.g., all characters) of the block's content. This design ensures a direct, one-to-one mapping between the block's initial state and its text content, establishing a clear hierarchy due to all subsequent editing operations.
[0065] As users interact with a block, such as by typing, inserting line breaks, or performing other edits, the system dynamically subdivides text slices to reflect these changes. For example, when a user places the cursor within a block and presses the Enter key, the system inserts a special split character at the cursor's location within the relevant text slice. The original text slice is then divided into two distinct slices: the left segment (preceding the cursor) remains in the original block's text slice tree, while the right segment (following the cursor) is moved to a newly created block. The new block's text slice tree is initialized with this right segment as its root node. This approach supports intuitive editing and enables the tree structure to represent multi-level hierarchies, as the moved slice may itself contain child nodes.
[0066] The system also supports merging blocks, which can occur when users delete boundaries between adjacent blocks. For instance, if a user places the cursor at the beginning of a second block and presses Backspace, the nodes from the second block's text slice tree are transferred into the first block's tree. Typically, these nodes are attached as children to the rightmost leaf node in the first block's tree. To maintain structural consistency, the root node of the second block may be split, with its content and children reassigned as needed before the merge. After merging, the second block is marked as deleted, ensuring that each block maintains a single, coherent text slice tree. That is, an indication of the deletion is stored in the searchable database table rather than the block and every instance of its prior existence being deleted.
[0067] Text slice trees can handle complex editing scenarios, such as splitting a block that contains a multi-level tree of text slices. When a user initiates a split within a text slice that has its own subtree (e.g., child nodes), the system inserts a split character at the cursor location and divides the text slice into left and right segments. The left segment retains the content before the cursor, while the right segment contains the content after the cursor. All child nodes of the original text slice are reparented to the right segment, which then becomes a child of the left segment. The right segment, along with its subtree, is moved to the text slice tree of a new block. This process ensures that the rendered text, determined by pre-order traversal, remains consistent with user expectations, as all content after the cursor (including descendants) is correctly relocated.
[0068] Utilizing a tree structure for text slices, rather than a flat array or independent CRDT per block, offers significant advantages for managing concurrent operations. The tree structure enables the system to efficiently handle simultaneous splits and merges, preventing issues such as duplicated or lost text that can occur in other implementations. During collaborative editing, the tree ensures that insertions, deletions, and formatting changes are accurately reflected in the correct context, even when multiple users are making changes at the same time. This design also streamlines the process of locating and referencing specific characters, as each character is uniquely identified within its text instance and efficiently mapped to its containing block.
[0069] The following example illustrates how the described technology supports granular editing of text blocks in a collaborative digital workspace, leveraging blocks, text slice trees, and text CRDT instances. A search label system is introduced as a mechanism to optimize the retrieval of data blocks and the application of text editing operations based on CRDTs. The search labels provide a way to reconstruct the hierarchical text slice tree structure. In particular, the system assigns “search labels,” which could be persistent alphanumeric string identifiers, to individual text slices within a text slice tree of a corresponding block. These search labels can be text strings, keywords, tags, numbers, or any combination of characters. Unlike other systems that associate labels with static positions in a workspace or document, each search label is directly linked to its corresponding text slice. As blocks are edited, whether through splitting, merging, formatting, or moving slices, the associated search labels migrate with their respective slices. This ensures that even as the underlying text changes due to user actions, artificial intelligence (AI) agent (“agent”) actions, or programmatic actions, the connection between each search label and its text slice remains intact.
[0070] Search labels are stored as metadata within the text slice data structure. Whenever a text slice is split, edited, or reformatted, the label is automatically propagated to all descendant slices created by these actions. When two blocks are merged, the text slices from one block are moved into the other block while retaining their respective search labels. This mechanism guarantees that the association between a search label and its designated portion of content persists, regardless of the sequence of edits or asynchronous modifications made by multiple entities. For instance, if two users edit overlapping segments of labeled content at the same time, the system leverages both the search labels and the operational history embedded in the CRDT slices to accurately resolve the final content and preserve correct label distribution. By utilizing search labels in this way, the system enables efficient indexing and retrieval of specific content segments within a workspace or document, even in environments with extensive collaborative editing or merge conflicts.
[0071] In the example, a user initially creates a new block and enters the text “todo: milk, bread,” (text instance 0). The block is split after the colon (“:”), resulting in two blocks:
[0072] Block 0: “todo:” (text instance 0) (search label 0)
[0073] Block 1: “milk, bread,” (text instance 0) (search label 1)
[0074] Each block receives its own text slice tree, initialized with the block's content as the root node. The user then splits Block 1 at the comma after “milk,” producing:
[0075] Block 1a: “milk,” (text instance 0) (search label 10)
[0076] Block 1b: “bread,” (text instance 0) (search label 11)
[0077] The text slice of Block 1 is thus divided into two non-overlapping slices with split characters duplicated at their boundaries, and each segment is assigned to its respective block's text slice tree. The user then creates another block and enters “oat milk, tortilla,” updating the workspace to:
[0078] “todo:” (text instance 0) (search label 0)
[0079] “milk,” (text instance 0) (search label 10)
[0080] “oat milk, tortilla,” (text instance 1) (search label empty)
[0081] “bread,” (text instance 0) (search label 11)
[0082] Each block can be tracked by a text instance and associated text slice tree. The user creates another block and enters “dairy milk,” updating the workspace to:
[0083] “todo:” (text instance 0) (search label 0)
[0084] “milk,” (text instance 0) (search label 10)
[0085] “oat milk, tortilla,” (text instance 1) (search label 0)
[0086] “dairy milk,” (text instance 2) (search label empty)
[0087] “bread,” (text instance 0) (search label 11)
[0088] The user then splits “oat milk, tortilla,” and reorders the blocks, resulting in:
[0089] “todo:” (text instance 0) (search label 0)
[0090] “milk,” (text instance 0) (search label 10)
[0091] “oat milk,” (text instance 1) (search label 0)
[0092] “dairy milk,” (text instance 2) (search label empty)
[0093] “bread,” (text instance 0) (search label 11)
[0094] “tortilla,” (text instance 1) (search label 1)
[0095] Finally, the user merges “bread,” and “tortilla,” to create:
[0096] “todo:” (text instance 0) (search label 0)
[0097] “milk,” (text instance 0) (search label 10)
[0098] “oat milk,” (text instance 1) (search label 0)
[0099] “dairy milk,” (text instance 2) (search label empty)
[0100] “bread, tortilla,” (text instance 0, search label 11) (text instance 1, search label 1)
[0101] Multiple users or AI agents can participate in real-time, concurrent, and / or asynchronous editing within the workspace, and the underlying tree structure and CRDT model guarantee eventual consistency. The editing operations are resolved to prevent duplication or unintended loss of content. The system's tree-based CRDT ensures that all splits, merges, moves, and re-orderings are applied in a way that preserves user intent and workspace consistency, even during simultaneous edits. For example, if one user is splitting a block while another merges it with another block, both operations are resolved so that content is neither duplicated nor lost. Using the prior example to illustrate asynchronous editing, one user merges “milk,” and “oat milk,” to create:
[0102] “todo:” (text instance 0) (search label 0)
[0103] “milk, oat milk,” (text instance 0, search label 10) (text instance 1, search label 0)
[0104] “dairy milk,” (text instance 2) (search label empty)
[0105] “bread, tortilla,” (text instance 0, search label 11) (text instance 1, search label 1)
[0106] Another user merges “milk,” and “dairy milk,” to create:
[0107] “todo:” (text instance 0) (search label 0)
[0108] “milk, dairy milk,” (text instance 0, search label 10) (text instance 2, search label empty)
[0109] “oat milk,” (text instance 1) (search label 0)
[0110] “bread, tortilla,” (text instance 0, search label 11) (text instance 1, search label 1)
[0111] When merged, nodes are appended as children to a leaf node, maintaining hierarchy and data consistency. Each block automatically updates its text slice tree to represent its new content. The workspace's view now includes three distinct blocks, each with individualized content and tree structure:
[0112] “todo:” (text instance 0) (search label 0)
[0113] “milk, oat milk, dairy milk,” (text instances 0, search label 10) (text instance 1, search label 0) (text instance 2, search label empty)
[0114] “bread, tortilla,” (text instance 0, search label 11) (text instance 1) (search label 1)
[0115] Each block is rendered on the workspace page and backed by a unique text slice tree, which records operational history, user attributions, formatting, and / or structure. The final block arrangement reflects all collaborative actions, with the text slice trees ensuring a one-to-one correspondence between visual content and persistent data.
[0116] FIGS. 3A through 3E illustrate annotated representations of these actions. In particular, FIG. 3A illustrates the final state of the workspace of the prior example. Each rectangle represents a text slice, labeled with its rendered content, the block in which it appears, its conceptual text instance, and its search label (e.g., number values). Empty text slices are omitted for clarity. Text slices can be visualized by splits grouped by text instance (e.g., FIG. 3B) or by merges grouped by text slice tree (e.g., FIG. 3D). Organizing slices by their split relationships yields multiple linked lists, each representing a conceptual text instance. Organizing slices by their merge relationships yields multiple trees, each representing a block's current text slice tree.
[0117] FIGS. 3B and 3C illustrate split-first views, which refer to text slices grouped by text instance, corresponding to block split operations. The split-first views support queries such as “get all blocks with a slice of the current text instance,” handled as range queries over search labels. In particular, FIG. 3B is a split-first view of the text slices resulting from the above edits, grouped by text instance. Dotted-line boundaries correspond to splitting a slice into two slices, producing the resulting search labels. FIG. 3C is a split-first view of FIG. 3B superimposed with merges (represented as arrows) forming text slice trees.
[0118] FIGS. 3D and 3E illustrate merge-first views, which refers to text slices related by text slice trees, corresponding to block merger operations. The merge-first views support queries such as “get all slices across text instances that are part of the current block,” handled by the text slice tree of the block. In particular, FIG. 3D is a merge-first view of the text slices resulting from the above edits, grouped by text slice trees. The arrows (e.g., A→B) correspond to merging slices (e.g., merge slice A into the end of slice B). FIG. 3E illustrates a merge-first view of the resulting text slices, superimposed with splits represented as dashed lines, forming text instances.Text CRDT Instance
[0119] A text CRDT instance can be thought of as an array of nodes representing respective characters of text. Each node can have a character ID composed of a unique session ID and logical timestamp and reference another node. If multiple nodes reference the same node, the nodes can be sorted so that the one with the more recent logical timestamp is first (with the session ID used as a tiebreaker). Deletions can be performed by setting a node's deleted field to true without deleting the node. User visible text of a text CRDT instance can be obtained by iterating over its non-deleted nodes. Text can be annotated (e.g., highlighted) by marking the start and end nodes of a range over which the annotation should be applied.
[0120] FIG. 4 illustrates an example of a text CRDT instance 400 with insertions, deletions, and annotations. As shown, the text CRDT instance 400 includes the text “the brown fox” with respective characters in corresponding nodes that each have a unique identifier A@1 through A@19, in the order in which they were introduced. The boundaries of the text CRDT instance 400 include an end node that points back to the start node. The text CRDT instance 400 had undergone several text operations to the sequence of nodes that correspond to the original text “the quick fox.” Text operations included deleting the text “quick,” inserting the text “brown,” and highlighting the text “brown.” The deleted nodes remain in the text CRDT instance 400 but are labeled with an “x” to indicate that they should not be rendered. The arrows for each node point to the node it was meant to be inserted next to (to the right of).
[0121] FIG. 5 is a block diagram that illustrates an example of a text CRDT instance 500 split into two slices 502-1 and 502-2, owned and rendered by two different blocks. As shown, before the split, block 1 (500) includes the text “foobar” and after the split, block 1 (502-1) includes “foo” and block 2 (502-2) includes “bar.” Because subsequent splitting can lead to a slice being further divided into smaller slices, a slice can be considered a sub-list of nodes in a text CRDT instance 500 that starts and ends with either: the start node and the end node (an unsplit text CRDT instance), the start node and a split character, a split character and the end node, or two split characters.
[0122] In order to handle concurrent merges, the text of a block is represented as a text slice tree. Consider an example where two offline users have separately created a sibling to a block, then merged the sibling with the block. When merging a block with another block, the text slice tree of the source block can be conceptually reparented with the last text slice of the text slice tree in the target block. That is, when two blocks are merged, the second block's text slice tree is appended to the first block's text slice tree, as a child of the final leaf node. Reparenting can be an append-only operation, so if multiple slices are reparented to a slice, their order can be based on the order in which corresponding operations are successfully saved.
[0123] FIG. 6 illustrates an example 600 of creating a sibling block and then merging sibling blocks. At 602, two users A and B go offline after opening a page with the block 602 containing the text “foo.” At 604, user A inserts a new block with the text “bar” while at 606 user B inserts a new block with the text “baz.” At 608, user A merges “bar” with “foo” while at 610 user B merges “baz” with “foo.” At 612, when both users go back online, user A's changes are saved first (assuming user A went online first), followed by user B's changes. As such, the start node for each block gets reparented to the end node of the original block with the text “foo.” The resulting text is “foobarbaz.”
[0124] FIG. 7 is a block diagram 700 that illustrates an example of applying formatting to a range of text in block 1 that spans multiple text slices in a text slice tree and separate operations grouped in one transaction that are issued for each text slice. When a user applies formatting to a range of text in a block that spans multiple text slices in the text slice tree, separate operations (grouped in one transaction) can be issued for each text slice. This approach makes it possible to create formatting gaps between two slices, and there are potential limitations of modeling merges using a text slice tree.
[0125] FIG. 8 illustrates an example 800 of moving and merging text CRDT instances. At 802, two users open a page with two blocks containing the text “The” and “fox,” respectively. The two users then go offline. While offline, at 804, user A inserts a new block with the text “quick” between “The” and “fox” while at 806 user B merges the text “fox” with “The.” At 808, user A merges the text “quick” with “The” while at 810 user B highlights the text “The fox.” At 812, when users A and B go back online, the changes to the text caused by both users are merged. Assuming user A goes online first, followed by user B, the merged changes result in the text “The quick fox” where “The” and “fox” are highlighted but “quick” is not.
[0126] Implementation of a text slice tree to a digital workspace can entail adding a new field to a block data model to hold the text slice tree, updating search indexing, mentions, and backlinks, sharing emails and page activity to use resolved text value from text slice value search indexing, updating block duplication logic to copy text in the text slice tree to a new block, updating snapshotting / restore logic to work with the text slice tree, adding a new set of text transaction operations for modifying text in the text slice tree, changing transaction operation to apply logic to handle new text operations, and adding server validation to enforce constraints on text CRDTs.
[0127] When a block from a snapshot is restored, the workspace can delete existing text and re-insert the previous text value. Multiple fields can be used to support implementation of this text slice tree structure. For example, a JSON or byte field can be used to store the serialized text slice tree; a JSON object can contain text clocks with the keys as text CRDT instance IDs of text slices owned by the block and can be used to query for all blocks that own text slices of a given text CRDT instance and the values as the most recent logical timestamp across all character IDs in the corresponding text CRDT instance (i.e. across all text slices of the given text CRDT instance) to ensure that newly generated character IDs in a given text CRDT instance are unique across all slices of that instance; a boolean value can be used to indicate when descendants of a page block need to use a new text CRDT slice tree to allow nesting where descendants that use the CRDT structure can be nested in page blocks where descendants don't use the CRDT structure; and a boolean value can indicate whether a text block is using a new text CRDT slice tree or existing data fields which can also be used to determine whether a block using CRDT no longer has any text slices, because they have been moved to other blocks following to a merge.
[0128] FIG. 9 is a flowchart that illustrates a method 900 for merging edits performed asynchronously by multiple users on the same text. The method 900 can be executed by a computing system configured to support block-based collaborative editing or a digital workspace application. Each block can include content such as text, code, spreadsheet cells, drawing elements, or images. Each block can be represented as a structured tree of text slices. At 902, the digital workspace displays an initial state of one or more blocks. The initial state includes a hierarchy of elements that can include paragraphs, tables, embedded files, figures, or multimedia. In some embodiments, the block state is rendered via preorder traversal of a text slice tree, and the respective content of each block is derived from a composition of their text slice trees. Each text slice can include metadata and include values indicating as origination block, creation timestamp, and format attributes.
[0129] At 904, the initial block state is changed by a first user initiating a first editing operation on the block. The user can include a human user or an AI agent, for example. Examples of the editing operation include an insertion, deletion, splitting, merging, annotation (such as format or comments), or a formatting change affecting a portion of the block content. A modification that results from the edit operation can be encapsulated as a edit operation object. An operation can refer to a unique block identifier and a specific text CRDT instance within the block's slice tree. The unique block identifier can include a block ID, session ID, or timestamp. The operation can be uniquely attributable through a combination of one or more of a unique block identifier, operation attributes, and associated timestamps. The editing operation can be performed asynchronously or concurrently with other edits. The edits may be performed by the same user or different users. The edits can be conducted offline or online. In one embodiment, pending operations are synchronized once connectivity is restored.
[0130] At 906, a second user performs a second editing action on the block. The second editing operation can include an insertion, deletion, splitting, merging, annotation, or formatting action, for example. An operation can be persisted as a CRDT operation referencing the affected block and the relevant text slice. The merging and splitting operations are performed on text slices but are not themselves CRDT operations. In contrast, inserting, deleting, and formatting text are CRDT operations. The operation can affect more than one block and more than one relevant text slice. In one embodiment, the operation references a specific range of start and end character IDs within the text CRDT instance.
[0131] At 908, the system merges respective CRDT operations performed by the first user at 904 and second user at 906. The merge can be performed by traversing the operation log for each CRDT instance and applying each operation in a deterministic order. For example, logical timestamps, session IDs, and CRDT-specific conflict resolution algorithms can be used. In some embodiments, merge policies can include resolving overlapping insertions and deletions by using character or range IDs. The system can ensure that concurrent splitting or merging actions on the same block produce unique text slices with correct parentage. In another embodiment, the system can update annotation metadata atomically for overlapping ranges.
[0132] At 910, the system renders the current, converged version of the block. The converged version can be rendered to one or more clients, users, or agents. In one embodiment, rendering can leverage preorder traversal of each block's slice tree to reconstruct the composite content, including all textual and formatting changes applied. In further embodiments, metadata such as attribution, change highlights, and per-user views can be rendered. In one example, traversing the block tree can also be used to replay or verify changes.
[0133] FIG. 10 is a diagram 1000 that illustrates reconstructing text that has undergone text edit operations asynchronously by different users. User 1002 performs a split operation on block 1004 and adds text thereto. Although shown as text, block 1004 can include various content types (e.g., text, code fragments, spreadsheet cells, drawing elements, and images). The split operation causes the text slice tree 1006 of block 1004 to bifurcate into slice 1 and slice 2. The newly inserted text receives a unique character ID that can be composed of a session identifier, a timestamp of the associated operation, or a globally unique identifier. In an example (not shown), splitting block 1004 causes a special split character to be inserted in the text CRDT instance. All character nodes from the start node to the split character define slice 1 and all nodes from the split character to the end node define slice 2. Respective slice boundaries can be defined by unique character IDs.
[0134] User 1008 performs a merge operation between block 1004 and block 1010 to create new block 1012 and an operation to insert new text. The resulting block 1012 can contain a combination of text, code, spreadsheet cells, drawings, or images. The merge operation causes the slices from block 1004 and block 1012 (not shown) to join in a unified slice tree. The slices from the blocks 1004 and 1012 are merged according to a deterministic ordering protocol. The merging operation can utilize logical timestamps, session IDs, or defined ordering of character IDs. Merges can be executed through operation log replay, using the unique character IDs to sort and order the changes. The newly inserted text by user 1008 is assigned its own CRDT slice and unique character ID. The character ID can be composed of a session identifier, a corresponding timestamp, or a globally unique identifier. The combined slice tree of block 1012 is then traversed to reconstruct the final, merged text. The reconstruction may be executed using preorder traversal, in-order traversal, post-order traversal, or alternative customizable traversal algorithms.
[0135] The text editing operations are performed by human users, AI agents, or programmatically corresponding to users 1002 and 1008. The text editing operations performed by users 1002 and 1008 are performed asynchronously while their respective client devices are online or offline. In one example, operations performed offline are assigned a provisional identifier that is used to track the operations for AI tools to read, modify, or generate new block or slice data. In one example, an AI assistant revises text in a block and those changes are recorded as CRDT operations within the slice tree. Such changes can be merged together accurately, even if multiple AI agents or human users make concurrent changes.
[0136] FIG. 12 is a flow diagram that illustrates processes 1200 that involve using text slice trees for collaborative editing. The processes 1200 are performed by a system that can include a server and one or more clients. In one example, one or more processors executing instructions recorded on a non-transitory memory cause the system to perform the processes 1200.
[0137] At 1202, the system maintains a workspace including multiple blocks that are hierarchically related. Each block includes content and metadata defining relationships with other blocks of the workspace, and each block represents a data structure including a unique block identifier and at least one of a block type attribute, a block property, or a content attribute (e.g., an ordered identifier of child blocks, a parent block identifier).
[0138] At 1204, the system stores text content for each block in a database as a contiguous segment of text slices that are related hierarchically in a text slice tree, where the text belongs to one or more text conflict-free replicated data type (CRDT) instances. Further, each text CRDT instance includes nodes for respective characters of the text, and each node has a unique identifier for that text CRDT instance. The system designates each block as uniquely owning a corresponding text slice tree that is distinct from any other text slice tree of any other block of the workspace. The system can store each text slice tree as a searchable database record linked to its respective block, and record each text slice, associated metadata, and operational history in a searchable database table.
[0139] At 1206, the system processes editing operations on a text CRDT instance of a block by using its text slice tree. Examples of the editing operations include a split operation performed by client A to split a parent text slice by inserting a special character that creates at least one child slice, and a merge operation performed by client B to join a text slice of another block to the text slice tree of the source block. Additional examples of editing operations include moving, insertion, deletion, annotation, or formatting of text, where each editing operation is encapsulated as a CRDT operation object referencing the block and a text CRDT instance of the text. The system can process editing operations performed asynchronously on different blocks by different clients, where editing operations to a text slice tree of one block do not affect a text slice tree of another block.
[0140] In one example, a format editing operation can include modifying a visual property or semantic property of a text slice without altering content of other text slices. The system stores the result of the format editing operation in the database as metadata of the text slice. The system can dynamically modify metadata associated with each block based on changes made to the block or its text slice tree, such that the metadata reflects edits, formatting, or ownership transitions. In one example, the system issues separate CRDT operations for each text slice when applying formatting or annotation to a range of text that spans multiple slices within the block, and groups the CRDT operations together as a single transaction to synchronize the changes.
[0141] At 1208, the system can construct an edited version of the text that incorporates results of the editing operations by traversing nodes of the text slice tree of the block. The system thus enables concurrent editing of common text slices by multiple clients connected to the workspace, and indications of edits to the common text slices can be distributed in real-time for integration by the clients. The system can synchronize concurrent editing by the clients to the block of the workspace, where at least some of the concurrent edits were performed while at least one of the multiple clients was offline, and where each edit by a client to a text slice tree is preserved without overwriting other edits by other clients. In one example, the system reparents a text slice tree of a source block to a last text slice of a text slice tree of a target block and orders multiple reparented text slices based on an order in which corresponding operations are successfully saved.
[0142] At 1210, the system can propagate local and remote editing operations across multiple clients of the workspace, supporting both real-time and offline editing and merging concurrent or asynchronous operations using deterministic conflict resolution algorithms based on at least one of logical timestamps, session identifiers, or character identifiers. The system can communicate the editing operations (e.g., the split and merge operations) to all collaborating clients in real time, thereby maintaining synchronization of the workspace across clients. In one example, editing operations on the text slice tree are performed by either client while offline, and the system synchronizes the editing operations with other clients when the client goes back online.
[0143] In one example, a client device queues CRDT operations in persistent local storage while the client device is offline until network connectivity is restored. For example, if client device A is offline, upon reconnection to a network, client A transmits locally queued CRDT operations to the workspace server and receives remote CRDT operations performed by client device B editing the block while online. Client device A can merge local and remote CRDT operations using one or more deterministic algorithms based on logical timestamps, session identifiers, and / or character identifiers. As such, the system resolves overlapping insertions, deletions, or formatting operations to text by applying a deterministic ordering protocol based on logical timestamps, session identifiers, and / or character identifiers.
[0144] At 1212, the system renders the edited version of the text for each of the clients with the results of the editing operations shown to each within the workspace. In one example, each client displays change highlights, attribution information, and per-user views based on metadata collected from a merged text slice tree. As indicated earlier, reconstructing a current version of the text involves traversing the associated text slice tree in a predetermined order, rendering composite text content and formatting according to a deterministic order of the text slices. For example, upon completion of the editing operations, the system can render the edited version of the text by performing a preorder traversal of the text slice tree. In one example, the system assigns provisional identifiers to editing operations performed while offline, enabling tracking and attribution of edits upon synchronization when online. As such, the system can reconstruct the current version of the text by traversing the merged text slice tree, integrating edits performed both offline and online.Computer System
[0145] FIG. 12 is a block diagram that illustrates an example of a computer system 1200 in which at least some operations described herein can be implemented. As shown, the computer system 1200 can include: one or more processors 1202, main memory 1206, non-volatile memory 1210, a network interface device 1212, a display device 1218, an input / output device 1220, a control device 1222 (e.g., keyboard and pointing device), a drive unit 1224 that includes a machine-readable (storage) medium 1226, and a signal generation device 1230 that are communicatively connected to a bus 1216. The bus 1216 represents one or more physical buses and / or point-to-point connections that are connected by appropriate bridges, adapters, or controllers. Various common components (e.g., cache memory) are omitted from FIG. 12 for brevity. Instead, the computer system 1200 is intended to illustrate a hardware device on which components illustrated or described relative to the examples of the figures and any other components described in this specification can be implemented.
[0146] The computer system 1200 can take any suitable physical form. For example, the computer system 1200 can share a similar architecture as that of a server computer, personal computer (PC), tablet computer, mobile telephone, wearable electronic device, network-connected (“smart”) device (e.g., a television or home assistant device), augmented reality / virtual reality (AR / VR) system (e.g., head-mounted display), or any electronic device capable of executing a set of instructions that specify action(s) to be taken by the computer system 1200. In some implementations, the computer system 1200 can be an embedded computer system, a system-on-chip (SOC), a single-board computer (SBC) system, or a distributed system such as a mesh of computer systems or include one or more cloud components in one or more networks. Where appropriate, one or more computer systems 1200 can perform operations in real time, near real time, or in batch mode.
[0147] The network interface device 1212 enables the computer system 1200 to mediate data in a network 1214 with an entity that is external to the computer system 1200 through any communication protocol supported by the computer system 1200 and the external entity. Examples of the network interface device 1212 include a network adapter card, a wireless network interface card, a router, an access point, a wireless router, a switch, a multilayer switch, a protocol converter, a gateway, a bridge, a bridge router, a hub, a digital media receiver, and / or a repeater, as well as all wireless elements noted herein.
[0148] The memory (e.g., main memory 1206, non-volatile memory 1210, machine-readable medium 1226) can be local, remote, or distributed. Although shown as a single medium, the machine-readable medium 1226 can include multiple media (e.g., a centralized / distributed database and / or associated caches and servers) that store one or more sets of instructions 1228. The machine-readable medium 1226 can include any medium that is capable of storing, encoding, or carrying a set of instructions for execution by the computer system 1200. The machine-readable medium 1226 can be non-transitory or comprise a non-transitory device. In this context, a non-transitory storage medium can include a device that is tangible, meaning that the device has a concrete physical form, although the device can change its physical state. Thus, for example, non-transitory refers to a device remaining tangible despite this change in state.
[0149] Although implementations have been described in the context of fully functioning computing devices, the various examples are capable of being distributed as a program product in a variety of forms. Examples of machine-readable storage media, machine-readable media, or computer-readable media include recordable-type media such as volatile and non-volatile memory devices 1210, removable flash memory, hard disk drives, optical disks, and transmission-type media such as digital and analog communication links.
[0150] In general, the routines executed to implement examples herein can be implemented as part of an operating system or a specific application, component, program, object, module, or sequence of instructions (collectively referred to as “computer programs”). The computer programs typically comprise one or more instructions (e.g., instructions 1204, 1208, 1228) set at various times in various memory and storage devices in computing device(s). When read and executed by the processor 1202, the instruction(s) cause the computer system 1200 to perform operations to execute elements involving the various aspects of the disclosure.Remarks
[0151] The terms “example,”“embodiment,” and “implementation” are used interchangeably. For example, references to “one example” or “an example” in the disclosure can be, but not necessarily are, references to the same implementation; and such references mean at least one of the implementations. The appearances of the phrase “in one example” are not necessarily all referring to the same example, nor are separate or alternative examples mutually exclusive of other examples. A feature, structure, or characteristic described in connection with an example can be included in another example of the disclosure. Moreover, various features are described that can be exhibited by some examples and not by others. Similarly, various requirements are described that can be requirements for some examples but not other examples.
[0152] The terminology used herein should be interpreted in its broadest reasonable manner, even though it is being used in conjunction with certain specific examples of the invention. The terms used in the disclosure generally have their ordinary meanings in the relevant technical art, within the context of the disclosure, and in the specific context where each term is used. A recital of alternative language or synonyms does not exclude the use of other synonyms. Special significance should not be placed upon whether or not a term is elaborated or discussed herein. The use of highlighting has no influence on the scope and meaning of a term. Further, it will be appreciated that the same thing can be said in more than one way.
[0153] Unless the context clearly requires otherwise, throughout the description and the claims, the words “comprise,”“comprising,” and the like are to be construed in an inclusive sense, as opposed to an exclusive or exhaustive sense—that is to say, in the sense of “including, but not limited to.” As used herein, the terms “connected,”“coupled,” or any variants thereof mean any connection or coupling, either direct or indirect, between two or more elements; the coupling or connection between the elements can be physical, logical, or a combination thereof. Additionally, the words “herein,”“above,”“below,” and words of similar import can refer to this application as a whole and not to any particular portions of this application. Where context permits, words in the Detailed Description above using the singular or plural number may also include the plural or singular number, respectively. The word “or” in reference to a list of two or more items covers all of the following interpretations of the word: any of the items in the list, all of the items in the list, and any combination of the items in the list. The term “module” refers broadly to software components, firmware components, and / or hardware components.
[0154] While specific examples of technology are described above for illustrative purposes, various equivalent modifications are possible within the scope of the invention, as those skilled in the relevant art will recognize. For example, while processes or blocks are presented in a given order, alternative implementations can perform routines having steps, or employ systems having blocks, in a different order, and some processes or blocks may be deleted, moved, added, subdivided, combined, and / or modified to provide alternative or sub-combinations. Each of these processes or blocks can be implemented in a variety of different ways. Also, while processes or blocks are at times shown as being performed in series, these processes or blocks can instead be performed or implemented in parallel, or can be performed at different times. Further, any specific numbers noted herein are only examples such that alternative implementations can employ differing values or ranges.
[0155] Details of the disclosed implementations can vary considerably in specific implementations while still being encompassed by the disclosed teachings. As noted above, particular terminology used when describing features or aspects of the invention should not be taken to imply that the terminology is being redefined herein to be restricted to any specific characteristics, features, or aspects of the invention with which that terminology is associated. In general, the terms used in the following claims should not be construed to limit the invention to the specific examples disclosed herein, unless the Detailed Description above explicitly defines such terms. Accordingly, the actual scope of the invention encompasses not only the disclosed examples but also all equivalent ways of practicing or implementing the invention under the claims. Some alternative implementations can include additional elements to those implementations described above or include fewer elements.
[0156] Any patents and applications and other references noted above, and any that may be listed in accompanying filing papers, are incorporated herein by reference in their entireties, except for any subject matter disclaimers or disavowals, and except to the extent that the incorporated material is inconsistent with the express disclosure herein, in which case the language in this disclosure controls. Aspects of the invention can be modified to employ the systems, functions, and concepts of the various references described above to provide yet further implementations of the invention.
[0157] To reduce the number of claims, certain implementations are presented below in certain claim forms, but the applicant contemplates various aspects of an invention in other forms. For example, aspects of a claim can be recited in a means-plus-function form or in other forms, such as being embodied in a computer-readable medium. A claim intended to be interpreted as a means-plus-function claim will use the words “means for.” However, the use of the term “for” in any other context is not intended to invoke a similar interpretation. The applicant reserves the right to pursue such additional claim forms either in this application or in a continuing application.
Claims
1. A non-transitory, computer-readable storage medium comprising instructions recorded thereon, wherein the instructions, when executed by at least one data processor of a system, cause the system to:maintain a workspace comprising multiple blocks that are hierarchically related,wherein each block includes content and metadata defining relationships with other blocks of the workspace, andwherein each block represents a data structure including a unique block identifier and at least one of a block type attribute, a block property, or a content attribute;store text content for each block in a database as a contiguous segment of text slices that are related hierarchically in a text slice tree,wherein the text belongs to one or more text conflict-free replicated data type (CRDT) instances, andwherein each text CRDT instance includes nodes for respective characters of the text and each node has a unique identifier for that text CRDT instance;process editing operations on a first text CRDT instance of a first block by using a first text slice tree of the first block, the editing operations including:a split operation performed by a first client on a parent block to split the corresponding parent text slice by inserting a special character that creates a new child block and corresponding child text slice tree, and reparents a child text slice of the parent's text slice tree to the child text slice tree, anda merge operation performed by a second client to join a second text slice of a second block to the first text slice tree of the first block;construct an edited version of the first text that incorporates results of the editing operations by traversing nodes of the first text slice tree of the first block; andrender the edited version of the first text for each of the first client and the second client with the results of the editing operations shown within the workspace.
2. The non-transitory, computer-readable storage medium of claim 1, wherein the system is further caused to, for each block:designate the block as uniquely owning a corresponding text slice tree that is distinct from any other text slice tree of any other block of the workspace.
3. The non-transitory, computer-readable storage medium of claim 1, wherein the system is further caused to:apply a format editing operation to the first text slice, a result of the format editing operation including modifying a visual property or semantic property of the first text slice without altering content of other text slices of the text CRDT instance; andstore the result of the format editing operation in the database as metadata of the first text slice.
4. The non-transitory, computer-readable storage medium of claim 1, wherein the system is further caused to:dynamically modify metadata associated with each block based on changes made to the block or its text slice tree, such that the metadata reflects edits, formatting, or ownership transitions.
5. The computer-readable storage medium of claim 1, wherein the system is further caused to:synchronize concurrent editing by multiple clients to the first block of the workspace,wherein at least some of the concurrent edits were performed while at least one of the multiple clients was offline, andwherein each edit by a client to a text slice tree is preserved without overwriting other edits by other clients.
6. The computer-readable storage medium of claim 1, wherein the system is further caused to:process editing operations performed asynchronously on different blocks by different clients,wherein editing operations to a text slice tree of a corresponding block do not affect a text slice tree of any other block.
7. The computer-readable storage medium of claim 1, wherein the system is further caused to:upon completion of the editing operations, render the edited version of the first text on the first block by performing a preorder traversal of the first text slice tree.
8. The computer-readable storage medium of claim 1, wherein the system is further caused to:communicate the editing operations, including the split and merge operations, to all collaborating user devices in real time, thereby maintaining synchronization of the workspace across clients.
9. The computer-readable storage medium of claim 1, wherein the system is further caused to:while offline, enable editing operations on the first text slice tree by the first and second clients; andwhen online with the workspace, synchronize editing operations performed by the first or second clients while offline.
10. The computer-readable storage medium of claim 1, wherein the system is further caused to:enable concurrent editing of common text slices by multiple clients connected to the workspace; anddistribute indications of edits to common text slices in real time for integration by the multiple clients.
11. A method for block-based text editing in a digital workspace, the method comprising:representing a block of the digital workspace as a discrete unit associated with a text slice tree that has a hierarchical structure,wherein each node of the text slice tree corresponds to a text slice containing a portion of text and associated metadata;storing each text slice tree as a searchable database record linked to its respective block, and recording each text slice, associated metadata, and operational history in a searchable database table;performing editing operations on the text slices, including splitting, merging, moving, insertion, deletion, annotation, or formatting of text,wherein an editing operation is encapsulated as a conflict-free replicated data type (CRDT) operation object referencing the block and a text CRDT instance of the text;propagating local and remote CRDT operations across multiple clients of the digital workspace, supporting both real-time and offline editing, and merging concurrent or asynchronous operations using deterministic conflict resolution algorithms based on at least one of logical timestamps, session identifiers, or character identifiers; andreconstructing a current version of the text by traversing the associated text slice tree in a predetermined order, rendering composite text content and formatting according to a deterministic order of the text slices.
12. The method of claim 10, wherein each text slice includes metadata comprising at least one of:a format attribute,attribution information,an originating block identifier,version information, andoperational history,wherein the metadata is updated dynamically in response to editing operations.
13. The method of claim 11, wherein splitting the text comprises:inserting a special split character in the text CRDT instance,wherein nodes from a start node through the split character define a first slice, and nodes from the split character through an end node define a second slice, each assigned to separate blocks.
14. The method of claim 11, wherein merging blocks comprises:reparenting a text slice tree of a source block to a last text slice of a text slice tree of a target block; andordering multiple reparented text slices based on an order in which corresponding operations are successfully saved.
15. The method of claim 11, further comprising:issuing separate CRDT operations for each text slice when applying formatting or annotation to a range of text that spans multiple slices within the block; andgrouping the CRDT operations together as a single transaction.
16. A client device comprising:a processor; anda memory storing a local copy of a text slice tree of a block of a digital workspace, each node of the text slice tree representing a text slice containing a portion of text and associated metadata, wherein the memory stores instructions that, when executed by the processor, cause the client device to:perform editing operations on the text slice tree while the client device is offline,wherein the editing operations include at least one of: insertion, deletion, splitting, merging, annotation, or formatting of text, andwherein an editing operation is encapsulated as a conflict-free replicated data type (CRDT) operation object;upon reconnection to a network, transmit locally queued CRDT operations to a server and receive remote CRDT operations performed by another client device editing the block while online;merge local and remote CRDT operations using one or more deterministic algorithms based on logical timestamps, session identifiers, and character identifiers; andreconstruct a current version of the text by traversing the merged text slice tree, integrating edits performed both offline and online.
17. The client device of claim 16 further caused to:assign provisional identifiers to CRDT operations performed while offline, enabling tracking and attribution of edits upon synchronization when online.
18. The client device of claim 16 further caused to:queue CRDT operations in persistent local storage while the client device is offline until network connectivity is restored.
19. The client device of claim 16 further caused to:resolve overlapping insertions, deletions, or formatting operations to the text by applying a deterministic ordering protocol based on logical timestamps and session identifiers.
20. The client device of claim 16 further caused to:display change highlights, attribution information, and per-user views based on metadata collected from a merged text slice tree.
Citation Information
Patent Citations
System, method, and computer program for enabling text editing across multiple content blocks in a system
US11687701B1
Systems, methods, and media for implementing conflict-free replicated data types in in-memory data structures
US20220121627A1
