letsfindaway / OpenBoard

I'm using this fork to contribute features and fixes to the upstream project. In order to create good pull requests, I'm rebasing my feature branches, squashing and reordering commits, etc. If you fork this repository be aware that my development branches may rewrite history without prior notice.
http://openboard.ch/
GNU General Public License v3.0
9 stars 0 forks source link

(WIP) reworking thumbnails handling #189

Closed letsfindaway closed 1 month ago

letsfindaway commented 1 month ago

to avoid multiple and potentially heavy useless calls making the whole user experience very bad in terms of performances. Simplified messages that could also cause some lags.

This PR is for review only. It is not meant to be ever merged. Instead it helps me to review the changes and to comment on them, as I can mark files as visited, etc.

letsfindaway commented 1 month ago

With the current dev as of 1.7.2rc-241004 I have an issue when resizing the left sidebar.

When I e.g. increase the size of the sidebar, then the icons get larger. That's ok. But if you scroll down to the bottom, not all pages are visible. OTOH, if you make the sidebar smaller and the icons get smaller, then there is an empty area at the end.

It seems as if the height of the scroll area is not adjusted according to the overall size of the thumbnails.

I think in the resize event handler it must be assured that setSceneRect() is again called with the adjusted values.

letsfindaway commented 1 month ago

Another bug: Metadata is not always written. To reproduce:

kaamui commented 1 month ago

ouch ! thank you for finding this before end users do !

kaamui commented 1 month ago

I didn't expect that the order of creation of metadata or pages would matter. It should probably not.

edit : oh I didn't see that the path is created right after. But still, I don't think the creation of the folder or the pages or the metadata of a document should be handled separately of the persistence of the documents we want to save. if you need to save path/to/the/document we do so, and create subsequent folders if needed.

kaamui commented 1 month ago

Also, I wonder if we should not create them (metadata.rdf) when we find them to be missing. Do you see any reason why we should/could not ?

letsfindaway commented 1 month ago

Also, I wonder if we should not create them (metadata.rdf) when we find them to be missing. Do you see any reason why we should/could not ?

Can we derive all necessary information from the other files? But I think we can:

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ub="http://uniboard.mnemis.com/document"> 
    <!-- just create an arbitrary UUID for the document -->
    <Description about="http://uniboard.mnemis.com/document/df912da6-1fcb-4f43-8c6d-2aa6caf1d728">
        <!-- Folder creation date in another format -->
        <dc:title>08.09.24 11:16</dc:title>
        <!-- type seems to contain documentGroupName. Leave it empty -->
        <dc:type></dc:type>
        <!-- again date of the folder -->
        <dc:date>2024-09-08T09:16:26Z</dc:date>
        <!-- contstant -->
        <dc:format>image/svg+xml</dc:format>
        <!-- same UUID as above -->
        <dc:identifier>http://uniboard.mnemis.com/document/df912da6-1fcb-4f43-8c6d-2aa6caf1d728</dc:identifier>
        <!-- constant -->
        <ub:version>4.8.0</ub:version>
        <!-- from UBSettings::settings()->pageSize? -->
        <ub:size>1696x960</ub:size>
        <!-- same date as above or newest date of any page file in this folder -->
        <ub:updated-at>2024-09-08T09:17:13Z</ub:updated-at>
    </Description>
</RDF>

But I hope that documents with missing metadata are very rare, so this does not seem to be important to me.

letsfindaway commented 1 month ago

Note that metadata is still not updated when a scene is written. I would expect that ub:updated-at would reflect the latest update of a scene. This is not the case.

To minimize writing metadata one could also think about introducing a "dirty" flag and only actually save the metadata when switching documents, closing OpenBoard or after some timeout (like with the settings).

kaamui commented 1 month ago

Note that metadata is still not updated when a scene is written. I would expect that ub:updated-at would reflect the latest update of a scene. This is not the case.

To minimize writing metadata one could also think about introducing a "dirty" flag and only actually save the metadata when switching documents, closing OpenBoard or after some timeout (like with the settings).

It is no longer done inside peristCurrentScene but it is supposed to be replaced by direct calls when necessary, but it is possible I forgot some cases. I' ll look at it more seriously later this week

letsfindaway commented 1 month ago

I'm closing this PR now as I think that the topic it was about is now solved and dev has again a stable version.