Methods and systems for opening and incrementally displaying documents
Systems and methods for opening documents and incrementally loading document fragments are provided. Upon generating a user interface associated with the document, a client device may generate a document fragment model of a portion of the document for display via the user interface. As the user navigates through the document, document fragment models of additional portions of the document are predictively generated for low-latency display via the user interface.
1 . A computer-implemented method for low-latency incremental display of a document at a client device, the method comprising:
generating, by one or more processors of the client device, a user interface that includes a primary viewport for displaying portions of the document and a secondary view port for navigating within the document;
detecting, by the one or more processors, a first event indicating that initial portions of the document are to be cached for viewing via the primary viewport, wherein the first event is generated in response to an output of a search query or a learning algorithm and is not generated by user input selecting a document displayed in a selection interface;
in response to detecting the first event, generating a document fragment model for the initial portions of the document, wherein:
the initial portions are defined by metadata associated with the document,
the initial portions include a first portion that is cached for display by the client device upon the primary viewport being configured to display the document by a viewing event and one or more second portions that are not displayed when the primary viewport is initially configured to display the document, and
the initial portions include less than all portions of the document;
in response to detecting the viewing event for the document, displaying, in the primary viewport, the first portion of the document fragment model;
detecting, via the user interface, a second event including an indication of the one or more second portions of the document;
detecting, by the one or more processors, a navigation event in the secondary view port related to one or more third portions of the document not included in the initial portion of the document;
transmitting, by the one or more processors, an incremental data request including an indication of the one or more third portions of the document in response to the navigation event;
receiving an incremental data response including the one or more third portions of the document;
generating, in response to receiving the incremental data response, a document fragment model for the third portions of the of the document; and
deleting, by the one or more processors, the document fragment model for the second portions of the document in response to the one or more processors determining that a portion of the document displayed via the primary viewport is at least a threshold distance from the second portions of the document.
2 . The computer-implemented method of claim 1 , wherein to generate a document fragment model for a particular portion of the document, the method comprises further comprising:
storing, by the one or more processors, the document fragment model for the particular portion of the document in a data memory of the client device.
3 . The computer-implemented method of claim 1 , wherein detecting the viewing event comprises:
detecting, via the user interface, a document navigation event indicating the document.
4 . The computer-implemented method of claim 1 , wherein:
the first portion of the document and the second portions of the document are separated by a page break, and
detecting the second event comprises detecting, by the one or more processors, a navigation event associated with the page break being displayed in the primary viewport.
5 . The computer-implemented method of claim 1 , wherein transmitting the incremental data request comprises:
determining, by the one or more processors, a scroll speed associated with the primary viewport; and
based on the scroll speed, determining, by the one or more processors, a size of the one or more third portions of the document requested by the incremental data request.
6 . The computer-implemented method of claim 1 , wherein transmitting the incremental data request comprises:
transmitting, to a memory storing data associated with the document, the incremental data request.
7 . The computer-implemented method of claim 1 , further comprising:
detecting, by the one or more processors, a third event indicating that a second document is to be viewed via the primary viewport; and
in response to detecting the third event, deleting, by the one or more processors, the document fragment model for the third portions of the document; and
in response to detecting the third event, maintaining, by the one or more processors, the document fragment model for the first portion of the document.
8 . The computer-implemented method of claim 1 , wherein:
the document is associated with metadata indicating a region of the document is associated with at least one of highlighting, redactions, or annotations; and
generating the document fragment model for a particular portion of the document comprises generating the document fragment model in accordance with the metadata.
9 . The computer-implemented method of claim 1 , wherein displaying the one or more third portions of the document in the primary viewport occurs within 1 second of the receiving of a third event including an indication of the one or more third portions of the document.
10 . The computer-implemented method of claim 1 , further comprising:
in response to detecting the first event, generating a document fragment model for initial portions of a second document, the initial portions including a first portion that is displayed upon the primary viewport being configured to display the second document and one or more second portions that are not displayed when the primary viewport is initially configured to display the second document
detecting, by the one or more processors, a third event indicating that the second document is to be viewed via the primary viewport; and
in response to detecting the third event, maintaining, by the one or more processors, the document fragment model for the initial portions of the document while deleting the document fragment model for any other portions of the document.
11 . A system for low-latency incremental display of a document at a client device, the system comprising:
one or more processors; and
a non-transitory memory storing instructions that, when executed by the one or more processors, cause the system to:
generate a user interface that includes a primary viewport for displaying portions of the document and a secondary view port for navigating within the document;
detect a first event indicating that initial portions of the document are to be cached for viewing via the primary viewport, wherein the first event is generated in response to an output of a search query or a learning algorithm and is not generated by user input selecting a document displayed in a selection interface;
in response to detecting the first event, generate a document fragment model for the initial portions of the document, wherein:
the initial portions are defined by metadata associated with the document,
the initial portion include a first portion that is cached for display by the client device upon the primary viewport being configured to display the document by a viewing event and one or more second portions that is not displayed when the primary viewport is initially configured to display the document, and
the initial portions include less than all portions of the document;
in response to detecting the viewing event for the document, display, in the primary viewport, the first portion of the document fragment model;
detect, via the user interface, a second event including an indication of the one or more second portions of the document;
detect a navigation event in the secondary view port related to one or more third portions of the document not included in the initial portion of the document;
transmit an incremental data request including an indication of the one or more third portions of the document in response to the navigation event;
receive an incremental data response including the one or more third portions of the document;
generate, in response to receiving the incremental data response, a document fragment model for the third portions of the of the document; and
delete the document fragment model for the second portions of the document in response to determining that a portion of the document displayed via the primary viewport is at least a threshold distance from the second portions of the document.
12 . The system of claim 11 , further comprising:
a data memory configured to store document fragment models of the document;
wherein to generate a document fragment model for a particular portion of the document, the instructions, when executed, cause the system to store the document fragment model for the particular portion of the document in the data memory.
13 . The system of claim 11 , wherein to detect the first event, the instructions, when executed, cause the system to:
detect an event generated in responses to an output of a search query or a learning algorithm.
14 . The system of claim 11 , wherein to detect the viewing event, the instructions, when executed, cause the system to:
detect, via the user interface, a document navigation event indicating the document.
15 . The system of claim 11 , wherein:
the first portion of the document and the second portions of the document are separated by a page break, and
to detecting the second event, the instructions, when executed, cause the system to detect a navigation event associated with the page break being displayed in the primary viewport.
16 . The system of claim 11 , further comprising:
a cache configured to store a document model associated with the document;
wherein to transmit the incremental data request, the instructions, when executed, cause the system to transmit, to the cache, the incremental data request.
17 . The system of claim 11 , wherein the instructions, when executed, cause the system to:
detect a third event indicating that a second document is to be viewed via the primary viewport;
in response to detecting the third event, delete the document fragment model for the third portions of the document; and
in response to detecting the third event, maintain the document fragment model for the first portion of the document.
18 . The system of claim 11 , wherein the instructions, when executed, cause the system to:
in response to detecting the first event, generate a document fragment model for initial portions of a second document, the initial portions including a first portion that is displayed upon the primary viewport being configured to display the second document and one or more second portions that are not displayed when the primary viewport is initially configured to display the second document;
detect a third event indicating that the second document is to be viewed via the primary viewport; and
in response to detecting the third event, maintain the document fragment model for the initial portions of the document while deleting the document fragment model for any other portions of the document.
19 . A non-transitory computer readable medium storing processor-executable instructions that, when executed by one or more processors, cause the processors to:
generate a user interface that includes a primary viewport for displaying portions of a document and a secondary view port for navigating within the document;
detect a first event indicating that initial portions of the document are to be cached for viewing via the primary viewport, wherein the first event is generated in response to an output of a search query or a learning algorithm and is not generated by user input selecting a document displayed in a selection interface;
in response to detecting the first event, generate a document fragment model for the initial portions of the document, wherein:
the initial portions are defined by metadata associated with the document,
the initial portions including a first portion that is cached for display by the client device upon the primary viewport being configured to display the document by a viewing event and one or more second portions that is not displayed when the primary viewport is initially configured to display the document, and
the initial portions include less than all portions of the document;
in response to detecting the viewing event for the document, display, in the primary viewport, the first portion of the document fragment model;
detect, via the user interface, a second event including an indication of the one or more second portions of the document;
transmit an incremental data request including an indication of one or more third portions of the document not included in the initial portion of the document;
receive an incremental data response including the one or more third portions of the document;
generate, in response to receiving the incremental data response, a document fragment model for the third portions of the of the document; and
delete the document fragment model for the second portions of the document in response to determining that a portion of the document displayed via the primary viewport is at least a threshold distance from the second portions of the document.